Chapter 13. HTTP Clustering and Load Balancing

13.1. Introduction

13.1.1. About High-Availability and Load Balancing Clusters

Clustering refers to using multiple resources, such as servers, as though they were a single entity. The two main types of clustering are Load balancing (LB) and High-availability (HA). In a LB cluster, all resources run at the same time, and a management layer spreads the work load across them.
In HA clustering, one resource runs, and another is available to step in if the first one becomes unavailable. The purpose of HA clustering is to reduce the consequences of hardware, software, or network outages.
The JBoss Enterprise Application Platform supports clustering at several different levels. Some of the subsystems that can be made highly available are:
  • Instances of the Application Server
  • The web server, whether it is the internal JBoss Web server, Apache HTTPD, Microsoft IIS, Oracle iPlanet Web Server, or Apache Tomcat
  • Stateful, stateless, and entity Enterprise JavaBeans (EJBs)
  • JNDI services
  • Single Sign On (SSO) Mechanisms
  • Distributed cache
  • HTTP sessions
  • JMS services and Message-driven beans (MDBs)

13.1.2. Components Which Can Benefit from High Availability

High Availability (HA) falls into a few broad categories in the JBoss Enterprise Application Platform.
The Container

Several instances of the Enterprise Application Server (running as a standalone server) or a server group's members (running as part of a managed domain) can be configured to be highly available. This means that if one instance or member is stopped or disappears from the cluster, its work load is moved to a peer. The work load can be managed in such a way to provide load-balancing functionality as well, so that servers or server groups with more or better resources can take on a larger portion of the work load, or additional capacity can be added during times of high load.

The Web Server

The web server itself can be clustered for HA, using one of several compatible load balancing mechanisms. The most flexible is mod_cluster connector, which is tightly integrated with the JBoss Enterprise Application Platform's container. Other choices include Apache mod_jk or mod_proxy connectors, or the ISAPI and NSAPI connectors.

The Application

Deployed applications can be made highly-available because of the Java Enterprise Edition 6 (Java EE 6) specification. Stateless or stateful session EJBs can be clustered so that if the node which is involved in the work disappears, another node can take over, and in the case of stateful session beans, preserve the state.

13.1.3. Overview of HTTP Connectors

JBoss Enterprise Application Platform has the ability to use load-balancing and high-availability mechanisms built into external HTTPD web servers, such as Apache Web Server, Microsoft IIS, and Oracle iPlanet. The JBoss Enterprise Application Platform communicates with the external web server using a HTTP Connector. These HTTP connectors are configured within the web subsystem of JBoss Enterprise Application Platform.
The HTTPD servers include software modules which control the way that HTTP requests are routed to JBoss Enterprise Application Platform worker nodes. Each of these modules varies in how it works and how it is configured. The modules are configured to balance work loads across multiple JBoss Enterprise Application Platform server nodes, to move work loads to alternate servers in case of a failure event, or both. These two abilities are called Load Balancing and High Availability (HA).
The JBoss Enterprise Application Platform supports several different HTTP connectors. The one you choose depends on the HTTPD you connect to and the other functionality you need.
The table below lists the differences between the different HTTP connectors which are compatible with the JBoss Enterprise Application Platform. For the most up-to-date information about supported configurations for HTTP connectors, refer to https://access.redhat.com/kb/docs/DOC-34454.

Table 13.1. HTTP connector features and constraints

Connector Web server Supported operating systems Supported protocols Adapts to deployment status Supports sticky session
mod_cluster JBoss Enterprise Web Server HTTPD Red Hat Enterprise Linux, Microsoft Windows Server, Solaris HTTP, HTTPS, AJP Yes. Detects deployment and undeployment of applications and dynamically decides whether to direct client requests to a server based on whether the application is deployed on that server. Yes
mod_jk JBoss Enterprise Web Server HTTPD, Apache HTTPD Red Hat Enterprise Linux, Microsoft Windows Server if using JBoss Enterprise Web Server, Solaris AJP No. Directs client requests to the container as long as the container is available, regardless of application status. Yes
mod_proxy JBoss Enterprise Web Server HTTPD, Apache HTTPD Red Hat Enterprise Linux, Microsoft Windows Server if using JBoss Enterprise Web Server, Solaris HTTP, HTTPS No. Directs client requests to the container as long as the container is available, regardless of application status. Yes
ISAPI Microsoft IIS Microsoft Windows Server AJP No. Directs client requests to the container as long as the container is available, regardless of application status. Yes
NSAPI Sun Java System Web Server Oracle Solaris AJP No. Directs client requests to the container as long as the container is available, regardless of application status. Yes

13.1.4. Worker Node

HTTP connector node

A worker node, sometimes referred to as simply a node, is a JBoss Enterprise Application Platform server which accepts requests from one or more client-facing HTTPD servers. The JBoss Enterprise Application Platform can accept requests from its own HTTPD, the HTTPD shipped with JBoss Enterprise Web Server, Apache HTTPD, Microsoft IIS, or Oracle iPlanet Web Server (Formerly Netscape Web Server).

For an overview of HTTP connectors supported by the JBoss Enterprise Application Platform and how to configure them, refer to Section 13.1.3, “Overview of HTTP Connectors”.
Cluster node

A cluster node is a member of a cluster of servers. Such a cluster may be load-balancing, high-availability, or both. In a load-balancing cluster, a central manager distributes work loads amongst its nodes equally, by some situation-specific measurement of equality. In a high-availability cluster, some nodes are actively doing work, and others are waiting to step in if one of the active nodes leaves the cluster.