Forum Discussion
TCL error - no such pool
It would appear that [LB::server pool] loses context somewhere inside the TCP session. It would appear that you're looping through each active pool member (on each request) to see if the persisted node (from the cookie) is in the active list. Here is a slightly different, and hopefully slighter more optimized approach:
when RULE_INIT {
set static::COOKIEKEY "skyisblue"
}
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
If the cookie exists, connect to the IP spACCMfied in the cookie
if { [HTTP::cookie exists "ACCM"] } {
set decrypted [HTTP::cookie decrypt "ACCM" $static::COOKIEKEY]
if { $decrypted ne "" } {
Make sure node in cookie value is still viable
if { [LB::status pool $default_pool member [lindex [split $decrypted "%"] 0] [lindex [split $decrypted "%"] 1]] eq "up" } {
Send to persisted pool member
pool $default_pool member [lindex [split $decrypted "%"] 0] [lindex [split $decrypted "%"] 1]
} else {
Pool member is down - automatically select new pool members and send new cookie
set need_cookie 1
}
}
} else {
set need_cookie 1
}
}
when HTTP_RESPONSE {
if { [info exists need_cookie] } {
unset need_cookie
HTTP::cookie insert name "ACCM" value "[IP::remote_addr]%[TCP::remote_port]" path /
HTTP::cookie encrypt "ACCM" $static::COOKIEKEY
HTTP::cookie expires "ACCM" 86400
}
}
This version puts both the IP and port into the encrypted cookie, and then simply checks to make sure this node is still "up" in the pool before sending traffic to it. If the pool member is down, auto-selection will happen and the client will get a new persistence cookie.
You could also potentially just enable cookie encryption in the HTTP profile. It won't change the cookie name (BIGipServer[pool name]), but the value will be encrypted with your passphrase.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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