Forum Discussion
Chase_Hoffman_2
Nimbostratus
Apr 12, 2013iRule to parse status page and failover to secondary server/priority group
So I have a webserver, SERVERA. It's the primary node. There's a backup server, SERVERB, that should only be used if SERVERA is unavailable.
Due to some weirdness with the web application, the...
Kevin_Stewart
Employee
Apr 12, 2013I think you don't even need an iRule for this one. Using priority group load balancing you can set different priority values for members of a pool, such that lower priority members will ONLY be used if the higher priority members become unavailable. Add all of the servers to the same pool and then assign priority numbers to the members (higher numbers = higher priority). Then enable priority group activation and set a threshold.
Next you'll need an external monitor applied to the pool. The external monitor will need to point to a script (Perl, Bash, whatever) that can call (ex. via cURL) the status pages, parse the returned content, and return an up or down status to the applied monitor. There's some sample monitor scripts in /config/monitors to get you started. The monitor applied to the pool will periodically call the external script for each member of the pool. If the monitor indicates that ALL (or some defined threshold) of the higher priority members are down, only then will the pool use the lower priority members.
If you provide more detail and samples of the status pages we may be able to assist with the monitor scripts. ;)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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