Re: about clustering
| Newsgroups | gmane.linux.redhat.piranha |
|---|---|
| Message-ID | <[email protected]> |
hi Sébastien Bonnet,
Many thanks.
In your last email, you attach the piranha-0.7.0.patch in
email. I save it in a file name piranha-0.7.0.patch. Can you check it for
me that the patch file is correct?
thanks again.
zhou
Sébastien Bonnet <[email protected]>@redhat.com on 12/19/2002
05:18:20 PM
Please respond to [email protected]
Sent by: [email protected]
To: [email protected]
cc:
Subject: Re: about clustering
> Can you tell me or email me again about how to use your patch?
gunzip -c piranha-0.7.0.tgz | tar x
cd piranha
patch -p1 <location-of-patch>/piranha-0.7.0.patch
make
make install
The makefile might create 2 services pulse1 and pulse2 instead of just
pulse. You can "correct" that issue this way:
cd /etc/init.d
mv pulse1 pulse
rm pulse2
Then create a first script that will be called when the director becomes
active (master). In my case, where I use Direct Routing, if removes the
VIPs from lo. The second script is called when the director is started
or becomes inactive (backup). It sets the VIPs on lo and hide them.
If you're using NAT, you'll have still handle the VIPs on lo and the
default gateway instead of the ARP issues. That is :
on the active director, set the DGW to the one of the network
on the inactive director (backup), set the DGW to what you've specified
as nat_router in lvs.cf
I created both scripts in /etc/sysconfig/ha and you'll each a copy of
each attached.
OK, now you have two nice scripts, just make sure they as used. And the
following two lines in the main section of lvs.cf:
active_cmd = /etc/sysconfig/ha/cluster-active.sh
inactive_cmd = /etc/sysconfig/ha/cluster-inactive.sh
Finally, in the list of RS for your VS, list both directors with their
usual, NATed, address.
Regards,
--
Sébastien Bonnet
Centre de contacts - Experian France
(See attached file: cluster-active.sh)
(See attached file: cluster-inactive.sh)
cluster-active.sh
(application/octet-stream, 461 B)
#! /bin/sh
exec 1>/tmp/toto.1 2>/tmp/toto.2
set -x
OLDIFS=$IFS
PATH=/sbin:/usr/sbin:$PATH
insmod noarp >/dev/null 2>&1
grep -E 'address.*:' /etc/sysconfig/ha/pulse1.cf | \
awk '{ print $3 " " $4; }' | \
sort -u | \
while read line
do
set $line
ip=$1
if=$2
IFS=":"
set $if
IFS=$OLDIFS
if=$2
ifconfig lo:$if down
noarpctl del $ip
done
( ifconfig ; cat /proc/net/noarp ) | mail -s "$HOSTNAME becoming active" [email protected]
cluster-inactive.sh
(application/octet-stream, 489 B)
#! /bin/sh
exec 1>/tmp/toto.1 2>/tmp/toto.2
set -x
OLDIFS=$IFS
PATH=/sbin:/usr/sbin:$PATH
insmod noarp >/dev/null 2>&1
grep -E 'address.*:' /etc/sysconfig/ha/pulse1.cf | \
awk '{ print $3 " " $4; }' | \
sort -u | \
while read line
do
set $line
ip=$1
if=$2
IFS=":"
set $if
IFS=$OLDIFS
if=$2
noarpctl add $ip
ifconfig lo:$if $ip netmask 255.255.255.255 up
done
( ifconfig ; cat /proc/net/noarp ) | mail -s "$HOSTNAME becoming inactive" [email protected]