System information
90
CONFIGURING AND ADMINISTERING COLDFUSION 9
Using Multiple Server Instances
Last updated 2/21/2012
4 Select Packaging & Deployment > J2EE Packaging.
5 Use the J2EE Archives page to create an EAR file that contains the application, its CFM pages, the required data
sources, and other settings.
6 Select Enterprise Manager > Instance Manager.
7 Create server instances for the cluster as described in “Defining additional server instances” on page 83. Use the
Create From EAR/WAR field to specify the archive file that you created.
8 (Optional) Click the Register Remote Instance button to define existing remote server instances so that you can
include them in the cluster. If you use a remote server, ensure that it contains the same application and settings as
the local server instances.
Note: A server can participate in only one cluster. When adding remote instances to a cluster, ensure that the instance
is not already part of a cluster.
9 Ensure that each server instance is started.
Note: To administer a cluster, at least one member server instance must be running.
10 Select Enterprise Manager > Cluster Manager.
11 Name the cluster and click Add.
The ColdFusion Administrator adds the cluster to the Configured Clusters area.
12 Click the cluster name or the edit icon.
The Edit Cluster screen appears.
13 Use the arrow icons to add server instances to the cluster.
14 (Optional) Enable session replication, and specify a cluster algorithm.
Note: When you enable sticky sessions, the connector does not always route requests strictly based on the cluster
algorithm. For more information, see Administrator online Help.
15 Click Submit.
16 Select Enterprise Manager > Instance Manager.
17 Use the CF Admin icon on the Instance Manager to open the ColdFusion Administrator on each server instance.
Ensure that required resources (such as data sources and Verity collections) are defined appropriately. 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: