1

Found that our Apache load balancer didn't failover to the hot spares when the primary server's application was responding with a 500 error.

This is how we had the proxy setup

   <Proxy balancer://hotspare>

        BalancerMember ajp://node1:8463 loadfactor=100 retry=30
        BalancerMember ajp://node2:8463 status=+H retry=0
        BalancerMember ajp://node3:8463 status=+H retry=0

        ProxySet lbmethod=bytraffic
   </Proxy>

It only actually failed over when node1 was shutdown. Can anyone explain this behavour?

2

If you want it to failover in case the backend server returns an HTTP error code (e.g. 500), you have to work with the "failonstatus" option.

Reference can be found here: https://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

failonstatus - A single or comma-separated list of HTTP status codes. If set this will force the worker into error state when the backend returns any status code in the list. Worker recovery behaves the same as other worker errors. Available with Apache HTTP Server 2.2.17 and later.

Otherwise there will only be a failover if the backend doesn't respond at all (like you already mentioned).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.