Apache Tomcat Connection and Failover-Cluster
For high availability of web applications based on OpenCMS Platform at Pomegranate Portal we provide a Cluster of two Tomcat Servlet Engines, which are hosted on different machines. The Apache Web server, which resides on a separate machine, has the role to forward the client requests to the tomcat servers with load balancing features. Figure 1 illustrates a single environment without clustering and shows how Apache and Tomcat could be connected together via mod_jk module over the AJP (Apache Java Protocol)Connector. Mod_jk works by configuring Apache to load the mod_jk module. When Apache starts, it creates a series of connections with Tomcat over the JK connector, usually on port 8009. A short HowTo could be found on our forum.
![tomcat_apache.png]](https://i-blog.csdnimg.cn/blog_migrate/78390198f85b3ef0387cd1c342ed2f0b.jpeg)
Figure 1: Connecting Apache to tomcat with mod_jk
This environment can be extended to
a load balanced cluster environment. A cluster is a group of load balanced
Tomcat instances, which have the same session data. The sessions will be
replicated between Tomcat instances via the DeltaManager of
each instance. Clustering works via multicast addressing, whereby all Tomcat
instances broadcast their session information on the same port, but listen on
different ports. The following Figure 2 shows the cluster architecture with 2
load balanced Tomcat instances.
![tomcat_cluster.png]](https://i-blog.csdnimg.cn/blog_migrate/12141528f30622d81949f48c083d1491.jpeg)
Figure 2: Appache - Tomcat Cluster Architecture.
If one instance fails or is stopped, due to maintenance or Soft- or Hardware failure, the other instance will pick up the session and have all data available and Apache will be noticed that one Tomcat instance is out of state and redirects the client requests to the next member in the cluster.
For setting up
such an environment we have several options:
One Apache Web server on its own machine and two tomcat servers on different machines (stable and high performance, high cost)
One Apache Web server on its own machine and two tomcat instances on the same machine.
One Apache Web server and one tomcat server on one machine and the 2. Tomcat server on a separate machine.
本文介绍了一种基于Apache Web服务器和Tomcat Servlet引擎的高可用性集群架构。该架构通过负载均衡技术确保了OpenCMS平台上的Web应用程序的稳定运行。两台位于不同主机上的Tomcat服务器负责处理应用请求,并通过会话复制实现故障切换。

被折叠的 条评论
为什么被折叠?



