Forum Discussion
Adam_5712
Nimbostratus
Mar 19, 2010having a little trouble persisting through many vips to pool members on a specific host
Can anyone point me to an example that might help resolve this persistence issue?
I have a set of VIPs for various portals that route to pools that contain 3 virtual interfaces. Each virtual interface resides on a specific host and in each pool I have a member that represents the virtual interface from each host. The application is supposed to detect if your session belongs on host A, B, or C but this is not working. When a source ip is load balanced to a pool member on host A, I need all subsequent requests by this IP to also be routed to host A, no matter which of the 4 vips they request. The connection needs to always select the pool member on the same host it used when the session was established.
Any help at all would be greatly appreciated!
Thanks,
Adam
- Adam_5712
Nimbostratus
I'm fairly certain there isn't a built in profile that will allow me to group members of different pools into a logical unit and allow me to persist a source IP that has used a pool member in that logical unit to only use other pool members in that same logical unit. I think this can be done with a universal profile across vips that calls an irule that can iterate through a data grouping of all pool members and determine which members belong to logical unit A, B, C. Then depending on the service they are requesting, send them to the pool member associated with the logical unit in which they are already assigned. I'm quite new to writing irules and have only written a few simple ones. If there is something similar that I can take a look at I can use that to build this rule. - hoolio
Cirrostratus
Hi Adam, - Adam_5712
Nimbostratus
Hi Aaron, - Sorry about that, read it quick on my phone and didn't realize you were referencing 3 different pools...
- Ian_SmithRet. Employeethis is a rule that would do this for v10.1 platforms:
use a class list to tie pool member ips to a physical node: class cluster_list { { "10.200.30.12" { "1" } "10.200.30.13" { "2" } "10.200.30.15" { "1" } "10.200.30.16" { "2" } "10.200.30.17" { "1" } "10.200.30.18" { "2" } } } ++++ then put the rule on all virtual servers ++++ change the virtual server and pool member names when CLIENT_ACCEPTED { switch [string tolower [virtual name]] { http_test_2 {set p http_pool_2} http_test_3 {set p http_pool_3} } if {[table lookup -subtable [IP::client_addr] "cluster"] ne "" } { foreach m [lindex [active_members -list $p] {} ] { if { [getfield [class lookup [getfield $m " " 1] cluster_list] " " 1] eq [table lookup -subtable [IP::client_addr] "cluster"] } { pool $p member [getfield $m " " 1] log local0. "[virtual name] 3b. found a match - previous visit for [IP::client_addr] to cluster [table lookup -subtable [IP::client_addr] "cluster"] and pool member $m in cluster [getfield [class lookup [getfield $m " " 1] cluster_list] " " 1]" return } else { log local0. "FAIL: can't match the remembered cluster to an active pool member [getfield [class lookup [getfield $m " " 1] cluster_list] " " 1]:[table lookup -subtable [IP::client_addr] "cluster"]" } } } else { if {[active_members $p] > "0" } { pool $p } else { log local0. "[virtual name] FAIL: there are no active members in pool $p" } } } when LB_SELECTED { table add -subtable [IP::client_addr] "cluster" [class lookup [LB::server addr] cluster_list] }
- When you say ""corresponding server" does the mapping ever change or is it static? if not, what exactly are you looking to key on in the session?
- Ian_SmithRet. EmployeeThe rule has two data points that matter -
- hoolio
Cirrostratus
Adam, - Thanks Ian, Pretty slick. Adam, did this work for you?
- hoolio
Cirrostratus
Hi iRuleYou,
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