Forum Discussion
Dexter09_326053
Nimbostratus
Jul 04, 2017Persistence with Oneconnect
We've got this irule for cookie persistence and we don't even know what it does. This was a legacy configuration. The issue is that the node still goes to the same server even if that server is down...
Stanislas_Piro2
Cumulonimbus
Jul 04, 2017Hi,
the problem is
[active_members -list $default_pool] returns a list of list like :
{{192.168.1.144 80} {192.168.1.164 80}}
[lsearch -exact [active_members -list $default_pool] 192.168.1.144] will always return -1
the right command must be:
[lsearch -exact [active_members -list $default_pool] {192.168.1.144 80}]
or
[LB::status pool $default_pool member $target_member 80]
you can try this irule:
when CLIENT_ACCEPTED {
set default_pool [LB: Server pool]
log local5. "Pool $default_pool select"
}
when HTTP_REQUEST {
log local5. "Client Existing Cookie: [HTTP::cookie value "webserver"]"
Try to select a pool based on the http cookie containing pool information
if { [active_members $default_pool ] > 1 } {
switch [HTTP::cookie value "webserver"] {
"server11" {set target_member "192.168.1.160"}
"server22" {set target_member "192.168.1.164"}
"server33" {set target_member "192.168.1.143"}
"server44" {set target_member "192.168.1.144"}
default {
pool pool $default_pool
log local5. "No cookie : Load Balance to $default_pool pool"
return
}
}
if { [LB::status pool $default_pool member $target_member 80] } {
pool $default_pool member $target_member
} else {
pool $default_pool
log local5. "Pool member failure : Load Balance to $default_pool pool"
}
}
}
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
