Streamline Problem
Horms
horms at verge.net.au
Tue Oct 10 11:39:23 EST 2006
On Mon, Oct 09, 2006 at 07:30:12AM +0800, Geruel M. Casibu wrote:
> Hi to All
> I am trying to set up UM3 using the "Streamline High Availibility and Load Balancing" like in example (http://www.ultramonkey.org/3/topologies/sl-ha-lb-eg.html).
>
> My OS is CentOS 4.4.
>
> I've been trying to sort this for three days now and I cant figure out whats wrong? I've attached also my configurations.
>
> My two machines (cross-a.sysad.com, cross-b.sysad.com) are both Directors / Real Servers (My test servers before implementing it to production use). The service I want to Load Balance is HTTP. eth0 on both machines are the net where the VIP will be used. eth0 is used for Heartbeat.
>
> Node1/Ldirector1: cross-a.sysad.com/172.16.10.66
> Node2/Ldirector2: cross-b.sysad.com/172.16.10.8
> VIP/ifcfg:0: cross.sysad.com/172.16.10.67
> GW: 172.16.10.1
>
> Any suggestions on what might I be doing wrong?
I think you might have a buggy version of /etc/ha.d/resource.d/LVSSyncDaemonSwap
Could you try the attached version.
--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/
-------------- next part --------------
#!/bin/sh
#
# $Id: LVSSyncDaemonSwap,v 1.0 2005/02/04 20:04:00 horms Exp $
#
# Copyright (C) 2005 Horms <horms at verge.net.au>
#
# This script manages the LVS synchronisation daemon
#
# Please note that as of 2.4.28 or so, this is no longer needed
# as both the master and backup daemon can run simultaneously
#
# usage: $0 {master|slave} {start|stop|status|monitor}
#
# The first argument, master or backup, is the YING.
# The YANG is internally calculated to be which ever or master and
# backup YING is not.
#
# e.g $0 LVSSyncDaemonSwap master start # YING=master YANG=backup
# $0 LVSSyncDaemonSwap backup start # YING=backup YANG=master
#
#
# "start" will stop the YANG if it is running and starts the YING
# "stop" will stop the YING if it is running and starts the YANG
# "clobber" is a non-standard target stop the YING if it is running
# an stop the YANG if it is running
# "bootstrap" is a non-standard target that acts the same way as stop,
# except that it exits with status 100, so it
# can be run just once as a respawn target from heartbeat
# Might be better to add a spawn directive to heartbeat
#
#
#
unset LANG
LC_ALL=C
export LC_ALL
prefix=/usr
exec_prefix=/usr
. /etc/ha.d/shellfuncs
USAGE="usage: $0 {master|slave} {start|stop|status|monitor}\n\nNote: $0 only works on Linux";
status() {
if ps ax | grep " \[ipvs sync$1\]$" > /dev/null; then
echo "running"
return 3
fi
echo "stopped"
return 0
}
run_ipvsadm () {
ipvsadm $@
rc=$?
if [ $rc -ne 0 ]; then
echo "ERROR: ipvsadm $@ failed."
return $rc
fi
return 0
}
ying_yan() {
if [ "$1" = "master" ]; then
echo "backup"
else
echo "master"
fi
}
start_stop() {
YING=$1
YANG=$2
if [ $(status $YING) = "running" ]; then
return 0
fi
if [ $(status $YANG) = "running" ]; then
run_ipvsadm --stop-daemon || return $?
ha_log "info: ipvs sync$YANG down"
fi
run_ipvsadm --start-daemon $YING || return $?
ha_log "info: ipvs sync$YING up"
return 0
}
start() {
start_stop $1 $(ying_yan $1) || return $?
ha_log "info: ipvs sync$YING obtained"
return 0
}
stop() {
start_stop $(ying_yan $1) $1 || return $?
ha_log "info: ipvs sync$YANG released"
return 0
}
clobber() {
if [ $(status master) = "running" ]; then
YING=master
elif [ $(status backup) = "running" ]; then
YING=backup
else
return 0
fi
run_ipvsadm --stop-daemon || return $?
ha_log "info: ipvs sync$YING down"
return 0
}
monitor() {
status $1
return $?
}
usage() {
echo -e $USAGE >&2
}
if
[ $# -ne 2 ]
then
usage
exit 1
fi
case $2 in
start)
start $1
;;
stop)
stop $1
;;
status)
status $1
;;
monitor)
monitor $1
;;
bootstrap)
stop $1
exit 100
;;
clobber)
clobber $1
;;
*)
usage
exit 1
;;
esac
exit $?
More information about the Ultramonkey-users
mailing list