Forum Discussion
JJ_47859
Nimbostratus
Apr 21, 2008LB:server breaks my website
Hello,
We encountered a serious issue with out web application. I recently created an irule to redirect the users browser to an offline page if there were no servers available in the pool.
Here's the code:
when HTTP_REQUEST {
set mypool [LB::server]
if {[active_members $mypool] < 1 } {
log "all $mypool pool members are unavailable redirecting to maintenance page."
HTTP::redirect "http://offline.com"
}
}
Our some functionality of our web application broke after this code was implemented. I found that if I statically set the pool name then everything works.
Good code example:
when HTTP_REQUEST {
if {[active_members SERVERNAME] < 1 } {
HTTP::redirect "http://offline.com"
}
}
How can I find what LB::server is doing to break my web code?
Thanks.
- Colin_Walker_12Historic F5 AccountThis is likely due to the fact that there is no load balancing decision made until after the HTTP_REQUEST event. If you want to dynamically check the number of active members of the pool, you'll need to do so during or after the LB_SELECTED event, which signifies that the BIG-IP has actually made a load balancing decision, and chosen which node to send traffic to.
- JRahm
Admin
LB::server returns a Tcl list with pool, node addr and port. [LB::server pool] is what you want when setting the pool name. - aayamauchi_746
Nimbostratus
Not sure if you've come up with a solution to this already, but I've been using the following persistence iRule to get the load balancer to disable persistence and reselect from a pool of servers with outage content when the LB fails to get a member from the default pool. In my case, breaking the persistence and not having the redirect be visible to the end-user were requirements. May not be the cleanest way to do this, but it seems to work.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects