ロード バランサーには 4 つのサーバーがあり、Tomcat 5.5 が使用されています。以下の点は、Tomcat クラスタリングの設定でカバーされていますが、それでもセッション レプリケーションは正しく行われません。
- セッション属性が実装されました
java.io.Serializable
- 要素のコメントを外し、server.xmlの
Cluster
要素Valve(ReplicationValve)
Web.xml
<distributable/>
要素を持っています<Engine name="Catalina" jvmRoute="node01">
4 つのサーバーすべてで一意の値に設定されます。Loadbalancer
スティッキー セッション モードに設定されています。<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster" managerClassName="org.apache.catalina.cluster.session.DeltaManager" expireSessionsOnShutdown="false" useDirtyFlag="true" notifyListenersOnReplication="true"> <Membership className="org.apache.catalina.cluster.mcast.McastService" mcastAddr="228.0.0.4" mcastPort="45564" mcastFrequency="500" mcastDropTime="3000"/> <Receiver className="org.apache.catalina.cluster.tcp.ReplicationListener" tcpListenAddress="auto" tcpListenPort="4001" tcpSelectorTimeout="100" tcpThreadCount="6"/> <Sender className="org.apache.catalina.cluster.tcp.ReplicationTransmitter" replicationMode="pooled" ackTimeout="15000"/> <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/> <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer" tempDir="/tmp/war-temp/" deployDir="/tmp/war-deploy/" watchDir="/tmp/war-listen/" watchEnabled="false"/> </Cluster>