Forum Discussion
Pool member failback
Hi guys,
the following irule logic inspired by some of the comments above, seems a bit neater and should do the trick. You will need to adjust the pool names and pool member counts as required, and you can of course perform more complex calculations if you prefer.
I did some basic testing, but i can't promise i caught all potential errors, so make sure to give it a whirl in a test environment first.
when RULE_INIT {
set static::pp "webpool"
set static::bp "backupwebpool"
set static::flag "flag"
}
when CLIENT_ACCEPTED {
if { [table lookup $static::flag] eq "backup" && [active_members $static::pp] < 1 } {
we're in backup mode
log local0. "backup mode"
pool $static::bp
}elseif { [active_members $static::pp] >= 1} {
active mode
log local0. "going back to active mode"
table set $static::flag "active"
pool $static::pp
}else {
backup mode needs to be enabled
log local0. "enabling backup mode"
table set $static::flag "backup"
pool $static::bp
}
}
also, might be worth looking into priority group activation, a feature of pools that can do something similar to this without needing irules, and with probably better handling of cases like persistence than this irule.
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