Apache Tomcat Connection and Failover-Cluster

本文介绍了一种基于Apache Web服务器和Tomcat Servlet引擎的高可用性集群架构。该架构通过负载均衡技术确保了OpenCMS平台上的Web应用程序的稳定运行。两台位于不同主机上的Tomcat服务器负责处理应用请求,并通过会话复制实现故障切换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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]

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]

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值