UnixServerAdmin

Server Administration & Management

Tomcat Configuration Cluster

###################################################################
Horizontal Tomcat Clustering ( on Multiple Physical Machine, single Tomcat)

Browser <—> Hardware Server-1(tomcat1), Hardware Server-2(tomcat2), Hardware Server-3(tomcat3)

Grouping multiple physical servers into a cluster.

A horizontal cluster consists of a cluster of servers that are exposed to browser clients as a single virtual server.
Horizontal clusters help to increase application scalability, performance, and robustness

###################################################################
Vertical Tomcat Clustering ( on Single Physical Machine, Multiple Tomcat)

Browser <—> Hardware Server (tomcat1, tomcat2, tomcat3)

A vertical cluster is like a horizontal cluster, except that rather than use several server machines linked together, vertical clusters use a single machine with multiple CPUs. Vertical clusters help to increase scalability on multiprocessor computers since they distribute work to several processes. Each process runs on a different CPU.

Clustering Tomcat Servlet Engines is interesting for two reasons: load balancing and failover.

###################################################################
Redirection requests to the mod_jk load balancer

###################################################################
Tomcat Configuration

The Tomcat instance must listen on the same port as is specified in the corresponding worker’s section in worker.properties.

The Engine jvmRoute property should correspond to the worker name in the worker.properties file or
the load balancer will not be able to handle stickyness.

<Engine name=”Catalina” defaultHost=”localhost” jvmRoute=”tomcat1″>

###################################################################

———————————————————————————-
Topics ————————– Tomcat1 —- Tomcat2 —- Tomcat3 —-
———————————————————————————-
Server Shutdown Port —–   8105 ——– 8205 ———– 8305 ——-
———————————————————————————-
Server Connector Port —– 8081 ——- 8082 ————- 8083 ——-
———————————————————————————-
AJP Connector Port ——– 8109 ——- 8209 ————- 8309 ——-
———————————————————————————-
jvmRoute ——————- tomcat1 —- tomcat2 —– tomcat3 —-
———————————————————————————-

—————————————————————————————————————–
# vim /usr/local/apache-tomcat/conf/server.xml

Line-22 :- <Server port=”8205″ shutdown=”SHUTDOWN”> # Server Shutdown Port, By Default 8005
Line-70 :- <Connector port=”8082″ protocol=”HTTP/1.1″ # Server Connector Port, By Default 8080
Line-91 :- <Connector port=”8209″ protocol=”AJP/1.3″ redirectPort=”8443″ /> # AJP Connector Port, By Default 8009
Line-103 :- <Engine name=”Catalina” defaultHost=”localhost” jvmRoute=”node1″> #
—————————————————————————————————————–

—————————————————————————————————————–
# vim /usr/local/apache-tomcat/conf/web.xml

Line-23 :- <Context distributable=”true” />

To indicate to a Servlet Container that the application can be clustered, a Servlet 2.4 standard <distributable/> element is placed into the applications deployment descriptor (web.xml). If this element is not added, the session maintained by this application across the three Tomcat instances will not be shared. You can also add it to the Context element.
—————————————————————————————————————–

March 13, 2012 Posted by | Cluster, Tomcat | , | Leave a comment