webDU_09_coldfusion_ha

Comments

There aren't any comments for this presentation.

Add Comment

Please enter a valid email address.

Optional. Enter a URL for your website.

  Remember Me
  Notify me of follow up comments

Transcript

no image

Slide Text

Slide Notes


Building ColdFusion Applications for Scalability and High Availability


webDU Sydney, Australia - 2009
webDU Sydney, Australia - 2009
Mike Brunt – CFWhisperer

no notes exist for this slide

ColdFusion HA


Who am I, what am I and why am I here?
Who am I, what am I and why am I here?
I have been using CF since 1996, version 1.54 (dbml) and am still actively developing in CF.
I worked for Allaire-Macromedia as a ColdFusion-Spectra consultant.
Co-founded Webapper (SeeFusion crowd) carried on the Allaire-Macromedia consulting work.
Here to discuss how to design and build ColdFusion applications with High Availability in mind from day 1.

no notes exist for this slide

Slide 3

no text exists for this slide

no notes exist for this slide

Slide 4


The previous slide illustrates a typical redundant infrastructure as it could be created in a single location, such as in a data center. In this case most devices are operating in an “active-active” mode.
The previous slide illustrates a typical redundant infrastructure as it could be created in a single location, such as in a data center. In this case most devices are operating in an “active-active” mode.
Active-active means that devices are handling traffic and participating in the request-response cycle of a web application. The exception is the firewalls and clustering devices which are in active-passive mode. In this case only one of each device is actively participating in the request-response cycle of a web application. The other is ready to take over should the active device fail.
The clustered ColdFusion devices are actually clustered at the instance level using Java-J2EE clustering. It is good to note that as we are typically using external web servers, such as Apache, IIS, SunOne etc ColdFusion clustering is not operating at the web server level.
In the next section we will look at hardware considerations in HA…

no notes exist for this slide

Slide 5


The Network/Fiber Optic Layer
The Network/Fiber Optic Layer
Before we leave the overview of network hardware there is one item upon which everything which needs to communicate depends – the NIC - “the faucet or tap”…
It is almost certain that there will be more than one NIC in a typical server, so make sure you use all of them for something. For example, use one NIC for all incoming-outgoing requests to the web-tier and another for communicating with a dependency, such as a database. Also bear in mind that any connection point, such as a NIC, is a potential bottleneck.
In addition, take care with settings on the NIC’s always fix them do not leave them on “auto-sense”. If your switch runs at Gigabit Full Duplex then set the NIC’s on all servers to that setting.

no notes exist for this slide

Slide 6

no text exists for this slide

no notes exist for this slide

Slide 7

no text exists for this slide

no notes exist for this slide

Slide 8



This diagram shows a very cost-effective way to create a high availability infrastructure at the data tier with SQL Server. We evolved this as an offering which we have deployed at several clients and it is very cost-effective as only one fully paid SQL Server license is necessary. This is mirroring with transactional log replication.
Only one database server is active at any time, the “witness” server monitors the mirror and should the active server fail, it immediately switches the two servers roles, making the passive server active.
One important advantage of this set-up is the switch-over in case of a failure is very quick, taking 15-20 seconds as opposed to 2-3 minutes with clustering. Full clustering would also require licenses for all cluster members.

no notes exist for this slide

Slide 9

no text exists for this slide

no notes exist for this slide

Slide 10


Software considerations…
Software considerations…
The Web Site Code: As we add cluster members we need to consider that each member will need access to the CF code (and possibly other media). We have two main alternatives in this to consider…
We can maintain multiple copies of the code, one on each cluster member’s physical server. This means we will have to set up a replication mechanism to ensure that the code on all cluster members is identical at all times. Con, there is a danger that code may be different within each cluster member. The replication mechanism is the key here.
Alternatively, we can maintain a central copy of the code on file servers, on network attached storage (NAS) or a storage area network (SAN). Con, we are adding another network-connection hop and still require the added level of storage to be redundant.


The next slide is a graphical representation of the alternatives shown above…

no notes exist for this slide

Slide 11

no text exists for this slide

no notes exist for this slide

Slide 12


Coding for Clusters - Shared Scope Variables 1
Coding for Clusters - Shared Scope Variables 1
Shared scope variables reside in memory and as such are in the memory space of a single ColdFusion instance-server. The three current scopes in CF are.
Application Scope: available to all users in a single ColdFusion application created by using the <cfapplication tag.
Server Scope: available to all applications and all users on a single ColdFusion instance-server.
Session Scope: applicable to a single user in a ColdFusion application.
   If a user is moved from one instance to another in mid session their session variables will not be there. The application variables should be there providing the application is initialized with all those instantiations being in one place, preferably in the Application.cfm or .cfc. It is very important that the code used by all instances is identical.

no notes exist for this slide

Slide 13


Coding for Clusters - Shared Scope Variables 2
Coding for Clusters - Shared Scope Variables 2
Alternative Scopes
Application Scope: The Request Scope can be interchanged with the Application Scope in many cases. As the Request Scope is not memory resident it does not cause problems if users are moved around a cluster.

Session Scope: In the Java world session state can be maintained in different areas, memory being one, a database being another. In ColdFusion the Client Scope is equivalent to maintaining session state in the database. The downside is that complex variables cannot natively be stored in a database.
   It is very important that the code used by all instances is identical.

no notes exist for this slide

Slide 14

no text exists for this slide

no notes exist for this slide

Slide 15

no text exists for this slide

no notes exist for this slide

Slide 16


ColdFusion Enterprise – J2EE Clustering
ColdFusion Enterprise – J2EE Clustering
ColdFusion clustering is based on JRun which in turn is based on J2EE clustering. This is software based clustering and it is peer-to-peer with no cluster controller as such. If we set up clusters using the JRun Management Console, (JMC), there is the definite concept of a cluster creator as the JMC itself does not become part of any cluster. In the ColdFusion Administrator this is less well defined and can cause confusion.
The following slides show a methodology we evolved to install ColdFusion and set up a basic cluster…

no notes exist for this slide

Slide 17


Installing ColdFusion Enterprise & Clustering - 1
Installing ColdFusion Enterprise & Clustering - 1
During the install select “Multiserver Configuration”, this will install ColdFusion and JRun…

no notes exist for this slide

Slide 18


Installing ColdFusion Enterprise & Clustering - 2
Installing ColdFusion Enterprise & Clustering - 2
As the install continues make sure you select the built-in web server. This is the Java Web Server (JWS)…

no notes exist for this slide

Slide 19


Installing ColdFusion Enterprise & Clustering - 3
Installing ColdFusion Enterprise & Clustering - 3
After the installation completes we will have the first instance of ColdFusion up and running. This instance by default is named “cfusion” and we will not use this to run any applications, we will use it to simply create instances and peer to peer clusters. This will be the only instance which contains the “Enterprise Manager” which is the area of the ColdFusion used to create instances and clusters. The graphic here shows an instance successfully created…

no notes exist for this slide

Slide 20


Installing ColdFusion Enterprise & Clustering - 4
Installing ColdFusion Enterprise & Clustering - 4
We then move on to create a second instance using the Enterprise Manager and at this point we have two instances up and running. In addition we should remove the “samples” instance.

no notes exist for this slide

Slide 21


Installing ColdFusion Enterprise & Clustering - 5
Installing ColdFusion Enterprise & Clustering - 5
Now that we have two instances created we once again use Enterprise Manager to create a cluster and add the two instances.

no notes exist for this slide

Slide 22


Installing ColdFusion Enterprise & Clustering - 6
Installing ColdFusion Enterprise & Clustering - 6
At this point we have achieved the following:
Installed ColdFusion Enterprise in a Multiserver installation.
Used the first instance “cfusion” on the built-in web server (JWS) to create two ColdFusion instances via Enterprise Manager.
Created a cluster and added two instances to that cluster.
Now is the time when we use the web server configuration tool to connect this cluster to the external (production) web server.

no notes exist for this slide

Slide 23


Installing ColdFusion Enterprise & Clustering - 7
Installing ColdFusion Enterprise & Clustering - 7
We use the web server configuration tool (wsconfig) to connect the cluster we created to the external (production) web server.

no notes exist for this slide

Slide 24

no text exists for this slide

no notes exist for this slide

Slide 25

no text exists for this slide

no notes exist for this slide

Slide 26

no text exists for this slide

no notes exist for this slide