Forum Discussion
You need to track a unique local id somehow and then use irule to select pool member based on that id. Haven’t tested this but I would use tcl_platform(machine) to get hostname assuming they are different.
I know it's a bit special setup, but that came as a requirement from the application team. It does not make much sense to me either, but I wanted to find out if something like that is even possible if I really have to implement it.
Thanks Farshadd for the tip, it is actually exactly what I need. I tried it and it works with this simple irule assigning one of two different pools:
when CLIENT_ACCEPTED {
set f5 $static::tcl_platform(machine)
if { $f5 equals "f5DC1.mydomain.com" } {
pool pool_APP_DC1_DC2
} elseif { $f5 equals "f5DC2.mydomain.com" } {
pool pool_APP_DC2_DC1
} else {
log local0. "Error: machine info invalid!"
reject
}
}
The pools will use priority group scheme:
pool_APP_DC1_DC2: server in DC1 higher priority than the server in DC2
pool_APP_DC2_DC1: server in DC2 higher priority than the server in DC1
With this setup I need only 1 VIP, the HA will be achieved because the VIP can still fail over to the other DC, and each pool will have the possibility to fail over to second pool member shall the higher priority member become unavailable. I agree this is not about balancing the load, but more about "same DC VIP to server stickyness" while keeping the HA in place.