In the preceding sections I discussed the theory and purpose of clustering and how that relates to ColdFusion. I also highlighted the differences between the peer-to-peer J2EE clustering employed in ColdFusion and other forms of clustering. This section describes the installation of ColdFusion 8 Enterprise along with the creation and clustering of two instances. This cluster will be a vertical cluster on a single ColdFusion server. In a future article I will discuss "horizontal" clustering where a single cluster can span multiple physical ColdFusion servers.
Having installed ColdFusion many times I have discovered what I believe is the best way to install ColdFusion Enterprise in preparation for clustering. The first instance created, cfusion will serve as a master instance from which the other instances and also the cluster itself is created.
Make sure that you select the second option during the install "Multiserver configuration" (See Figure 5)

Figure 5. Select Multiserver configuration to install ColdFusion 8 on JRun
Next make sure to use the built-in web server for the install process as shown in Figure 6

Figure 6. Select the built-in web server
Once the installation use ColdFusion Administrator to access the cfusion instance. This will be used as the master instance from which you will create the cluster instances and the cluster itself. Note the Enterprise Manager section on the bottom left navigation menu as shown in Figure 7

Figure 7. Adding a new ColdFusion server in ColdFusion Administrator
Once the instance creation is complete, a screen like the one in Figure 8 is displayed

Figure 8. Confirming the creation of a new instance
For instances created by the cfusion instance the Enterprise Manager section is not present in the left navigation menu. This makes the ongoing creation of instances and clusters more logical since being able to create instances-clusters from an instance could become confusing.
Figure 9 shows the Instance Manager section on the "cfusion" master instance after adding the second instance using the same procedure used to the first instance. You could add other instances at this point using the same procedure…

Figure 9. Instance manager showing two added instances.
You can use ColdFusion Archives, or CAR files to rapidly create multiple identical instances. Using ColdFusion Administrator, view one of the instances and from the left navigation select Packaging & Deployment > ColdFusion Archives, then browse to where your .car file is located or type in the path to it as shown in Figure 10.

Figure 10. Deploying a ColdFusion Archive
Follow the on-screen instructions to deploy the CAR file (see Figure 11) and a confirmation will be displayed (see Figure 12)

Figure 11. The deploy wizard for CAR files.

Figure 12. Successful CAR file deployment confirmation.
The next steps are to create a cluster, add the instances you created and choose the algorithm to be used. First create the cluster;- typically it is good to give the cluster members and cluster names that are related (see Figure 13). All names must be unique.

Figure 13. Adding a new cluster.
Next add the servers/instances to the cluster (See Figure 14)

Figure 14. Adding server instances to the new cluster
Figure 14 shows the selection of the Round Robin algorithm with sticky sessions and session replication. It is important to also ensure that Use J2EE Session Variables is selected on all instances to enable session replication functions as shown in Figure 15…

Figure 15. Select Use J2EE session variables
One last important point, after adding the instances it is important to restart them. Once they have restarted check the {instance}out.log for each to ensure they can see the cluster (See Figure 16).

Figure 16. A log file showing peer to peer instances discovered in the cluster
This article examined clustering and high availability (HA) in the context of web applications and in particular ColdFusion 8 Enterprise. Using a real-world you saw how to install ColdFusion 8 Enterprise on Windows, create the instances and then cluster those instances using the Enterprise Manager in the ColdFusion Administrator.