Forum Discussion
Krzysztof_Kozlo
Nimbostratus
May 02, 2007TCP redirect on LB_FAILED for in-band health check.
We have several situations in the enterprise where it is desirable to have a large number of farmed services run on a single pool of servers. New instances come online all the time, and only TCP health checks are required, but we don't want to configure an explicit pool, complete with monitor, each time someone starts up a listening process on a port.
We want to use a Layer 3 virtual server like this:
virtual moo {
destination 1.1.1.1:any
ip protocol tcp
pool moo
rule moo
}
pool moo {
member server1:any
}
pool foo {
member server2:any
}
What I'd like to be able to do is create a rule like this:
rule moo {
when LB_FAILED {
log "connection to [IP::server_addr] failed"
use pool foo
}
This would enable an on-the-fly TCP health check, essentially -- if the host is not responding on that port, try the other server. I don't see any reason this shouldn't be possible, but it doesn't work. I simply get disconnected when LB_FAILED. LB_FAILED is working, based on LTM output:
May 2 16:20:05 tmm tmm[1049]: 01220002:6: Rule moo : connection failed: 144.203.239.34
Also, it is not the case that LB_FAILED is processed after the client flow is closed. This rule works:
rule moo {
when LB_FAILED {
log "connection failed: [IP::server_addr]"
TCP::respond "sorry, dude, your server's down."
}
}
Observe:
zuul /u/ineteng/Data/f5 239$ telnet 10.165.29.17 23
Trying 10.165.29.17...
Connected to 10.165.29.17.
Escape character is '^]'.
sorry, dude, your server's down.Connection closed by foreign host.
zuul /u/ineteng/Data/f5 240$
Anyone have any ideas? This sure would be useful!
- Krzysztof_Kozlo
Nimbostratus
If no one has any experience or tips to offer on getting this working, can I ask if anyone at least sees this functionality as useful? Folks I've talked to here are pretty excited about the possibilities. - JRahm
Admin
Actually, Cisco LocalDirector (yes, that dinosaur) did this passive monitoring. It removed members from the pool after X number of failed tcp handshake attempts, then occasionally would throw bones back at it in attempts to bring it back "online" - Krzysztof_Kozlo
Nimbostratus
This is great! The documentation for 9.2.3 does not list "LB::reselect" as a method. (F5, send your doc writers back to the salt mines.) Initial results seem positive. I'll doc my full iRule when and if I get it working. - Krzysztof_Kozlo
Nimbostratus
According to the iRules Wiki (which I just discovered, thank you very much): - bl0ndie_127134Historic F5 AccountOk, I would like to kill this urban legend that Passive monitoring is limited to HTTP right now. 'LB::status' can be used from most reasonable events such as LB_FAILED HTTP_RESPONSE etc.
- Casey_Lucas_167
Nimbostratus
- bl0ndie_127134Historic F5 AccountYou are right, the status value is determined by the monitors so there is a bit of a lag depending on how you have the monitor setup.
- Krzysztof_Kozlo
Nimbostratus
BTW it would be useful to have the number of retries for LB::reselect be configurable. - JRahm
Admin
as well as removing from consideration any failed pool member previously selected during the current iteration of the reselection process. - Krzysztof_Kozlo
Nimbostratus
The rule above seemed to work when I tested it back in May, but now that I am trying it again it seems to get into an infinite loop of SYN/RESETs with the downed back-end every other time with lb::reselect reselecting the same (broken) server.
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