Forum Discussion
James_Hamoline_
Nimbostratus
Sep 22, 2005ReSelect on 500 Response
Hey guys,
One of our architects talked to you at PDC. I have been trying to find some documentation on the LoadBalance Reselect command that Colin Walker talked about but I have been unsuccessful. Can you tell me where I can find some documentation on that?
What we are trying to accomplish is on a response http status code of say 500 we want to reselect a different server from the pool. We were told that this could not be done by F5 support but if there is a way to happen. Can I see some documentation on it.
Here is a link to the interview from PDC that makes some mention of what we are trying to accomplish, along with Colin Walkers comments.
http://devcentral.f5.com/Media/Videos/20050915-PDCVidThread1.wmv
Thanks for the help guys.
5 Replies
- Dave_Horsey_225
Nimbostratus
If you have cookie persistence enabled on your Virtual Server Profile, is there a way to use this irule and have it redirect the user to the other node in the pool?
Otherwise, if you have persistence enabled on your Virtual Server, the irule will just throw the request into a constant loop. - Brian_Gupta_115
Nimbostratus
I think you need to put a "when LB_FAILED" clause in your rule.
-Brian - unRuleY_95363Historic F5 AccountI'm not sure that would help, since the BigIP actually load-balanced to the server and the server gave the 500 response. The LB_FAILED event wouldn't have triggered in this case.
What you would want to do is overwrite the persistence cookie in the redirect. Unfortunately, you need to specify the Set-Cookie for the persistence cookie at the same time you do the redirect and the redirect command doesn't support this. However, you can use the HTTP::respond command. Something like this is what you would want to do:HTTP::respond 302 Location "http://www.youviphere.com" Set-Cookie2 "BIGipServermy_pool=; discard"
Replace the BIGipServermy_pool with whatever your persistence cookie name is. - Dave_Horsey_225
Nimbostratus
So then, my irule would look like this...
when HTTP_RESPONSE {
if {[HTTP::status] >= 500} {
HTTP::redirect "http://www.sitename.com"
}
{HTTP::respond 302 Location "http://www.sitename.com" Set-Cookie2 "sitename_pool=; discard"}
} - Dave_Horsey_225
Nimbostratus
Sorry, I mean the rule would like loike this...
when HTTP_RESPONSE {
if {[HTTP::status] >= 500} {
HTTP::respond 302 Location "http://www.sitename.com" Set-Cookie2 "poolname=; discard"}
}
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