Roman_80473
Oct 17, 2011Nimbostratus
How 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 original pool before health monitor detects a failure.
So, inside my iRule, I have two events to capture server failure:
1. HTTP_RESPONSE checks if server's alive, but not responding to requests:
when HTTP_RESPONSE {
if { [HTTP::status] >= 500 } {
log local0.debug "Node [LB::server addr]:[LB::server port] is not responding, mark down, resend traffic ..."
LB::down
resend cached request
HTTP::retry $LB_request
}
}
2. LB_FAILED checks if server's completely dead:
when LB_FAILED {
log local0.debug "node [LB::server addr]:[LB::server port] is dead, mark down, resend traffic ..."
LB::down
resend cached request
HTTP::retry $LB_request
}
When I shutdown one of the members, the logic seems to be somewhat working (no blank page in the browser), but I see this in the logs:
01220001:3: TCL error: My_LB_Rule - Error: HTTP::retry may not be used in client-side event LB_FAILED (line 1) invoked from within "HTTP::retry $LB_request"
Is there a better way to accomplish this?
Any help is greatly appreciated
Roman