Copy link to clipboard
Copied
Hi there
Does any one have a fool-proof document for creating and proving a 2 server ColdFusion 10 cluster? Most of the documents I have found are missing something.
More specifically, what is the difference between HTTP Port and Admin Component Port in the remote instance manager?
Should the Cluster Manager show anything on the remote node?
Is there a cluster monitor that show's its state? Is the there a simple test to prove it works.
If this is in the remote node server.xml
<Engine jvmRoute="cfusion" name="Catalina" defaultHost="localhost">
should the jvmRoute value in the Instance Manager should be set to cfusion?
Thanks for your help
Richard
Hi Richard
Two important points for ColdFusion 10 Session Replication
1> ColdFusion 10 servers must be Enterprise Edition
2> All the Servers(Machines) should be under same Network (same subnet)
Below is the example of two IP Addresses in the same Subnet
10.40.166.xx (say 34)
10.40.166.xx (say 121)
Test Application.cfc and Test.cfm (At the bottom)
Steps to perform:
Enable the J2EE session variables for both the ColdFusion servers under Memory Variables in ColdFusion Administrator
Create a local instance
...Copy link to clipboard
Copied
Hi Richard
Two important points for ColdFusion 10 Session Replication
1> ColdFusion 10 servers must be Enterprise Edition
2> All the Servers(Machines) should be under same Network (same subnet)
Below is the example of two IP Addresses in the same Subnet
10.40.166.xx (say 34)
10.40.166.xx (say 121)
Test Application.cfc and Test.cfm (At the bottom)
Steps to perform:
Enable the J2EE session variables for both the ColdFusion servers under Memory Variables in ColdFusion Administrator
Create a local instance (say test1) and create a remote instance (say test 2) on the remote machine.
Go ahead and Register the remote instance (test2) in the ColdFusion Administrator . Create a cluster and add both the instances (test1 and test2).
Now add the cluster tag information in the server.xml (between </host> and </engine>) of the remote instance using the help document of ColdFusion 10 mentioned below
http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea77859461172e0811cbf363c31-7ffa.html
NOTE : Make sure you change the multicast port in the server.xml of the remote instance with the Multicast port number when you create cluster in ColdFusion Admin console.
Open the context.xml of the remote instance (test2) and make sure that the “Manager pathname” is comment out.
Also, make sure that in the context.xml of local machine instance (test1), “Manager pathname” is comment out.
Stop and Start remote instance first (test2) using command prompt and then stop and start instance (test1) using command prompt.
Place the App folder in the wwwroot of both the instances. Create a cluster using the Web Server Configuration tool using the cluster and then test the Session replication behavior.
Also, place the .cfc and .cfm in Web root folder (wwwroot) and then try to access the Test.cfm from there. Then note down the session ID and instance name, refresh the page and observe that the Session ID is same for other instance or not. You can stop any one instance and refresh the same page then check the same instance is getting the same session ID or not.
Application.cfc
<cfcomponent>
<cfset this.name = "SessionApp" />
<cfset this.sessionmanagement = "true" />
<cfset this.sessiontimeout = createTimeSpan(0,5,0,0) />
</cfcomponent>
Test.cfm
<cfset Session.svar="Test">
<cfdump var="#Session#" />
<cfscript>
hostaddress = createObject("java", "java.net.InetAddress").localhost.getHostAddress();
</cfscript>
IP Address: <cfdump var="#hostaddress#"><br />
Hope it helps
VJ
Copy link to clipboard
Copied
I'm having a similar problem. I have two separate cold fusion servers on the same subnet. Each server has one CF instance of the same application. I want to cluster these two instances.
I've created a cluster on server1. In that cluster I added the one instance that resides on that server. I then edited the server xml for the second instance on the other cf server and added the cluster tag information from from your response above (making sure that the multicast port is correct). I then recycled both servers.
The problem I have is how do I add the instance on the remote server to the cluster? If I go into the cf admin on server1, I don't see the remote instance to be able to add it to the cluster. If I go to the cfadmin on the remote server, it has no cluster configuration at all.
I'm a little lost. Any suggestions?
Copy link to clipboard
Copied
Hi rdjanna
Once you go to the main instance say cfusion in the server one then under Enterprise manager , click on Instance Manager and click on Register Remote Instance.
NOTE : This is an Enterprise feature and this option will be available on the default/main instance (say cfusion) which gets created at the time of CF install
Thanks
VJ
Copy link to clipboard
Copied
Yes! That was the missing piece I needed. Thank you so much.
One more question, now that I have this cluster configured on server1, if I go to the cf admin under server 2 it shows no cluster configuration of any kind. Is that the way it should be?
My concern is that if someone were to check cf admin on the second server they would have no idea that this was part of a cluster. I would think that both servers should show the same cluster configuration.
Copy link to clipboard
Copied
As you are creating the cluster in server 1 then server would not have the info for the same. That is why, you need to add the cluster info in the server.xml of the other instance(server2) as explained above
Now add the cluster tag information in the server.xml (between </host> and </engine>) of the remote instance using the help document of ColdFusion 10 mentioned below
http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea778594611 72e0811cbf363c31-7ffa.html
Yes, both the instances have same settings. Also, if you want the load balancer that if 1 server fails then the request with same session goes to server 2, then the same will happen for cf admin.
Thanks
VJ
Copy link to clipboard
Copied
Vishu
Thank you for your fast reply. I'm still having problems though. 😞
Both are Enterprise servers and both are on the same subnet.
I have created 2 new instances called cluster1 and cluster2, one on each server. Both show HTTP Port 8501 and Remote Port 8103.
On cluster1 server, I add in a New Remote Instance:
Instance Name: cluster2
Remote IP/Name - servername of second server
Remote Port: 8103
HTTP Port: 8501
JVMRoute - In the server.xml in the cluster2 instance, the line is
<Engine jvmRoute="cluster2" name="Catalina" defaultHost="localhost"> so I have entered "cluster2" for jvmroute
Load Balance Factor:1
Admin Component Port: 8500 - the port for the main instance (the 'cfusion' instance")
Admin Username and Passwords: My administrator details.
The remote instance does then appear in the list.
I have added the cluster code in the to cluster2 runtime/conf/server.xml file after the </host> tag.
I have commented out the ManagerPath in context.xml.
On the first server I created a cluster and added the local cluster1 and the cluster2_remoteserver name to the server. I restarted both servers
In the coldfusion-out.log in the cluster2 and cluster1 logs I get
Cluster1
22-Aug-2013 10:54:43 org.apache.catalina.tribes.util.UUIDGenerator <clinit>
INFO: Creation of SecureRandom instance for UUID generation using [SHA1PRNG] took [5,002] milliseconds.
22-Aug-2013 10:54:43 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 500
22-Aug-2013 10:54:43 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4
22-Aug-2013 10:54:44 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:4
22-Aug-2013 10:54:45 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8
22-Aug-2013 10:54:46 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:8
INFO: Starting clustering manager at localhost#/
22-Aug-2013 10:55:15 org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
INFO: Manager [localhost#/]: skipping state transfer. No members active in cluster group.
22-Aug-2013 10:55:15 org.apache.catalina.ha.session.JvmRouteBinderValve startInternal
Cluster2
22-Aug-2013 10:14:44 org.apache.catalina.ha.tcp.SimpleTcpCluster startInternal
INFO: Cluster is about to start
22-Aug-2013 10:14:44 org.apache.catalina.tribes.transport.ReceiverBase bind
INFO: Receiver Server Socket bound to:/xxxxxxxxxxx:4003
22-Aug-2013 10:14:49 org.apache.catalina.tribes.util.UUIDGenerator <clinit>
INFO: Creation of SecureRandom instance for UUID generation using [SHA1PRNG] took [5,002] milliseconds.
22-Aug-2013 10:14:49 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 500
22-Aug-2013 10:14:49 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4
22-Aug-2013 10:14:50 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:4
22-Aug-2013 10:14:50 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8
22-Aug-2013 10:14:51 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:8
INFO: Starting clustering manager at localhost#/
22-Aug-2013 10:15:19 org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
INFO: Manager [localhost#/]: skipping state transfer. No members active in cluster group.
22-Aug-2013 10:15:19 org.apache.catalina.ha.session.JvmRouteBinderValve startInternal
Any ideas on what might being going wrong?
Thanks
Richard
Copy link to clipboard
Copied
Vishu
Ignore last post.
I'd not checked that the multicast ports were the same. Coldfusion defaulted to 45564 and the paste-in code used 45565.
All working now - with your test program I can see the session id staying the same but the instance name changes.
Thank you so much!
Richard
Copy link to clipboard
Copied
Hi all,
I already follow all the steps advise. But now my cfadmin only pointing to remote instance. I cant view server 1 cf admin. From this cf admin i cant view menu for enterprise manager to add more instance in cluster.
Please help
Shaffiq