Dang, forgot the attachment...

On Mon, 23 Jun 2003, Brent A Nelson wrote:

> I don't have anything written up for it, and it hasn't really been tested 
> with active users, but I do believe I have a working OpenAFS server setup 
> with drbd (enbd would work fine, too).
> 
> There were a few tricks involved in setting it up.
> 
> 1) I made sure that only my failover IP was being registered with the
> volume database using the NetInfo file (just put in the failover IP
> address in /usr/afs/local/NetInfo).
> 
> 2) The big trick was forcing my takeover node to use the the failover IP
> address (which is an IP alias) as the source address on outgoing packets
> from that interface.  See the attached heartbeat script (goes in
> /etc/ha.d/resource.d).  The method I used is probably Linux-specific...
> 
> 3) Finally, I had to make sure the machines were using the same ID (I used
> a hexeditor on the /usr/afs/local/sysid file, but maybe someone else has a
> better method).
> 
> Both machines are database servers, with only the active file server 
> running "fs" at any given time.  They both have "fs" defined but not set 
> to run automatically and bos is set to never restart the services 
> (otherwise it would do the wrong thing).
> 
> I think that was it, but I may have missed something.  I might be able to 
> help if you get stuck.
> 
> Thanks,
> 
> Brent Nelson
> Director of Computing
> Dept. of Physics
> University of Florida
> 
> 
#!/bin/sh
#
#       High-Availability Pre-Startup/Shutdown Script
#
# apache (aka IBMhttpd)
#
# Description:  Runs on Startup or shutdown of heartbeat (not resource based).
#
# Author:       Matthew Soffen
#
# Support:      [EMAIL PROTECTED]
#
# License:      GNU Lesser General Public License (LGPL)
#
# Copyright:    (C) 2002 Matthew Soffen
#
# In this example, we have:
# The machine is on subnet 1.2.3.0, with a subnet mask of 255.255.255.0
# The failover address is 1.2.3.2, the gateway for the subnet is 1.2.3.1
# The datadisk script is the heartbeat script from DRBD
unset LC_ALL; export LC_ALL
unset LANGUAGE; export LANGUAGE

prefix=/usr
exec_prefix=/usr
. /etc/ha.d/shellfuncs

case "$1" in
'start')
        /sbin/ip route change 1.2.3.0/24 dev eth0 src 1.2.3.2
        /sbin/ip route change default via 1.2.3.1 src 1.2.3.2
        /sbin/ip route flush cache
        /etc/ha.d/resource.d/datadisk start
        bos startup localhost fs -localauth
        ;;
'stop')
        /sbin/ip route change 1.2.3.0/24 dev eth0
        /sbin/ip route change default via 1.2.3.1
        /sbin/ip route flush cache
        bos shutdown localhost fs -localauth
        /etc/ha.d/resource.d/datadisk stop
        ;;
*)
        echo "Usage: $0 { start | stop }"
        ;;
esac
exit 0

Reply via email to