日期:2014-05-17 浏览次数:20912 次
LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties JkMount /*.jsp loadbalancer //注意这个名字和workers.properties文件中的控制器名字一致 JkLogFile logs/mod_jk.log JkLogLevel warn
# list the workers by name worker.list=loadbalancer,worker1,worker2 # localhost server 1 # ———————— worker.worker1.port=8019 worker.worker1.host=localhost worker.worker1.type=ajp13 worker.worker1.lbfactor = 1 # localhost server 2 # ———————— worker.worker2.port=8029 worker.worker2.host=localhost worker.worker2.type=ajp13 worker.worker2.lbfactor = 1 权重, 数字越大,分配的几率越高 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=worker1, worker2 worker.loadbalancer.sticky_session=1
tomcat1 修改下列的配置, 主要是改变端口号 jvmRoute <Server port="8015" shutdown="SHUTDOWN"> <Service name="Tomcat1"> <Connector port="8060" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Connector port="8019" protocol="AJP/1.3" redirectPort="8443" /> <Engine name="Standalone" defaultHost="localhost" jvmRoute="worker1">
tomcat2 修改下列的配置, 主要是改变端口号 jvmRoute <Server port="8025" shutdown="SHUTDOWN"> <Service name="Tomcat2"> <Connector port="8070" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Connector port="8029" protocol="AJP/1.3" redirectPort="8443" /> <Engine name="Standalone" defaultHost="localhost" jvmRoute="worker2">