Disable stickiness on apache mod_proxy_balancer

I want to configure Apache Web Server to fulfill the following requirement:

  • Access to server1 during operation.
  • Access to server2 only when server1 is not responding. When server1 answers, start server 1 again.

To do this, I tried setting up Apache Web Server (2.2) using mod_proxy_balancer. My problem is that session stickiness seems to be enabled by default. When server1 does not respond, the balancer is redirected to server2, but when server1 is restored, the balancer does not access server1 until I clear the sessions in my browser.

My balancing configuration:

ProxyPass /test balancer://mycluster <Proxy balancer://mycluster> BalancerMember server1-url retry=10 loadfactor=100 BalancerMember server2-url status=+H retry=10 </Proxy> 

Is it possible to disable stickiness?

Thanks in advance.

+4
source share
1 answer

You can do this with Mod_JK with the following properties. Reference configuration can be found in Apache httpd 2.2.x + mod_jk 1.2.30 + tomcat 6 Error: could not find an employee with the name "XXXXX" in uri mail processing

 # Disable Sticky Session worker.loadbalancer.sticky_session=0 # Define preferred failover node for worker1 worker.worker1.redirect=worker2 # Disable worker2 for all requests except failover worker.worker2.activation=disabled 
+1
source

Source: https://habr.com/ru/post/1342963/


All Articles