5 Minute Guide to Clustering – Java Web Apps in Tomcat
There are pretty much two ways to set up basic clustering, which use two different Apache modules. The architecture for both, is the same. Apache sits in front of the Tomcat nodes and acts as a load balancer. Traffic is passed between Apache and Tomcat(s) using the binary AJP 1.3 protocol. The two modules are mod_jk and mod_proxy . mod_jk stands for “ jakarta ” the original project under which Tomcat was developed. It is the older way of setting this up, but still has some advantages. mod_proxy is a newer and more generic way of setting this up. The rest of this guide will focus on mod_proxy , since it ships “out of the box” with newer versions of Apache. You should be able to follow this guide by downloading Apache and Tomcat default distributions and following the steps. Clustering Background You can cluster at the request or session level. Request level means that each request may go to a different node – this is the ideal since the traffic would be balanced across...