Forum Discussion
Gary_T_31565
Nimbostratus
Apr 23, 2007HTTP::fallback not working
hi,
new to irules. I am trialing 3400s.
HTTP:fallback is not working? I see "fallback host" in log. Tried with IE6 and IE7 just in case. Pool as two members which have their app pools stopped. URL works.
Seems simple check everyone else use of it...what am I missing?
Also is there a function to turn off a member i.e. change its status for unavailable.
Thanks
Gary
when CLIENT_ACCEPTED {
set retries 0}
when HTTP_REQUEST {
set request [HTTP::request]}
when HTTP_RESPONSE {
if { [HTTP::status] eq "503"} {
if { $retries < [active_members Pool2] } {
log "503 retrying $retries"
incr retries
HTTP::retry $request
}
else {
log "Fallback Host"
HTTP::fallback "http://livevm1/garys_warning.htm"
}
}
}
3 Replies
- Deb_Allen_18Historic F5 AccountHi Gary --
The command "HTTP::fallback" doesn't actually send traffic anywhere, it just sets the fallback target for this connection. The fallback target is only used if there are no responsive, available servers in the target pool. If even 1 server in the target pool looks available (UP [green] or UNCHECKED [blue]) and responds, no fallback is invoked.
Your iRule, however, is intended to respond with a redirect after several 503 responses. Since the servers have to be UP to respond with a 503 response, calling HTTP::fallback will not have the intended effect.
A minor change to your code will accomplish the expected redirect after the defined of 503 responses:when CLIENT_ACCEPTED { set retries 0 } when HTTP_REQUEST { set request [HTTP::request] } when HTTP_RESPONSE { if {[HTTP::status] eq "503"} { if {$retries < [active_members Pool2]} { log "503 retrying $retries" incr retries HTTP::retry $request } else { log "Max retries exceeded -- redirecting" HTTP::redirect "http://livevm1/garys_warning.htm" } } }
You can also apply health monitors to manage pool member availability, or toggle their status manually:
To make servers "unavailable" when not responding as expected, you will need to apply an HTTP monitor requesting a specific page and expecting a specific response. (Click here for manual page.)
To manually manage the pool members' status, browse in the GUI to the pool (Local Traffic/Pools), clicking "Members" and use the checkbox & Enable /Disable buttons to change status as required.
HTH
/deb - Gary_T_31565
Nimbostratus
Thanks that did the trick.
Need to reg to get to manuals! I am trialing demo kit. Hopefully I will be allowed a login. - Deb_Allen_18Historic F5 AccountGreat!
Yes, you should be able to get access to AskF5 content area before you make a purchase. (To get access to the download area and Support portal, however, you'll need to have a valid Support contract.)
/deb
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