Forum Discussion
arch_184454
Nimbostratus
Oct 09, 2015iRule (round robin) modification - ignore if the node in pool is down!
I have an irule to divert traffic to two servers, and it is working as round robin, and want to get some help to modify this rule so if one node is down the traffic flows to another... I am hoping th...
IheartF5_45022
Nacreous
Oct 09, 2015You'll need to create a pool, pl_redirect_pool with an HTTP monitor and Server1 and Server2 as members. Then try this rule (note you need to hardcode the IPs of Servers 1 and Server 2 in here also);-
when RULE_INIT {
set ::whichone 0
set ::servers [list "x.x.x.x" "y.y.y.y"]
Unfortunately have to hardcode the server IPs here
set ::redirs [list "http://Server1/xyz" "http://Server2/xyz"]
}
when HTTP_REQUEST {
if { [LB::status pool pl_redirect_pool member [lindex $servers $::whichone] 80] eq "up" } {}
HTTP::redirect [lindex $::redirs $::whichone]
else {
HTTP::redirect [lindex $::redirs [expr ! $::whichone]]
}
set ::whichone [expr ! $::whichone] }
}
arch_184454
Nimbostratus
Oct 09, 2015Thank you "IheartF5" :) I will give it a try and will get back to you by Monday. Really appreciate your help.
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