Forum Discussion
Ryan_Crowley_18
Nimbostratus
May 18, 2009How to cause a failover to another server when a error string is present in a response?
Ok,
totally new to writing iRules here, so bear with me through a couple stupid questions.
My situation is that i am using ColdFusion (and JRun) as an application server...
dennypayne
Employee
May 19, 2009Or use reverse monitors with "JRun closed connection" and "Server error" as receive strings.
Otherwise you're correct that you'd have to look in HTTP::payload, the main issue with that is you're going to have to do an HTTP::collect on every response, which could be fairly resource-intensive and/or add a lot of latency. Testing would reveal the extent of that. If you could limit the collect to something other than the full payload that would help (ie, if you know how many bytes along in the content either of those error messages would show up).
Something like this might work, I haven't tested:
when HTTP_RESPONSE {
HTTP::collect [HTTP::header Content-Length]
or use number of bytes rather than content-length
}
when HTTP_RESPONSE_DATA {
if { (string tolower [HTTP::payload] contains "jrun closed connection") || (string tolower [HTTP::payload] contains "server error") } {
LB::down
}
when LB_FAILED {
LB::reselect
}
The problem even with that is even if you mark the node down in a rule, the next successful health monitor will bring it back up, so you still need to have some sort of health monitor that's looking for this.
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
