This document discusses clustering and multiple instances in ColdFusion. It begins with definitions of clustering, load balancing, and failover. It then covers creating local and remote instances in ColdFusion, how to create a cluster, and how to bind a cluster to a website. Key points covered include the benefits of clustering, sticky sessions vs. session replication, and adding a remote instance to an existing cluster.
2. About Me:
Certifications:
● MCP 70-480 : Programming in HTML5 with Javascript and CSS3
● Adobe 9A0-127 : Adobe Certified Expert – ColdFusion 9
Skills: ColdFusion 8,9 and 10, Java, Spring MVC, jQuery, Ajax, SQL Server
Connect Me:
Facebook : https://www.facebook.com/nareshe
LinkedIn : in.linkedin.com/pub/nareshe
Contact Me:
Email : nareshe@mindfiresolutions.com / naresh.tulip@gmail.com
Skype : mfsi_nareshe
Presenter: Naresh E, Mindfire Solutions
3. Agenda
1. Clustering?
2.What is Failover?
3. What is Load Balancing?
4. Sticky Sessions and Session Replication.
5. Creating Local/Remote Instances in ColdFusion.
6. Clustering in ColdFusion.
7. Binding a cluster to a site.
Presenter: Naresh E, Mindfire Solutions
4. Clustering
What?
● Clustering means combining two or more resources so that they appear as a
single resource.
● Resources could be a web-server, database, hardware component etc..
● Connected through fast LANs.
Why?
● To support FailOver and Load Balancing i.e. redundancy and scalability.
5. FailOver (HA) Clusters
1. Redundancy
If Something fails, whole application DOES NOT fail.
2. High Availability
Level of Redundancy
3. ColdFusion clustering supports FailOver at the
Instance Level.
6. Load Balancing Clusters
● To handle more users.
● Load is distributed.
● Algorithms
Ex: Round Robin
Random weighted
● Round Robin and Round Robin
with Sticky Sessions
7. Clustering and ColdFusion
● Encapsulation and Failover at Instance Level
● Two iterations of software clustering:
○ ClusterCATS
○ J2EE Clustering
● ClusterCATS
○ Centralized Management - Failover at
web server level
● J2EE Clustering
○ Peer-to-Peer at the ColdFusion
server-instance level
● “admin” instance in JRun.
9. Sticky Sessions and Session Replication
Sticky Sessions:
● Same session and same instance for each request.
● To be used when the session data is less.
Session Replication:
● Same session but different instances.
● To be used when session data is large.
● Change in server.xml required.
11. Benefits:
1. High processing capacity
2. Failover protection
3. High availability and High reliability
4. Resource Consolidation & Optimal use of resources
5. Best of all for some, instances reduce license cost.
Sample Scenarios:
● Cost Effective- 1 CF Server, n instances
● HA - n CF Servers, 1 IIS
● Best - n CF Servers + n IIS
We will still require the use of a software or hardware clustering device to
enable failover at the web server level.
12.
13. Creating seminardemo.com site:
1. Create Application.cfc file with the following code:
component{
this.application = "demoApplication";
this.sessionmanagement = true;
}
2. Create index.cfm with the following code:
<cfdump var = "#server#">
3. Create a site in IIS, pointing to this code, with the default document as “index.cfm”.
Here, I created a site with the name “seminardemo.com”
25. ● Web-server requires a restart after mapping the cluster. Restart the webserver and
trigger the URL of the page, with server dump, from two different browsers and
check for the “rootdir” value.
● You will find that one request is handled by one instance and the other, by the
second instance inspite of refreshing the page, when sticky sessions is enabled.
● If you uncheck the Sticky Sessions, while creating a cluster and then when you
trigger the request from a browser and refresh it, we see that each time the instance
is changed. (Session Replication)
26. Creating Remote Instance
1. Register the remote instance to the local machine.
2. Create a cluster in the local machine.
3. Open the cfrootinstance-nameruntimeconfserver.xml file of the remote instance.
4. Add the xml, in the next slide, just above the </host>.
5. In the xml added, update the membership port with the multicast port of the cluster.
6. Restart all the instances.