Setup for CFMX 6.1 JRun4 Clustered Servers (Windows)
Assumptions and warnings:
-Assumes you have CFMX 6.1 Installer and do not have JRun4 installed yet.
-Does not matter if CFMX 6.1 "Server Configuration" (Ent or Pro) already installed, except that JRun cfusion server post installation configuration wizard will install ODBC services which will 'overwrite' any existing CFMX ODBC Services, while pointing the services to the JRun server instance. To later reconfigure CFMX "Server Configuration" for ODBC Services again, edit {CFusionMX}/lib/adminconfig.xml to change this element's text value true:
-Then run the CF Admin which will present the post-install configuration wizard again.
Install option 2 for JRun4 with CFMX "cfusion" deployed
-Run CFMX 6.1 Installer
-Choose Option 2: JRun4 with CFusion Deployed
-When the JRun server "cfusion" is started, launch the ColdFusion Administrator on that instance through the JWS port (8100).
-Complete the configuration wizard in the CFAdmin
-Enter the page "Memory Variables", check box for "Use J2EE session variables", click Apply
-Stop the cfusion server instance from the Services
Save cfusion-ear as a template for other server instances
-Find {JRun4}/servers/cfusion/cfusion-ear/
-Move CFIDE directory {JRun4}/servers/cfusion/cfusion-ear/cfusion-war/CFIDE/ to the document root for the final webserver to be configured for the cluster (later).
-Remove all class files from {JRun4}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfclasses/
-Copy cfusion-ear to a Temp directory to be used as a "template" for other CFMX Jrun server instances
-Edit the {Temp}/cfusion-ear/cfusion-war/WEB-INF/jrun-web.xml, set the element jrun-web-app/session-config/persistence-config/active to value of false.
-Save the jrun-web.xml
Workaround to enable basic session replication
-Check {JRun4}/bin/jvm.config's java.class.path. Remove two sub-paths from classpath:
1) {application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cfusion.jar
2) {application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib
-Final classpath may look like:
java.class.path={application.home}/servers/lib,{application.home}/lib/jrun.jar,{application.home}/lib
-Save jvm.config
CFMX 6.1 Updater 1 required for session replication issues (for cflock and nested structures)
Create new server instances, create cluster, configure servers
-Start JMC
-If original "cfusion" server instance not needed, delete server cfusion through the JMC
-Create New Server A
-Create New Server B
-Create New Cluster 1
-Add Server A to Cluster 1
-Add Server B to Cluster 1
-Manually remove "default-ear" directory from Server A and Server B directory structure under {JRun4}/servers/{servername}/
-Copy the Temp cfusion-ear directory and contents to each server instance under {JRun4}/servers/{servername}/
-Start Servers A and B From JMC
-Edit Server A and Server B Configuration
-Click on server from the JMC Home
-Remove Flash Remoting EAR from each server instance
-Click on cfusion-ear under "Enterprise Applications"
-Click on Macromedia ColdFusion MX under "Web Applications"
-Set Context Path field to /
-Check box for Enable Session Replication (Which automatically checks Enable File-based Session Persistence)
-Add either the wildcard * to New Replication Buddy or add all OTHER cluster members to New Replication Buddy (For example, if editing Server A then add Server B name to this field)
-Click Add
-Click Apply
-Repeat for all remaining server members
-Note that when re-editing the General Settings for a server instance, if context root is set to / then it will not be displayed in the JMC. If you apply any other settings changes you must populate the Context Path field again with /
-Return to JMC Home page
Enabling Sticky Sessions
-Enable "Sticky Sessions" for cluster members if desired by editing {JRun4}/servers/{servername}/SERVER-INF/jrun.xml for each server instance
-Find the Proxy Service node in jrun.xml and add an element for Sticky Sessions with value of TRUE.
-Save each jrun.xml
Configure Web Server for cluster
-Configure Web Server for cluster by running wsconfig GUI from {JRun4}/bin/wsconfig.exe
-Click Add
-Select JRun Host
-Select JRun Server, choose Cluster 1 name
-Choose Web Server to configure
-Choose Web Site to configure
-Check box for Configure web server for ColdFusion MX applications
-Click OK
-Click Exit
-Stop Servers A and B from JMC
Start servers, test failover and session replication of cluster
-Open a console or terminal window for each server instance
-Change directory to {JRun4}/bin in each console
-From each console, start one of the cluster members, for example: jrun -start CFUSION_1
-Test the cluster through requests to the configured webserver
-Can use session_test for failover and session replication test which writes session and server data to the console of the active server and to the browser for the request
-This example tests for two known issues that are fixed in CFMX 6.1 Updater 1, one for CFLOCK in session replication, and the other for nested structures in session replication
-Unzip test into web server document root
-To run test, open two browsers and request http://{servername:port}/session_test/index.cfm in each one
-Each browser is likely mapped to a different server instance, and when refreshing each test page it sticks to its own console
-Click on "create nested structure", click back on index page, refresh index page several times
-Note how one browser has a specific session id and that it was a New Session on the first hit but not thereafter.
-Test session replication and failover by killing one server instance with a CTRL-C in the console window
-Make a request to the browser that mapped to that server instance
-Note how the browser is now mapped to the other console and New Session is NO
-Click back to view the nested structure, click back to the index page, refresh a few times
-Start the server that was killed
-Make requests again to both browsers
-Note how the browser that had the session failed over is now mapped back to the first console
-When test is satisfied, stop servers from console, remove test application
Follow-up
-Configure Jrun servers to be a Service if desired
-Secure the ColdFusion Administrator if this server to be in production
-Reconfigure ODBC Services for CFMX "server configuration" (a.k.a. standalone) if present and desired.
Related Resources:
Multiple Instances of CFMX
Clustering CFMX on J2EE
Brandon's Blog on Sticky Sessions
Manually Installing CFMX ODBC Services
TechNote on Known Issue with -server JVM Arg
CFMX For JRun Metrics Logging
Configuring Individual JVM Settings for each JRun Server
It's worth mentioning that although the JRun docs say otherwise, Sticky Sessions are enabled, not disabled, by default. The