Tomcat Cluster
From Documentation
Setup Tomcat Cluster environment
- Refer to Tomcat Document to set up cluster environment.
- For configuring with Apache http server, refer to
Using more than 3 nodes with ZK
- Using DeltaManager instead of BackupManager, refer to cluster-manager for more information.
Additional setting in ZK project
You have to configure the following settings to make ZK project work in tomcat cluster environment.
web.xml
- Add the distributable element in WEB-INF/web.xml.
<?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<distributable/>
</web-app>
zk.xml
- Turn on Serializable UI Factory for ZK, please refer to this documentation.
- If Tomcat cluster nodes is large than 3, also need to add cluster session patch.
For example,
<zk>
<system-config>
<ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class>
</system-config>
<!-- clustering environment, since ZK 5.0.8-->
<listener>
<listener-class>org.zkoss.zkplus.cluster.ClusterSessionPatch</listener-class>
</listener>
</zk>
Version History