This chapter describes how to configure Apache, Tomcat, and JOnAS to install a cluster.
This configuration uses the Apache/Tomcat plug-in mod_jk to provide load balancing and high availability at the JSP/Servlet level. The mod_jk plug-in enables the use of the Apache HTTP server in front of one or more Tomcat JSP/Servlet engines, and provides the capability of forwarding some of the HTTP requests (typically those concerning dynamic pages—such as JSP and Servlet requests) to Tomcat instances.
The configuration uses the In-Memory-Session-Replication technique based on the group communication protocol JavaGroups to provide failover at the Servlet/JSP level.
For load balancing at the EJB level, a clustered JNDI called CMI is used.
The architecture with all the clustering functionality available in JOnAS is Apache as the front-end HTTP server, JOnAS/Tomcat as J2EE Container, and a shared database.
At the servlet/JSP level, the mod_jk plug-in provides load balancing/high availability, and the tomcat-replication module provides failover.
At the EJB level, the clustered JNDI CMI provides load balancing/high availability.
The database is shared by the JOnAS servers.
The architecture presented in this document is shown in the following illustration:
This architecture provides:
Load Balancing: Requests can be dispatched over a set of servers to distribute the load. This improves the "scalability" by allowing more requests to be processed concurrently.
High Availability (HA): having several servers able to fulfill a request makes it possible to ensure that, if a server dies, the request can be sent to an available server (thus the load-balancing algorithm ensures that the server to which the request will be sent is available). Therefore, "Service Availability" is achieved.
Failover at Servlet/JSP Level: This feature ensures that, if one JSP/Servlet server goes down, another server is able to transparently take over (that is, the request will be switched to another server without service disruption). This means that it will not be necessary to start over, thus achieving continuity.
However, failover at EJB level is not available. This means that no State Replication is provided. The mechanism to provide failover at EJB level is under development and will be available in a coming version of JOnAS.