Forum Discussion
swiss2000_13853
Nimbostratus
Jul 27, 2010Disable Persistence for Fallback Hosts
Hi all
I have a pool with 4 members, in which 2 members act as master servers (priority group 2) and the other 2 members are fallback hosts (priority group 1).
I'd now like to use source address persistence for the master members, but NO persistence for the fallback nodes. Otherwise clients get stuck on the fallback nodes, even if the master servers are available again.
Could somebody provide me with a short example of an iRule that would ensure that master servers use persistence, but fallback nodes don't?
Thanks & regards
Marc
- Chris_Miller
Altostratus
when LB_SELECTED { if { [IP::addr [LB::server addr] equals x.x.x.x or y.y.y.y] } { persist none } else { persist blah blah blah or it should use the default profile, others will advise } }
- swiss2000_13853
Nimbostratus
Thanks Chris!when LB_SELECTED { if { [LB::server priority] < 2 } { persist none } }
- swiss2000_13853
Nimbostratus
Chris and Aaron, thanks for your valuable support! :-) - hoolio
Cirrostratus
Hi Marc,when HTTP_REQUEST { Log the URI and the count of HTTP requests on this TCP connection log local0. " " log local0. " [IP::client_addr]:[TCP::client_port]: URI: [HTTP::uri], Request: [HTTP::request_num]" log local0. " [IP::client_addr]:[TCP::client_port]: persist lookup: \"[persist lookup source_addr [IP::client_addr]]\"" Check if this is the second HTTP request on the same TCP connection if {[HTTP::request_num] == 2}{ Disable persistence for the second HTTP request log local0. " [IP::client_addr]:[TCP::client_port]: disabling persistence" persist none } else { Enable persistence for all other HTTP requests log local0. " [IP::client_addr]:[TCP::client_port]: enabling source_addr persistence" persist source_addr 255.255.255.255 10 } } when LB_SELECTED { Log the selected server. This could differ from the persistence record if we've disables persistence log local0. " [IP::client_addr]:[TCP::client_port]: selected: [LB::server]" }
HTTP_REQUEST>: HTTP_REQUEST>: 10.21.2.2:51912: URI: /test0, Request: 1 HTTP_REQUEST>: 10.21.2.2:51912: persist lookup: "" HTTP_REQUEST>: 10.21.2.2:51912: enabling source_addr persistence LB_SELECTED>: 10.21.2.2:51912: selected: hooleya_www1_http_pool 1.1.1.1 80 HTTP_REQUEST>: HTTP_REQUEST>: 10.21.2.2:51912: URI: /test1, Request: 2 HTTP_REQUEST>: 10.21.2.2:51912: persist lookup: "hooleya_www1_http_pool 1.1.1.1 80" HTTP_REQUEST>: 10.21.2.2:51912: disabling persistence LB_SELECTED>: 10.21.2.2:51912: selected: hooleya_www1_http_pool 2.2.2.2 80 HTTP_REQUEST>: HTTP_REQUEST>: 10.21.2.2:51912: URI: /test2, Request: 3 HTTP_REQUEST>: 10.21.2.2:51912: persist lookup: "hooleya_www1_http_pool 1.1.1.1 80" HTTP_REQUEST>: 10.21.2.2:51912: enabling source_addr persistence LB_SELECTED>: 10.21.2.2:51912: selected: hooleya_www1_http_pool 1.1.1.1 80
- swiss2000_13853
Nimbostratus
Aaron, I have some more questions regarding this: - hoolio
Cirrostratus
Hi Marc,
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