Forum Discussion
scaissie_82066
Nimbostratus
Jun 05, 2007LB::reselect doesn't select another node
I have an iRule that sets persistence based on a usrid string in the TCP payload. That works, but when the node goes down, I can't get the same usrid's to move to another server. They remain stuck t...
Tomasz_Radzisze
Nimbostratus
Jul 18, 2007I also had a problem with LB::reselect selecting always the same node, but in different circumstances. My iRule uses "hand-made" persistence, i.e. it extracts the server address from the packet contents and selects it using the node command. The simplified iRule is below (the actual one is too complex to put here):
when HTTP_REQUEST {
HTTP::collect [HTTP::header "Content-Length"]
}
when HTTP_REQUEST_DATA {
Assume that payload contains host:port
set host [substr [HTTP::payload] 0 ":"]
set port [findstr [HTTP::payload] ":" 1]
Route there only if node status is "up"
set status [LB::status pool $::pool member $host $port]
log local0.debug "Status: $status"
if { $status eq "up" } {
node $host $port
}
}
when LB_FAILED {
If the selected server doesn't work, route it to any server
LB::reselect
}
This didn't work correctly - LB::reselect always selected the same node as previously selected by "node" command. Adding LB::detach before reselect didn't change anything. However, it turned out that using LB::reselect with pool name works (even without detach)! So, the code for LB_FAILED event now looks as follows:
when LB_FAILED {
If the selected server doesn't work, route it to any server
LB::reselect pool mypool
}
It seems that when I was using LB::reselect without argument, the node command was still in force.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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