Forum Discussion
Roman_80473
Nimbostratus
Oct 17, 2011How to detect if pool member is down?
Hi folks,
I need to detect if pool member is down (crashed, hung, out of memory), take it out of the mix, write details to the log (node ip, name, port), and resend traffic back to the origi...
Michael_Yates
Nimbostratus
Oct 17, 2011Hi Roman,
No way to execute the HTTP::retry in the LB_FAILED Event. There are ways around it though.
You can set the HTTP::request in a variable in the HTTP_REQUEST Event and if the LB_FAILED Event occurs you can perform an LB::down, persist none, and LB::reselect to restart the process instead of dying. Setting a retry flag to know if you need to resend the previous request could then be processed in the HTTP_RESPONSE.
Something like this:
when HTTP_REQUEST {
log local0. "HTTP Request Event."
set httprequest [HTTP::request]
set retry 0
}
when LB_SELECTED {
log local0. "LB Selected Event [LB::server addr] : [LB::server port]"
}
when LB_FAILED {
log local0. "LB Failed Event [LB::server addr] : [LB::server port]"
LB::down
persist none
LB::reselect
set retry 1
}
when HTTP_RESPONSE {
log local0. "HTTP Response Event."
if { $retry == 1 } {
set retry 0
HTTP::retry $httprequest
}
}
Hope this helps.
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
