Forum Discussion

Gary_T_31565's avatar
Gary_T_31565
Icon for Nimbostratus rankNimbostratus
Apr 23, 2007

HTTP::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"

 

}

 

}

 

}
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Hi 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

     

     

  •  

    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_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Great!

     

     

    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