configurationApache服务器lbmethod以实现与tomcat的负载平衡时出现问题

我使用Apache Server作为Tomcat6服务器的前端负载均衡器。 我正在使用lbmethodconfiguration,使从一个客户端的所有请求总是去相同的tomcat

<VirtualHost *:1000> ServerAdmin [email protected] #DocumentRoot /www/docs/dummy-host.example.com ServerName dummy-host.example.com ErrorLog logs/dummy-host.example.com-error_log CustomLog logs/dummy-host.example.com-access_log common ProxyPass /balancer-manager ! ProxyPass / balancer://mycluster/ lbmethod=byrequests nofailover=On ProxyPassReverse / balancer://mycluster/ <Proxy balancer://mycluster>; BalancerMember ajp://localhost:8101/ route=NodeA1000 retry=10 BalancerMember ajp://localhost:8102/ route=NodeB1000 retry=10 BalancerMember ajp://localhost:8103/ route=NodeC1000 retry=10 BalancerMember ajp://localhost:8104/ route=NodeD1000 retry=10 BalancerMember ajp://localhost:8105/ route=NodeE1000 retry=10 </Proxy> 

我在后端有5个tomcats。 但是不是来自同一个客户端的所有请求都转到相同的tomcat,这些请求是负载平衡的。 我在这里错过了什么?

我同意这属于serverfault.com但是,这可能会有所帮助。

你所得到的确是标准的行为。 但是,你可能正在努力与会议。 在这里阅读会话集群: http : //tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

这确保会话在您的Tomcat实例之间共享。

一定要将distributable="true"添加到您正在部署的应用程序中的context.xml文件中,如下所示:

 <Context path="/" debug="5" reloadable="true" crossContext="true" distributable="true">