Major correction: ColdFusion 10 Cluster setup in server.xml

So, this incorrect statement on various offical Adobe pages has cost me many hours of frustration!

We want ColdFusion 10 Enterprise, installed with the built-in Tomcat 7, to run on Apache 2.2. And we want to avoid Sticky Sessions, but we definitely want Session Replication because we have a large, complex legacy system that relies on Sessions with complex objects, and a rewrite of all this code at the moment is not feasible.

The above requiments should be fairly simple to set up, if we just follow the Adobe instructions below, right?

http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea77859461172e0811...

Wrong. :(

After hours of digging and playing with various config and xml files, I finally realized this morning that something is wrong about the way Adobe automatically configures the cf_install_dir\instance-name\runtime\conf\server.xml file for clustering. The end result was that only Sticky Sessions would work, and when I disabled Sticky Sessions from the CF Admin cluster setup, then Session Replication failed. I set up the following simple test to see if Session Replication was working.

1.) Make sure you set up the cluster correctly in the CF Admin, with 2-3 nodes (CF instances).

2.) Make sure you have disabled the checkbox for Sticky Sessions, and restart each CF instance.

3.) Run the following code in a temp /cluster directory in your web root:

Application.cfc

index.cfm

4.) F5 refresh your browser 5-10 times and you'll that different instances are being hit, but the sessionid is changing each time. This means replication is not working, so sessions will be useless on your system.

 

After reading in this Tomcat 7 Cluster HOWTO article that the Cluster XML node should be in the Engine or Host node, I decided to move the Cluster node up from below the Host node to up into the Host node. Voila! After I restart each CF instance in my cluster, Session Replication started working like a charm!

Here's how one of my server.xml files is organized:

Has anyone else noticed this problem? I don't see it in the CF bug base, but I have seen a number of blog posts where smart folks said they couldn't get Session Replication to work on CF10. 

Aaron Longnion

Aaron Longnion

Web developer/architect turned solo web entrepreneur. Let's talk ColdFusion, jQuery, and about startups.

Archive

2013 (2)
Posterous theme by Cory Watilo