Forum Discussion
Help with an iRule to disconnect active connections to Pool Members that are "offline"
In order to update an application, we put one node out of two offline in the pool. However, any existing connections don't get directed to the node that is online. It gets a 404 error.
Is there an iRule that can detect the node is offline and drain the connections and redirect it to the node that is actually online?
Saw this article, but it does not work for us.
https://clouddocs.f5.com/api/irules/LB__status.html
I have also tried something like this (see below). I tried putting some debug code in the log to show status, but I can't get a status other than "up" in the logs, even when I force the nodes offline. I am hoping someone has done this.
"-------------------
when LB_SELECTED {
# Extract pool, IP, and port
set poolname [LB::server pool]
set ip [LB::server addr]
set port [LB::server port]
# Get member status correctly
set status [LB::status pool $poolname member $ip $port]
log local0. "Selected member $ip:$port in pool $poolname has status $status"
if { $status eq "down" } {
log local0. "Member is DOWN (possibly forced down) – reselection triggered"
LB::reselect
}
}
--------------------------------"
Recent Discussions
Related Content
* 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