
123
CONFIGURING AND ADMINISTERING COLDFUSION 10
Using Multiple Server Instances
L
ast
u
p
dated
7/9/2
01
2
Note:
When a cluster uses session replication, session data is copied to other servers in the cluster each time it is modified.
This can degrade performance if you store a significant amount of information in session scope. If you plan to store a
significant amount of information in session scope, consider storing this information in client variables saved in a
database.
Configure a cluster of server instances for load balancing and failover
Manage clusters using the ColdFusion Administrator.
1
In the ColdFusion Administrator, click Enterprise Manager > Cluster Manager.
2
Enter a cluster name and then click Add.
3
Click the cluster name and move the servers to the cluster based on the requirement.
4
(If required) Edit the multicast port.
Multicast port is used to group the cluster members together. Default value of multicast port is 45564. After you
create a cluster, the port is added in the
cfroot
\cfusion\config\cluster.xml
file.
For more information on multicast port, see
http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-
membership.html
.
5
Specify if you need sticky session.
Sticky session ensures that after a session is established on an instance, all future requests from the client are
mapped to that instance.
6
Click Submit.
Adding a remote instance to a cluster
To add a remote instance to a cluster, add the cluster block to the remote instance’s
server.xml
. Then, register the
remote instance and add the instance to the cluster. For more information on configuring clusters on Tomcat, see
http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html
.
If you are using session replication, go to the Memory Variables page and enable J2EE sessions. Enable J2EE sessions
for all server instances in the cluster. If J2EE sessions are not enabled in the ColdFusion Administrator, session
replication does not function properly.CFC serialization lets you use J2EE session replication in a cluster and have
access to the CFCs in session data across all instances in the cluster. Session replication also ensures that that Session
scope variables are replicated across the cluster. However, session replication does not support replication of arrays in
Session scope CFCs or variables.You can also preserve and access data in a CFC in the case of session failover.
ColdFusion structures stored inside the session scope are available in the session scope, even after failover. For
example, if you are running multiple ColdFusion instances to balance server load, you can store useful data, including
CFCs, inside the session so that you can access the data across all the pages that are served in that session.To enable
CFC serialization, set the CFC in the session, as follows:
<cfset cfccomponent = CreateObject("component", "CFIDE.adminapi.datasource")>
<cfset session.datasourcecomponent = cfccomponent>
After failover, you can then access and call methods in the CFC, as follows:
<cfset check = session.datasourcecomponent.verifyDSN("testdsn")>
1
Register the remote instance to the local machine.
2
Create a cluster in the local machine.
3
Open the
cfroot\
instance-name\
runtime\conf\server.xml
file of the remote instance.
4
Add the following block between the entries
</host>
and
</engine>
: