zhaolu 发表于 2017-1-4 08:42:24

Apache Tomcat Connection and Failover-Cluster

Apache Tomcat Connection andFailover-Cluster

  Forhigh availability of web applications based on OpenCMS Platform atPomegranate Portal we provide a Cluster of two Tomcat Servlet Engines,which are hosted on different machines. The Apache Web server, whichresides on a separate machine, has the role to forward the clientrequests to the tomcat servers with load balancing features. Figure 1illustrates a single environment without clustering and shows howApache and Tomcat could be connected together via mod_jk module overthe AJP (Apache Java Protocol)Connector. Mod_jk works by configuringApache to load the mod_jk module. When Apache starts, it creates aseries of connections with Tomcat over the JK connector, usually onport 8009. A short HowTo could be found on our forum.




Figure 1: Connecting Apache totomcat with mod_jk
  This environment can be extended toa load balanced cluster environment. A cluster is a group of load balancedTomcat instances, which have the same session data. The sessions will bereplicated between Tomcat instances via the DeltaManager ofeach instance. Clustering works via multicast addressing, whereby all Tomcatinstances broadcast their session information on the same port, but listen ondifferent ports. The following Figure 2 shows the cluster architecture with 2load balanced Tomcat instances.




  Figure 2: Appache - Tomcat Cluster Architecture.

  If one instancefails or is stopped, due to maintenance or Soft- or Hardware failure, the otherinstance will pick up the session and have all data available and Apache willbe noticed that one Tomcat instance is out of state and redirects the clientrequests to the next member in the cluster.

  For setting upsuch an environment we have several options:



[*]One Apache Webserver on its own machine and two tomcat servers on different machines (stableand high performance, high cost)
[*]One Apache Webserver on its own machine and two tomcat instances on the same machine.
[*]One Apache Webserver and one tomcat server on one machine and the 2. Tomcat server on a separatemachine.
页: [1]
查看完整版本: Apache Tomcat Connection and Failover-Cluster