LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

LVS with heartbeat for failure problems

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: LVS with heartbeat for failure problems
From: "Bill Omer" <bill.omer@xxxxxxxxx>
Date: Fri, 31 Mar 2006 12:35:31 -0800
Hello all, Joe

I've had an injury but I'm back in gear with my lvs project.  I've ran
in to a problem of sorts and would like to know what solutions may be
avaible for me to try.

I have heartbeat running on two servers.  When one dies, heartbeat
will run the /etc/init.d/lvs script I wrote to start up the ipvs
rules.  At the same time, I'm trying to use ipvsadm backup daemon to
sync the connections.  The problem I'm having is, the connections dont
seem to be syncing and when there's a fail over all the established
connections are terminated.

I've included my init script below.  Am I not starting the master and
backup daemons correctly?  I think that's where my problem is because
the ipvs tables are *not* identical between the two servers.  The
tables don't seem to be updating.  Also, does there need to be the
same ipvsadm rules in place before the backup daemon is started or
will it save the state from the master no matter if the tables are
already present or not?


I'd apprecaite any feed back.

Regards,
Bill Omer



Here's my /etc/init.d/lvs script


#! /bin/sh

# lvs 2006 03 30
# starts or stops ipvsadm

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0


case "$1" in

    start)

        ipvsadm -A -t cvg1-lvs-vip:0 -s wlc -p
        ipvsadm -a -t cvg1-lvs-vip:0 -r cvg1-app-101 -g -w 50
        ipvsadm -a -t cvg1-lvs-vip:0 -r cvg1-app-102 -g -w 50
        ipvsadm -a -t cvg1-lvs-vip:0 -r cvg1-app-103 -g -w 50
        ipvsadm -a -t cvg1-lvs-vip:0 -r cvg1-app-104 -g -w 50
        ipvsadm --start-daemon=master --mcast-interface=eth0
        ;;


    stop)
        ipvsadm --stop-daemon
        ipvsadm --start-daemon=backup --mcast-interface=eth0
        ;;
    *)
        echo "Usage: {start or stop}"
        exit 1
        ;;

esac


exit 0

<Prev in Thread] Current Thread [Next in Thread>