LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Just to confirm that their is definitely a small bug in ldirectord (v1.

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Just to confirm that their is definitely a small bug in ldirectord (v1.99& latest)
From: malcolm <lists@xxxxxxxxxx>
Date: Fri, 07 Apr 2006 16:17:01 +0100
Just to confirm that  their is definitely a small bug in ldirectord,

The bit that checks if the RIP has already been checked doesn't allow for the same RIP but with a different virtual host setting (i.e. different web site)

I can't program so I've just riped out these bits from (v1.99) to solve the problem on my site.... Maybee someone can change it to take account of virtual servers as well as just RIPs?

In sub ld_main()...

REAL: foreach my $r (@$real) {
               my $real_id = get_real_id_str($r, $v);
               #foreach my $tmp_id (@real_checked) {
               #    if($real_id eq $tmp_id) {
# &ld_debug(3, "Already checked: real server=$real_id (virtual=$virtual_id)");
               #        next REAL;
               #    }
               #}

and is sub service_set()....

   # Check each virtual service for the real server and make
   # changes as neccessary
   #foreach $v (@VIRTUAL){
           # Use found rather than relying on tmp_id being
       # set when we leave the foreach loop. There
       # seems to some weirdness in Perl (5.6.0 on Redhat 7.2)
   #        my $found = 0;
   #    my $tmp_id;
   #    my $virtual_id = get_virtual_id_str($v);
   #    foreach $tmp_id (@$virtual) {
   #        if($virtual_id eq $tmp_id) {
   #            $found = 1;
   #            last;
   #        }
   #    }
   #    if ($found == 1) {
           if ($state=~/up/i) {
               _service_up($v, $r, $force);
               &ld_debug(2, "Enabled server=$$r{server}");
           } elsif ($state=~/down/i) {
               _service_down($v, $r, $force);
               &ld_debug(2, "Disabled server=$$r{server}");
           }
   #    }
   #}




lists@xxxxxxxxxx wrote:
I think I've run into a problem with the feature of ldirectord that only
checks a real servers status once (even if it occurs in multiple virtual servers)
Waiver:Not convinced because a similar set up seemed to work.

With the following config where only wwwtest.blast.com is set to weight=0..
ALL of the 192.168.3.60:80 servers in all of the VIPs go offline!
Tested in v1.99 & v1.132

Debug shows:
DEBUG3: Already checked: real server=negotiate:http:tcp:192.168.3.60:80:80:1:\/test\/lb\.aspx:Running (virtual=tcp:192.168.3.82:80) DEBUG3: Already checked: real server=negotiate:http:tcp:192.168.3.70:80:80:1:\/test\/lb\.aspx:Running (virtual=tcp:192.168.3.82:80) DEBUG3: Already checked: real server=negotiate:http:tcp:192.168.3.60:80:80:1:\/test\/lb\.aspx:Running (virtual=tcp:192.168.3.83:80) DEBUG3: Already checked: real server=negotiate:http:tcp:192.168.3.70:80:80:1:\/test\/lb\.aspx:Running (virtual=tcp:192.168.3.83:80) DEBUG3: Already checked: real server=negotiate:http:tcp:192.168.3.60:80:80:1:\/test\/lb\.aspx:Running (virtual=tcp:192.168.3.84:80) DEBUG3: Already checked: real server=negotiate:http:tcp:192.168.3.70:80:80:1:\/test\/lb\.aspx:Running (virtual=tcp:192.168.3.84:80)



checktimeout=5
checkinterval=10
quiescent=no
fallback=127.0.0.1:80
autoreload=yes
callback="/etc/ha.d/sync"
virtual=192.168.3.80:80 gate
real=192.168.3.60:80 gate 0 real=192.168.3.70:80 gate 1 fallback=127.0.0.1:80
    service=http
    checktype=negotiate
    checkport=80
    request="/test/lb.aspx"
    receive="Running"
    virtualhost="wwwtest.blast.com"
    scheduler=wlc
    netmask=255.255.255.255
    protocol=tcp
virtual=192.168.3.81:80 gate real=192.168.3.60:80 gate 1 real=192.168.3.70:80 gate 1 fallback=127.0.0.1:80
    service=http
    checktype=negotiate
    checkport=80
    request="/test/lb.aspx"
    receive="Running"
    virtualhost="asastest.blast.com"
    scheduler=wrr
    netmask=255.255.255.255
    protocol=tcp
virtual=192.168.3.82:80 gate real=192.168.3.60:80 gate 1 real=192.168.3.70:80 gate 1 fallback=127.0.0.1:80
    service=http
    checktype=negotiate
    checkport=80
    request="/test/lb.aspx"
    receive="Running"
    virtualhost="tracktest.blast.com"
    scheduler=wrr
    netmask=255.255.255.255
    protocol=tcp
virtual=192.168.3.83:80 gate real=192.168.3.60:80 gate 1 real=192.168.3.70:80 gate 1 fallback=127.0.0.1:80
    service=http
    checktype=negotiate
    checkport=80
    request="/test/lb.aspx"
    receive="Running"
    virtualhost="mpsatest.blast.com"
    scheduler=wrr
    persistent=300
    netmask=255.255.255.255
    protocol=tcp
virtual=192.168.3.84:80 gate real=192.168.3.60:80 gate 1 real=192.168.3.70:80 gate 1 fallback=127.0.0.1:80
    service=http
    checktype=negotiate
    checkport=80
    request="/test/lb.aspx"
    receive="Running"
    virtualhost="apptest.blast.com"
    scheduler=wrr
    netmask=255.255.255.255
    protocol=tcp
Ps. I think this is the code that effects it?
            REAL: foreach my $r (@$real) {
                my $real_id = get_real_id_str($r, $v);
                foreach my $tmp_id (@real_checked) {
                    if($real_id eq $tmp_id) {
&ld_debug(3, "Already checked: real server=$real_id (virtual=$virtual_id)");
                        next REAL;
                    }
                }
Thanks in advance for any help..
Regards,
Malcolm Turnbull.


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://www.in-addr.de/mailman/listinfo/lvs-users


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