Forum Discussion
Nested json f5 asm
- Simon_BlakelyMar 04, 2021
Employee
The overriding principle of persistence is that once a client has established a session to a pool member, it should stay there until the session expires. This is to prevent unexpected session failure due to changing pool member servers.
If a client has a session to the low priority server when the high priority servers are back up, the cookie persistence will keep returning the client to the low priority server until the cookie expires, so that the user sessions do not break.
If this behaviour is not desired, you will need to write an irule that looks at the load-balancing decision and the available members in the pool to determine whether the low priority pool member has been selected, whether any high priority pool members are available, and make a new load-balancing decision based on that information.
- SivaYenduriMar 04, 2021
Cirrus
I have written the below iRule. Could you please validate?
when LB_SELECTED {
if { [IP::addr [LB::server addr] equals "low-priority-ip"] } {
if {[LB::status pool pool_name member 1.1.1.1 8080 ] or [LB::status pool pool_name member 1.1.1.2 8080 ] equals "up"} {
LB::reselect
}
}
}
1.1.1.1 and 1.1.1.2 are the High priority IPs of the same pool "pool_name"
- Simon_BlakelyMar 04, 2021
Employee
That looks OK from a logical perspective.
Rather than checking if the High Priority pool members are available individually, I would just check to see if the number of available pool members is greater than 1, and reselect in that case.
when LB_SELECTED { if { ([IP::addr [LB::server addr] equals "low-priority-ip"]) and ([active_members pool_name] > 1) } { LB::reselect } }
Give that a test.