Forum Discussion

zak_thompson_86's avatar
zak_thompson_86
Icon for Nimbostratus rankNimbostratus
May 12, 2007

404 reselect help

so i'm trying to create somthing that will try every pool member for a response and once it goes through every active member and they are all 404's to default to a pool that will always have the content. this is needed to help serve content while the servers are syncing with each other.

when CLIENT_ACCEPTED {
  set retries 0
}
when HTTP_REQUEST {
  set request [HTTP::request]
}
when LB_SELECTED {
  if {$retries >= [active_members ddf-big-media01] } {
  
    LB::reselect pool ddf-backend
log local0.  "RETRY!"
  }  
}
when HTTP_RESPONSE {
if { [LB::server pool] equals "ddf-big-media01" } {
if { [LB::server pool] != "ddf-backend" } {
if { [HTTP::status] eq "404" } {
incr retries
log local0.  "REtrying pool"
HTTP::retry $request
}
}
}
}

I see in examples people say to use the LB::reselect syntax inside http_response however.. the appliance screams at me everytime i try and wont let me do it. there a way around this??
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    There was some confusion initially around the LB::reselect command and where it was applicable. It looks like you're implementing it in the intended fashion, as it's not usable under the response event.

     

     

    Is your rule working?

     

     

    Colin
  • no its not working, it would flip to the other pool right away it never tried the other nodes.