To deploy your Web application in a cluster, you must have a mechanism to support load balancing (and optionally failover), configure a mechanism to replicate HTTP session data between servers in the cluster, and make sure your code supports distributed deployment.
Since the HTTP protocol does not support failover and load-balancing, you must configure a system to redirect client requests that use one logical host name to the cluster servers. You can do this using one of the following solutions:
Use the EAServer Web server redirector plug-in, running in Apache or another supported Web server. For information on this option, see the EAServer Installation Guide for your platform. This option allows load-balancing, but not high availability. The Web server can be a single point of failure in your configuration.
Use Round Robin DNS (RRDNS). RRDNS is a standard feature in many operating systems, and no extra hardware is required. RRDNS allows HTTP requests to be routed in a round-robin fashion to different Web servers. For information on the advantages and disadvantages of RRDNS, see the O’Reilly article Web Applications Load Balancing. RRDNS provides load balancing, but not high availability. The RRDNS service can be a single point of failure.
Use another third-party address-redirection system that performs HTTP load-balancing and failover, such as:
The BIG-IP hardware load redirector, from F5 Networks
The Local Director hardware load redirector, from Cisco Systems
If you have a cluster of Windows 2000 Advanced servers, you can use built in features for network load balancing across a cluster. Similar functionality is available for NT. For more information, see the Microsoft MSDN article Building a Highly Available and Scalable Web Farm.
If a Web application is distributed and running in a cluster, EAServer replicates session data to all servers in the cluster, using one of the following mechanisms:
Persistent storage: EAServer stores session data in a persistent data store to support shared sessions and session failover.
In-memory replication: EAServer replicates session data between pairs of servers, each of which acts as a backup for the other. This feature can improve performance by avoiding the overhead of writing to the database.
You must configure one of these options, as described below.
No changes are required to your servlet and JSP implementation code to support distributed sessions, as long as:
You are managing session data using the servlet session APIs or some other mechanism where storage is not tied to the host server (such as an EJB session or entity bean).
You use a database (or an EJB entity bean that connects to a database) to store global data. You can use the Web application’s environment properties to store global read-only data.
Since session data is bound to a single user, you cannot use sessions to store global read-write data. Many applications use ServletContext properties to store global data, but the ServletContext is not global to a distributed application and cannot be used as a read-write shared-memory store.
Copyright © 2005. Sybase Inc. All rights reserved. |