LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Configuring LVS-DR realservers, some tricks (was : RE: Other trouble)

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Configuring LVS-DR realservers, some tricks (was : RE: Other trouble)
From: "Francois JEANMOUGIN" <Francois.JEANMOUGIN@xxxxxxxxxxxxxxxxx>
Date: Fri, 16 Jan 2004 09:51:32 +0100

> Before run the script I can get connection for all my servers, but when I
> run
> it I lost connecion and the only difference in the route table is this:
> 10.2.2.71 dev lo  scope link  src 10.2.2.71


I had the same. You should not add any lo route. I don't know why. Here is how 
I configure my realservers for LVS-DR :

I use noarpctl and first of all I had the noarp entry

I add a lo:n interface using ifconfig (never use ifup, it seems to make some 
arp things, and operate badly on an already running cluster).

I start the service. Then I configure the director via keepalived.

To make it right in case of reboot. I add the ifcfg-lo:n thing to the redhat 
/etc/sysconifg/network-script directory :

DEVICE=lo:1
IPADDR=(VIP)
NETMASK=255.255.255.255
BROADCAST=(VIP)
ONBOOT=yes

And then I have this init.d script I use for noarp :

#!/bin/bash
# noarp init script
# For LinuxVirtualServer realservers
# FJ 05/01/2004 (logical, french date format)
# noarp devs are welcome to add it to the noarp distribution as
# an example under the GPLv2 or BSD licence (but I would never grant
# any rights for such a simple script).

start () {
# This is a little bit tricky. I use my director for both 
# public (194.*) and private (10.*) IPs. So...
for i in /etc/sysconfig/network-scripts/ifcfg-eth* ; do
        . $i
        if [ `echo $IPADDR | cut -f 1 -d "."` ==  194 ] ; then
                RIPPUB=$IPADDR
        fi
        if [ `echo $IPADDR | cut -f 1 -d "."` ==  10 ] ; then
                RIPPRIV=$IPADDR
        fi
done
# Let's have a look at the loopback aliases
for i in /etc/sysconfig/network-scripts/ifcfg-lo:* ; do
        . $i
        if [ `echo $IPADDR | cut -f 1 -d "."` ==  194 ] ; then
                /usr/local/sbin/noarpctl add $IPADDR $RIPPUB
        fi
        if [ `echo $IPADDR | cut -f 1 -d "."` ==  10 ] ; then
                /usr/local/sbin/noarpctl add $IPADDR $RIPPRIV
        fi
done
}

stop () {
/usr/local/sbin/noarpctl reset
}
status () {
/usr/local/sbin/noarpctl list
}

case "$1" in
  start)
        start $1
        ;;
  stop)
        stop $1
        ;;
  restart|reload)
        restart $1
        ;;
  status)
        status
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|status}"
        exit 1
esac

In fact I feel it much more easy than all those configure things :)).

François.

(If anyone knows why this fucking OE2003 don't want to wrap my lines, sorry).



<Prev in Thread] Current Thread [Next in Thread>
  • Configuring LVS-DR realservers, some tricks (was : RE: Other trouble), Francois JEANMOUGIN <=