lvs not setting up real servers

Greg Boehnlein <[email protected]>
Newsgroups gmane.linux.redhat.piranha
Message-ID <[email protected]>
Hello,
	I have a pair of RH AS 2.1 LVS Routers in direct routing 
mode configured as the front end for two back-end services. The goal of 
this cluster is to provide HA Load Balancing to a pair of backend 
Mail/Web/Ftp servers. The problem I am having is that the "lvs" command 
does not seem to be adding all of the rules defined in the lvs.cf file. 
Specifically, it seems to skip the pair of real-servers that I have 
defined for my SMTP cluster. I have verified this behavior by adding the 
ipvsadm commands by hand to get the services to work. When I do this, it 
works fine. But I can't get the system to do it auomatically either by 
using the Piranha GUI or by edting the lvs.cf by hand.

Here is the lvs.cf file I am using:

serial_no = 61
primary = 207.166.192.17
service = lvs
backup_active = 1
backup = 207.166.192.18
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = direct
reservation_conflict_action = preempt
debug_level = 9
virtual mail.nacs.net {
     active = 1
     address = 207.166.192.19 eth0:1
     port = 25
     send = "quit\r\n"
     expect = "221"
     load_monitor = none
     scheduler = wlc
     protocol = tcp
     timeout = 6
     reentry = 15
     quiesce_server = 0
     server node2.nacs.net {
         address = 207.166.192.34
         active = 1
         weight = 1
     }
     server tracy.nacs.net {
         address = 207.166.192.36
         active = 1
         weight = 1
     }
}

virtual www.nacs.net {
     active = 1
     address = 207.166.192.19 eth0:1
     port = 80
     send = "GET / HTTP/1.0\r\n\r\n"
     expect = "HTTP"
     load_monitor = none
     scheduler = wlc
     protocol = tcp
     timeout = 6
     reentry = 15
     quiesce_server = 0
     server node2.nacs.net {
         address = 207.166.192.34
         active = 1
         weight = 1
     }
     server tracy.nacs.net {
         address = 207.166.192.36
         active = 1
         weight = 1
     }


When "pulse" is started, the ipvsadm command returns the following:

IP Virtual Server version 0.8.1 (size=65536)                   
Prot LocalAddress:Port Scheduler Flags                         
  -> RemoteAddress:Port             Forward Weight ActiveConn InActConn
TCP  cluster.nacs.net:smtp wlc
TCP  cluster.nacs.net:http wlc
  -> tracy.nacs.net:http            Route   1      0          0         
  -> node2.nacs.net:http            Route   1      0          0         

I've tracked the particular program responsible for adding the 
ipvsadm commands to "lvs". An Strace of "lvs" shows the following calls to 
ipvsadm:

4731  execve("/sbin/ipvsadm", ["/sbin/ipvsadm", "-C"], [/* 23 vars */]) = 0

4734  execve("/sbin/ipvsadm", ["/sbin/ipvsadm", "-A", "-t", 
"207.166.192.19:80", "-s", "wlc"], [/* 23 vars */]) = 0

4737  execve("/sbin/ipvsadm", ["/sbin/ipvsadm", "-A", "-t", 
"207.166.192.19:25", "-s", "wlc"], [/* 23 vars */] <unfinished>

4740  execve("/sbin/ipvsadm", ["/sbin/ipvsadm", "-a", "-t", 
"207.166.192.19:80", "-r", "207.166.192.36", "-g", "-w", "1"], [/
* 23 vars */] <unfinished ...>

4741  execve("/sbin/ipvsadm", ["/sbin/ipvsadm", "-a", "-t", 
"207.166.192.19:80", "-r", "207.166.192.34", "-g", "-w", "1"], [/
* 23 vars */] <unfinished ...>

I can see no commands being executed to add the real servers for the SMTP 
clustering. Hence, the clustering does not work. This is bad.

So, I added the rules by hand:

[root@atm1 ha]# cat ipvsadm-rules 
-A -t cluster.nacs.net:smtp -s wlc
-a -t cluster.nacs.net:smtp -r tracy.nacs.net:smtp -g -w 1
-a -t cluster.nacs.net:smtp -r node2.nacs.net:smtp -g -w 1
-A -t cluster.nacs.net:http -s wlc
-a -t cluster.nacs.net:http -r tracy.nacs.net:http -g -w 1
-a -t cluster.nacs.net:http -r node2.nacs.net:http -g -w 1

[root@atm1 ha]# ipvsadm -R < ipvsadm-rules 
[root@atm1 ha]# ipvsadm
IP Virtual Server version 0.8.1 (size=65536)                   
Prot LocalAddress:Port Scheduler Flags                         
  -> RemoteAddress:Port             Forward Weight ActiveConn InActConn
TCP  cluster.nacs.net:smtp wlc
  -> node2.nacs.net:smtp            Route   1      0          0         
  -> tracy.nacs.net:smtp            Route   1      0          0         
TCP  cluster.nacs.net:http wlc
  -> node2.nacs.net:http            Route   1      0          0         
  -> tracy.nacs.net:http            Route   1      0          0         

And everything works great. I guess my question is does anyone have a clue 
as to what might be going on?

Thanks,
Greg

-- 
    Vice President of N2Net, a New Age Consulting Service, Inc. Company
         http://www.n2net.net Where everything clicks into place!
                             KP-216-121-ST
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.