sticky session with apache web server and tomcat servers

前端 未结 6 556
我在风中等你
我在风中等你 2021-02-01 21:33

I am using apache web server as a load balancer for two tomcat instances behind apache. When the first request goes to node A and second request from the same client goes to no

6条回答
  •  孤街浪徒
    2021-02-01 22:29

    This worked for me...

    Instead of using stickysession=JSESSIONID in ProxyPass directive it has to be set within balancer configuration using ProxySet stickysession=JSESSIONID:

    
    BalancerMember ajp://server1:8009 route=tomcat1
    BalancerMember ajp://server2:8009 route=tomcat2
    ProxySet lbmethod=bytraffic
    ProxySet stickysession=JSESSIONID
    
    ProxyPass /myapp/ mybalancer://myapp/
    

    It was not working for me when I was using it in ProxyPass as shown below:

    ProxyPass /myapp/ mybalancer://myapp/ stickysession=JSESSIONID
    

    This should be added to apache docs, because it's such a pain to solve.

提交回复
热议问题