Keepalived Scripts

Jeff Schroeder <jeffschroeder@computer.org>
http://www.digitalprognosis.com

What the Heck is it?
===

Keepalived is a userspace daemon for clusternode healthcheck and
transparent failover. It is part of the Linux Virtual Server project
but works great standalone. Any stateless service or protocol can
be made highly available using Keepalived.


Design
===

This is one of the more simple uses of keepalived, but it works.
For ease of maintenance, keepalived manages a dummy interface.
Downing the dummy interface will cause a state change from
master or backup to fault. If the physical interface on the
master node goes down, the backup nodes won't hear the multicast
heartbeat. The backup node with the highest priority becomes the
new master until the real master node comes back.

Most of the ideas are from my work at Ticketmaster. The code is all
written by me.

Scripts under /etc/vrrp.d are ran in order by filename so 10-foo
will run before 20-foobar. See the example scripts for some ideas.


Installation
===

Edit your distro specific networking configuration under
 /etc/sysconfig/network-scripts or /etc/network/interfaces to make
dummy0 persistant.

root@omniscience:~# ifconfig dummy0 up
root@omniscience:~# mkdir -p /usr/local/bin /etc/vrrp.d
root@omniscience:~# mv change_status /usr/local/bin
root@omniscience:~# mv fudge-dummy-interface /etc/vrrp.d/10-fudge-dummy-interface
root@omniscience:~# mv status-file /etc/vrrp.d/10-status-file
root@omniscience:~# mv send-email /etc/vrrp.d/20-send-email
... for as many of the scripts as you want to use ...

Usage
===

/usr/local/bin/change_status { master | backup | fault }

Everything can be managed with the change_status script. Putting the
system into maintenance mode is as simple as "ifconfig dummy0 down" or
"change_status fault".

Additional Information
===

See http://www.keepalived.org
