Forum Discussion
Persistence 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. The healthcheck is ok as we can see from the logs that it was detected as down.
We suspect that this rule is somehow causing the issue but we can't even interpret what it does. Any help is much appreciated.
- Dexter09_326053
Nimbostratus
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 } { if { [HTTP::cookie value "webserver"] equals "server11" } { check if the pool member is active before forwarding if { [lsearch -exact [active_members -list $default_pool] 192.168.1.160] } { node 192.168.1.160 log local5. "Persist to server uws002" } } elseif { [HTTP::cookie value "webserver"] equals "server22" } { if { [lsearch -exact [active_members -list $default_pool] 192.168.1.164] } { node 192.168.1.164 log local5. "Persist to server uws003" } } elseif { [HTTP::cookie value "webserver"] equals "server33" } { if { [lsearch -exact [active_members -list $default_pool] 192.168.1.143] } { node 192.168.1.143 log local5. "Persist to server uws004" } } elseif { [HTTP::cookie value "webserver"] equals "server44" } { if { [lsearch -exact [active_members -list $default_pool] 192.168.1.144] } { node 192.168.1.144 log local5. "Persist to server uws005" } } else { pool $default_pool log local5. "Load Balance to $default_pool pool" } } }
- Stanislas_Piro2
Cumulonimbus
Hi,
the problem is
returns a list of list like :[active_members -list $default_pool]
{{192.168.1.144 80} {192.168.1.164 80}}
will always return[lsearch -exact [active_members -list $default_pool] 192.168.1.144]
-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" } } }
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