Forum Discussion
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
- Michael_YatesNimbostratusHi Roman,
- Roman_80473NimbostratusHi Michael,
- Michael_YatesNimbostratusHi Roman,
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 } }
- Roman_80473NimbostratusHi Michael,
- Gopal_Prakriya_NimbostratusI would like to page myself by sending a text message on LB_FAILED, appreciate any help on how to do that.
- What_Lies_Bene1CirrostratusGopal, please start a new topic rather than posting in unrelated existing (and unresolved) ones.
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