LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

lvs/tun+ha+ldirectord help

To: "lvs-users" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: lvs/tun+ha+ldirectord help
From: "wlx" <wlx@xxxxxxxxx>
Date: Mon, 13 Nov 2006 18:13:26 +0800
hi,all
my cluster obtain 3 realservers,the tunnel and noarp script like this

[root@LAN-128 init.d]# vi tunl0


#!/bin/sh

# chkconfig: 2345 70 10

# description: Config tunl port and apply arp patch

VIP=192.168.100.203

. /etc/rc.d/init.d/functions

case "$1" in

    start)

        echo "Tunl port starting"

        ifconfig tunl0 $VIP netmask 255.255.255.255 broadcast $VIP up


        echo 1 > /proc/sys/net/ipv4/ip_forward


/bin/echo "1" > /proc/sys/net/ipv4/conf/all/arp_ignore
/bin/echo "2" > /proc/sys/net/ipv4/conf/all/arp_announce
/bin/echo "1" > /proc/sys/net/ipv4/conf/tunl0/arp_ignore
/bin/echo "2" > /proc/sys/net/ipv4/conf/tunl0/arp_announce
/bin/echo "0" > /proc/sys/net/ipv4/conf/tunl0/rp_filter


        ;;


    stop)

        echo "Tunl port closing"

        ifconfig tunl0 down

        echo 1 > /proc/sys/net/ipv4/ip_forward

/bin/echo "1" > /proc/sys/net/ipv4/conf/all/arp_ignore
/bin/echo "2" > /proc/sys/net/ipv4/conf/all/arp_announce
/bin/echo "1" > /proc/sys/net/ipv4/conf/eth0/arp_ignore
/bin/echo "2" > /proc/sys/net/ipv4/conf/eth0/arp_announce
/bin/echo "1" > /proc/sys/net/ipv4/conf/lo/arp_ignore
/bin/echo "2" > /proc/sys/net/ipv4/conf/lo/arp_announce


        ;;

    *)

        echo "Usage: $0 {start|stop}"

        exit 1

esac

all looks like ok,but when i  run tunl0 stop in 192.168.100.125,then in 
director i run ipvsadm -ln ,display:

[root@backup ~]# ipvsadm -ln
IP Virtual Server version 1.2.0 (size=1048576)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.100.203:80 wlc
  -> 192.168.100.128:80            tunnel 1      0          0         
  -> 192.168.100.120:80            tunnel   1      0          0         
  -> 192.168.100.125:80           tunnel   1      0          0        
the 192.168.100.120's weight not change to 0,if i run  telnet 192.168.100.203 
80 sequenctly in a client,ipvsadm -ln,display:
[root@backup ~]# ipvsadm -lnc
IPVS connection entries
pro expire state source virtual destination
TCP 00:39 SYN_RECV 192.168.100.1:32779 192.168.100.203:80 192.168.100.125:80
TCP 00:42 SYN_RECV 192.168.100.1:32773 192.168.100.203:80 192.168.100.125:80
TCP 00:42 SYN_RECV 192.168.100.1:32782 192.168.100.203:80 192.168.100.125:80
TCP 00:30 SYN_RECV 192.168.100.1:32774 192.168.100.203:80 192.168.100.125:80
TCP 00:36 SYN_RECV 192.168.100.1:32777 192.168.100.203:80 192.168.100.125:80
TCP 00:40 SYN_RECV 192.168.100.1:32780 192.168.100.203:80 192.168.100.125:80
TCP 00:44 SYN_RECV 192.168.100.1:32783 192.168.100.203:80 192.168.100.125:80
TCP 00:33 SYN_RECV 192.168.100.1:32775 192.168.100.203:80 192.168.100.125:80
TCP 00:45 SYN_RECV 192.168.100.1:32784 192.168.100.203:80 192.168.100.125:80
TCP 00:37 SYN_RECV 192.168.100.1:32772 192.168.100.203:80 192.168.100.125:80
TCP 14:56 ESTABLISHED 192.168.100.1:32785 192.168.100.203:80 192.168.100.128:80
TCP 01:56 FIN_WAIT 192.168.100.1:32770 192.168.100.203:80 192.168.100.128:80
TCP 00:41 SYN_RECV 192.168.100.1:32781 192.168.100.203:80 192.168.100.125:80
TCP 14:11 ESTABLISHED 192.168.100.1:32771 192.168.100.203:80 192.168.100.120:80
TCP 00:35 SYN_RECV 192.168.100.1:32776 192.168.100.203:80 192.168.100.125:80
TCP 00:37 SYN_RECV 192.168.100.1:32778 192.168.100.203:80 192.168.100.125:80
the connections are mostly sent to the realserver which tunnel is  stoped.
my ldirctord.cf
# Global Directives
checktimeout=3
checkinterval=3

autoreload=yes
logfile="/var/log/ldirectord.log"

virtual=192.168.100.203:80
        real=192.168.100.120:80 gate
        real=192.168.100.125:80 gate
        real=192.168.100.128:80 gate
        service=http
        checkport=80
        checktype=connect
        protocol=tcp

hope your help,thanks in advance! 




wlx
2006-11-13

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