LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

ldirectord: wrong RIP port in if VIP port != RIP port

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: ldirectord: wrong RIP port in if VIP port != RIP port
From: sll <simonluca.landi@xxxxxxxxx>
Date: Sun, 27 Nov 2005 21:09:02 +0100
 Hi all,
  I'm using ldirectord+heartbeat+lvs (Ultramonkey) to load balance a
group of web
 servers.
ldirecotrd is 1.77.2.32 2005/09/21

When I create a virtual entry and set the VIP port to 8081, but the
real  server port to 8082, ldirectord adds two entries in the LVS
table for each real server: one for RIP:8082 with a weight of 1 and
one with RIP:8081 with a weight of zero.

This is the ldirectord.cf:

# Virtual Server for HTTP BackEnd Tomcat
virtual=xxx.xxx.xxx.xxx:8081
        real=10.0.1.1:8082 masq
        service=http
        request="status.html"
        receive="on"
        scheduler=rr
        #persistent=600
        protocol=tcp
        checktype=negotiate

After a restart of ldirectord
ipvs -L -n said:

IP Virtual Server version 1.2.0 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  xxx.xxx.xxx.xxx:8081 rr
  -> 10.0.1.1:8082     Masq    1      0          0

I shutdown tomcat on real server, and

ipvs -L -n said:

IP Virtual Server version 1.2.0 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  xxx.xxx.xxx.xxx:8081 rr
  -> 10.0.1.1:8081                Masq    0      0          0

As you can see, the "quiescient" server is on port 8081, not 8082
Now I start tomcat on real server:

ipvs -L -n said:

IP Virtual Server version 1.2.0 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  xxx.xxx.xxx.xxx:8081 rr
  -> 10.0.1.1:8082                Masq    1      0          0
  -> 10.0.1.1:8081                Masq    1      0          0

As you can see, the real server is correctly added to ldirectord, but
a fake entry is added from the quiescient server (I have another
webserver on port 8081)

usign /usr/sbin/ldirectord reload the correct config is reloaded.

I think that the problem in ldirectord script is that when a queiscent
server is added, the vip port and not the rip port is used. I'm not
very used to perl progrmming, so I don't try to fix it...

Cheers

--
-=[ SLL ]=-
http://www.isognidilivia.com

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