Forum Discussion
Irule to select pool in a complicated failover scenario
I initially thought why not go with Priority Group method for this. But your 3rd requirement makes it bit complicated. We have to play around with monitors for that. So I think the easy approach would be to go with an Irule.
Also to make this work, create your 3 A, B, C VIP's and map A, B, C as default pools.
Pool name - A_PROD_POOL (Servers - A_PROD_SRVR_1 & A_PROD_SRVR_2)
Pool name - A_STG_POOL (Servers - A_STG_SRVR_1 & A_STG_SRVR_2)
Pool name - B_PROD_POOL (Servers - B_PROD_SRVR_1 & B_PROD_SRVR_2)
Pool name - B_STG_POOL (Servers - B_STG_SRVR_1 & B_STG_SRVR_2)
Pool name - C_PROD_POOL (Servers - C_PROD_SRVR_1 & C_PROD_SRVR_2)
Pool name - C_STG_POOL (Servers - C_STG_SRVR_1 & C_STG_SRVR_2)
ltm rule test {
when CLIENT_ACCEPTED {
set poolname [findstr [LB::server pool] "" 8 ]
#The output of poolname will be A_PROD_POOL
set STG_POOL [string map {PROD STG} $poolname]
#The output of STG_POOL will be A_STG_POOL
}
when HTTP_REQUEST {
if { ([active_members A_PROD_POOL] > 0) && ([active_members B_PROD_POOL] > 0) && ([active_members C_PROD_POOL] > 0)} {
#When all services are Up, the traffic will goto default pool.
pool $poolname
} else {
#When any of services are down, the traffic will goto corresponding STAGING pool.
pool $STG_POOL
}
}
You can apply this Irule to all 3 vips, because its dynamic.
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