3

I did a load balanced with apache and the mod_proxy. Everything work well and I can load balance between two servers. Now I would like to do more. First I would like to do failover (if a server down, all the charge go to the other one)> Does it work only with this: nofailover=On ? Then I would like to have a second load balancer as a backup if the first one down. I search on internet but I didn't find. Do you know if it's possible to do it? To finish, Does it possible to change the configuration (like the ip of the server) in the load balancer without restart it because it's running?

Thanks for your answer

1 Answer 1

4

To set a BalancerMember as a hot spare, so that it will only get requests if no other upstream is available, use status=+H:

<Proxy balancer://failovercluster> BalancerMember http://10.1.1.4 BalancerMember http://10.1.1.5 status=+H </Proxy> 

(one caveat is that some older versions of apache had a bug where +H didn't work)


One common method to set up a second load balancer would be to just set up a second system with identical configuration, and use DNS round robin to let users hit whichever one they happen to hit. Of course, this can incur delays for clients if one of the load balancers goes down; not a good thing.

Another option is to use VRRPd. I won't go into the implementation specifics here, but it would have your two load balancers sharing a single virtual IP address, which would move to the other device if one of them becomes unreachable.


Using "reload" (/etc/init.d/apache2 reload) will do a graceful restart of the apache service; this avoids dropping connections.

4
  • Thanks, Does heartbeat is a good idea and useful if Iwant to have 2 loadbalancers? Commented Mar 4, 2011 at 5:56
  • @tranen Sure - heartbeat would be another option for managing the "shared" IP address. Commented Mar 4, 2011 at 6:11
  • I don't really understand what the status+=H is for, Can you explain me? I didn't find on internet thanks Commented Mar 4, 2011 at 7:48
  • 1
    @tranen status=+H sets a node as a "hot spare", so it will get no requests until all other nodes in the balancer group are considered failed. See here. Commented Mar 4, 2011 at 15:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.