Forum Discussion

Shishir_84445's avatar
Shishir_84445
Icon for Nimbostratus rankNimbostratus
Oct 20, 2011

iRule Help on LB:reslect

Hello,

 

I need some help on the iRule. I have this iRule

 

----------------------------------------------------------------

 

when CLIENT_ACCEPTED {

 

if { [IP::addr [IP::client_addr] equals 10.10.10.10] } {

 

pool CSW_185_POOL

 

}

 

else {pool CSW_186_POOL}

 

}

 

when LB_FAILED {

 

LB::reselect

 

log local0. "Selected server [LB::server] did not respond. Re-selecting node from CSW_POOL2"

 

}

 

------------------------------------------------------------------------

 

CSW_185_POOL Contains one Member 1.1.1.185:80

 

CSW_186_POOL Contains one Member 1.1.1.186:80

 

CSW_POOL2 Contains 2 Members--> 1.1.1.185:80 and 1.1.1.186:80

 

CSW_POOL2 is applied to the VIP.

 

 

Now load balancing works when both servers are UP, but if one of the server is kept DOWN or rebooting, the LB:reselect does not pick up the other active member from the pool CSW_POOL2. As per the theory "LB::reselect" should pick up the active member in the pool.

 

Can anyone advice if the logic in not proper?

 

Thanks.

 

 

---Shishir

 

2 Replies

  • e.g.

     

     

    [root@iris:Active] config b virtual bar list

     

    virtual bar {

     

    snat automap

     

    pool foo

     

    destination 172.28.17.33:http

     

    ip protocol tcp

     

    rules myrule

     

    profiles {

     

    http {}

     

    tcp {}

     

    }

     

    }

     

    [root@iris:Active] config b pool foo list

     

    pool foo {

     

    members {

     

    10.10.70.110:http {}

     

    74.125.235.50:http {}

     

    }

     

    }

     

    [root@iris:Active] config b rule myrule list

     

    rule myrule {

     

    when CLIENT_ACCEPTED {

     

    pool foo1

     

    }

     

    when LB_SELECTED {

     

    log local0. "uri - [HTTP::uri]|pool - [LB::server pool]/[LB::server addr]"

     

    }

     

    when LB_FAILED {

     

    LB::reselect pool foo

     

    log local0. "uri - [HTTP::uri]|pool - [LB::server pool]/[LB::server addr]"

     

    }

     

    }

     

    [root@iris:Active] config b pool foo1 list

     

    pool foo1 {

     

    members 10.10.70.110:http {}

     

    }

     

     

    [root@iris:Active] config curl -I http://10.10.70.110/

     

    curl: (7) couldn't connect to host

     

     

    [root@iris:Active] config curl -I http://172.28.17.33/

     

    HTTP/1.1 200 OK

     

    Date: Thu, 20 Oct 2011 17:29:06 GMT

     

    Expires: -1

     

    Cache-Control: private, max-age=0

     

    Content-Type: text/html; charset=ISO-8859-1

     

    Server: gws

     

    X-XSS-Protection: 1; mode=block

     

    X-Frame-Options: SAMEORIGIN

     

    Transfer-Encoding: chunked

     

     

    [root@iris:Active] config tail -f /var/log/ltm

     

    Oct 21 01:28:38 local/tmm info tmm[17220]: Rule myrule : uri - /|pool - foo1/10.10.70.110

     

    Oct 21 01:28:38 local/tmm info tmm[17220]: Rule myrule : uri - /|pool - foo1/10.10.70.110

     

    Oct 21 01:28:38 local/tmm info tmm[17220]: Rule myrule : uri - /|pool - foo/10.10.70.110

     

    Oct 21 01:28:38 local/tmm info tmm[17220]: Rule myrule : uri - /|pool - foo/10.10.70.110

     

    Oct 21 01:28:38 local/tmm info tmm[17220]: Rule myrule : uri - /|pool - foo/74.125.235.50