Forum Discussion
iRule to rebind session(s) from failed member server to another server in a pool based on http error code(s)
Has anyone created an iRule for this?
We have 2 servers in a pool using round robin. If a service on that server fails or returns an error code, we want the session(s) on that server to rebind to the available member server.
Any info is appreciated.
5 Replies
- Kevin_Stewart
Employee
Take a look at the first and second examples on the HTTP::retry wiki page:
https://devcentral.f5.com/wiki/iRules.HTTP__retry.ashx
These iRules capture an error response and replay the original request to the next pool member.
- Richard_77286
Nimbostratus
Thanks Kevin! I will check it out.
- Richard_77286
Nimbostratus
Kevin, I edited the HTTP_RESPONSE below and did not get an error when I applied it. Will the rule work if the status starts with either "5" or "4"? Or will I have to create two separate iRule for each status? Please advise. Thanks!
when HTTP_RESPONSE { 28 Check for server errors 29 if { [HTTP::status] starts_with "5" or "4" } {
- Kevin_Stewart
Employee
Your conditional would look something like this:
if { ( [HTTP::status] starts_with "4" ) or ( [HTTP::status] starts_with "5" ) } - Richard_77286
Nimbostratus
Thanks again Kevin!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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