这是我目前的环境设置。
Apache Tomcat:Apache-Tomacat-7.0.21
Apache HTTP Server:c。 Apache HTTP Server 2.2.19
用于Apache HTTP Server 2的Tomcat Connector JK 1.2.32,mod_jk
我正在尝试实施粘性会话,但我仍然无法让它工作。我能够在群集中的两台机器之间进行负载平衡。请告知我还错过了什么!
以下是我的workers.properties文件
# Define 2 real workers using ajp13 & 1 balancer
worker.list=balancer
#
worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
worker.balancer.sticky_session=True
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.recycle_timeout=300
# Set properties for worker2 (ajp13)
worker.worker2.type=ajp13
worker.worker2.host=X.X.X.X
worker.worker2.port=8009
worker.worker2.lbfactor=50
worker.worker2.cachesize=10
worker.worker2.cache_timeout=600
worker.worker2.socket_keepalive=1
worker.worker2.recycle_timeout=300
我还将server.xml中的jvmRoute设置为:
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">