On Wed, 31 Mar 2004, David Nolan wrote:

> Start by writing a stand alone script that can perform the change you need. 
> I suggest using perl and Net::DNS::Update to send DDNS updates to your 
> master.

the problem with the dns update method is that caches all around won't
expire the "dead" address for too long of a time.

this is a better-behaved method if you have a small number of web
servers all serving the same content on the same subnet:

    1. each server has two ip addresses, one which is published in dns
       as an A record for "www.whatever.com", and the other is an
       "administrative" address. the published address is assigned to
       an alias interface, say eth0:1. the non-published address is
       not an alias.

    2. when the web server boots, it ifup's the non-published address,
       but before configuring the published address on the alias
       interface it sends out a gratuitous arp for that address,
       and only configures it if it doesn't get a response (i.e.
       someone else isn't already using it). you can use "arping"
       to accomplish this:

           http://www.gnu.org/directory/All_Packages_in_Directory/arping.html

        if ! arping -q -D -c 5 -I eth0 ipaddr
        then
            # uh oh, some else is using that address on the subnet
        fi

    3. things run as normal, and mon checks http on the published
       web server addresses for failure. when a failure happens, a
       special alert script sshs over to one of the still-running web
       server's non-published addresses and ifup's the failed server's
       public address on another alias interface, say eth0:3.

this method is by no means the most robust, but it's reasonable if you
don't have the hardware to implement the proxy/load-balancer method.

i have the code which does all this, but it's not quite in a
nicely-packaged form. if someone is really interested i can probably
bundle it up.

_______________________________________________
mon mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to