apache服务器和tomcat服务器集群 workers.properties 之fail_on_status

workers.properties 文件内容:
worker.list=workers,lymTomcat,supportTomcat

worker.lymTomcat.type=ajp13
worker.lymTomcat.host=192.168.1.129
worker.lymTomcat.port=8007
worker.lymTomcat.lbfactor=100
worker.lymTomcat.fail_on_status=-500,-503,404

worker.supportTomcat.type=ajp13
worker.supportTomcat.host=192.168.1.129
worker.supportTomcat.port=8009
worker.supportTomcat.lbfactor=100
worker.supportTomcat.fail_on_status=500,503,-404

worker.workers.type = lb
worker.workers.balance_workers=lymTomcat,supportTomcat
worker.workers.sticky_session = true
worker.workers.sticky_session_force = false


这句话是很关键的“worker.supportTomcat.fail_on_status=500,503,404”,通过这句话控制了lymTomcat出现500、503或404错误时让客户访问另外一个tomcat服务器上的同一个项目。
注意在负载平衡下面的员工的worker.xxx.fail_on_status的值不能相同,如果lymTomcat的值为500,503,-404 则supportTomcat的值必须和他相反,如上面配置。

你可能感兴趣的:(apache,tomcat)