[lvs-users] Disable a real server

Graeme Fowler graeme at graemef.net
Sun Jan 17 09:40:20 GMT 2010


On Thu, 2010-01-14 at 09:45 -0300, Diego Bello wrote:
> I just subscribed to this list and this is my first question: Is there a way
> to automatically disable a real server?

Many. But the options depend on the reasoning.

> What I need to do is a postgres virtual server, whose realservers' databases
> will be updated once a week. The idea is to disable a real server and
> update, then enable it again. I know I can do it using piranha, but I need
> to do it with a script or something.

"nanny" is a part of the Piranha package. It can manage servers on your
behalf using a number of different tests. Not being that familar with
either nanny or Piranha, I'm not really able to offer any real advice on
how to use it but what I would do is:

1. Make sure nanny is testing the realserver(s) periodically.
2. Use iptables on the realserver to knock out non-established
connections to the service.
3. Wait until all established connections have gone away.
4. Do the update.
5. Remove the iptables rule and allow new connections.

What nanny will do is change the realserver's weight to 0 when you do
(2), so no new connections are sent to it. A more brutal (but quicker)
option is to have nanny remove the realserver from the pool instead.

> Is there any other way?

Many :)

Graeme





More information about the lvs-users mailing list