This section describes how to set up the load balancer plug-in and includes the following sections:
Before configuring your load balancer, you must:
Install a web server.
If using Apache Web Server, you must have it set up properly before installing. For more information, see Using Apache Web Server.
Install the load balancer plug-in.
For information on the installation procedure, see the Sun Java System Application Server Enterprise Edition 8.2 Installation Guide (if using the stand-alone Application Server) or the Sun Java Enterprise System 5 Installation Guide for UNIX (if using Java Enterprise System).
If using Apache Web Server or Microsoft IIS, configure the web server. See Chapter 4, Configuring Web Servers for Load Balancing
Create Application Server clusters or server instances to participate in load balancing.
Deploy applications to these clusters or instances.
You can configure your load balancer in different ways, depending on your goals and environment, as described in the following sections:
The most common way to deploy the load balancer is with a cluster or clusters of server instances. By default all the instances in a cluster have the same configuration and the same applications deployed to them. The load balancer distributes the workload between the server instances and requests fail over from an unhealthy instance to a healthy one. If you’ve configured HTTP session persistence, session information persists when the request is failed over.
If you have multiple clusters, requests are only load balanced and failed over between the instances in a single cluster. Use multiple clusters in a load balancer to easily enable rolling upgrades of applications. For more information, see Upgrading Applications Without Loss of Availability.
You can also configure your load balancer to use stand-alone server instance instead of a cluster. This configuration results in the load balancer plug-in working as a reverse-proxy plug-in (sometimes called a pass-through plug-in). When the web server receives requests for applications enabled in the load balancer, it forwards the requests directly to the Application Server.
Use the same procedures to configure the load balancer for a pass-through plug-in as you use to configure it for a cluster of server instances.
It is also possible to configure your load balancer to use multiple stand-alone instances, and load balance and failover requests between them. However, in this configuration, you must manually ensure that the stand-alone instances have homogenous environments and the same applications deployed to them. Because clusters automatically maintain a homogenous environment, for most situations it is better and easier to use clusters.
Use the asadmin tool to configure load balancing in your environment. For more information on the asadmin commands used in these steps, see Configuring the Load Balancer
Create a load balancer configuration using the asadmin command create-http-lb-config.
Add a reference to a cluster or stand-alone server instance for the load balancer to manage using asadmin create-http-lb-ref.
If you created the load balancer configuration with a target, and that target is the only cluster or stand-alone server instance the load balancer references, skip this step.
Enable the cluster or stand-alone server instance referenced by the load balancer using asadmin enable-http-lb-server.
Enable applications for load balancing using asadmin enable-http-lb-application.
These applications must already be deployed and enabled for use on the clusters or stand-alone instances that the load balancer references. Enabling applications for load balancing is a separate step from enabling them for use.
Create a health checker using asadmin create-health-checker.
The health checker monitors unhealthy server instances so that when they become healthy again, the load balancer can send new requests to them.
Generate the load balancer configuration file using asadmin export-http-lb-config .
This command generates a configuration file to use with the load balancer plug-in shipped with the Sun Java System Application Server.
Copy the load balancer configuration file to your web server config directory where the load balancer plug-in configuration files are stored.