Forum Discussion
David_Bradley_2
Nimbostratus
Mar 07, 2010Fault Tolerant long-lived TCP connections
Here's my story. I have several hundred long-lived client TCP connections to two Tibco RVD servers. (don't ask why we're not just using RVD in a multicast arrangement. Long story.) Clients can connect to either RVD server. It doesn't matter. The connections are made at the beginning of the day and not terminated until the evening. If one of the servers should go down, i'd like to reconnect the client connections to the other server, preferably without the client ever knowing it was disconnected. So, the thought was to insert an F5 between the client and servers. The F5 would act as the "server", so a TCP connection would exist between the client and F5, then the F5 would maintain a TCP connection between itself and the "real" RVD servers. OneConnect sounds similar (i.e. F5 acts as a TCP proxy) but seems to be used for pairing new client connections to existing backend connections. That part is cool. What I really need to do is detect backend server failure, through a healthcheck, irule, or whatever, and force the clients connected to that failed backend server to reconnect to the other server, seamlessly if possible. I could use some help figuring this out. Thanks.
Dave
- The_Bhattman
Nimbostratus
Hi David, - David_Bradley_2
Nimbostratus
Thanks. I did setup a typical VIP, with a typical pool, but this isn't a typical scenario, asfaik. I need to make the whole thing fault-tolerant. I've confirmed that client connections round-robin between the two rvd servers, as I knew they would. However, if I kill one of the rvd servers, the clients attached to that rvd immediately terminate as well. What I want to accomplish is to detect, or intercept, the SERVER-side failure before the CLIENT-side TCP connection is closed and somehow get the client connected on another SERVER-side connection. I'm not sure if this is possible. If not, i'd like to know what, if any, of my options are for high availability of long standing TCP sessions. I'm hoping there are options. - hoolio
Cirrostratus
Hi David,when CLIENT_ACCEPTED { Try to reselect a server set reselect 1 log local0. "[IP::client_addr]:[TCP::client_port]: New connection to [IP::local_addr]:[TCP::local_port]" } when LB_SELECTED { log local0. "[IP::client_addr]:[TCP::client_port]: Selected server info: [LB::server]" } when SERVER_CONNECTED { log local0. "[IP::client_addr]:[TCP::client_port]: Connected server info: [IP::server_addr]:[TCP::server_port]" } when SERVER_CLOSED { log local0. "[IP::client_addr]:[TCP::client_port]: Server connection closed" if {$reselect}{ log local0. "[IP::client_addr]:[TCP::client_port]: Trying reselect" set lb_cmd "LB::reselect" eval $lb_cmd } } when CLIENT_CLOSED { Do not try to reselect a server if the client closed the connection first set reselect 0 log local0. "[IP::client_addr]:[TCP::client_port]: Client connection closed" }
- David_Bradley_2
Nimbostratus
Thanks Aaron, - hoolio
Cirrostratus
You might get warm and fuzzy from an F5 salesperson. I'm just providing the best technical suggestions I can think of based on the requirements you've described. If you're considering returning hardware because a salesperson said the F5 kit could do something and it doesn't seem to be working, I'd suggest you get in touch with someone at F5 to get an official F5 response. I'm not an F5 employee and Devcentral isn't a place to get official F5 responses. I don't have any vested interest in you keeping the gear and won't come up with a better solution than what I've already suggested based on you possibly returning the hardware. - David_Bradley_2
Nimbostratus
Sure. I'm not coming down on you guys. You do great work and i've learned a ton from you in the past about irules and icontrol. I'm frustrated at the sales rep for saying it could be done and for myself for not being involved in the conversation in the first place. No, actually i'm mildly furious. I'll hack away at it. Maybe I can figure something out. If I do, i'll post here. Thanks for your help. - spark_86682Historic F5 AccountI definitely echo what hoolio said.
- hoolio
Cirrostratus
Thanks for the suggestions, Spark. I did a quick search on AskF5 for "message-based" and didn't see anything related. Do you have any more info on this? - David_Bradley_2
Nimbostratus
Thanks for the suggestions. I *think* (translate hope) that the RVD client isn't expecting anything other than a simple TCP ACK back from its request to the server. I need to look at tcpdump and figure this out today. Also, I found out where the packet length field in the RVD header is, so I should be able to TCP::collect until I've gotten a full packet. From there i think i'd need to select a server, open a connection to it (or let the LB pick one) and send the data there. I'm not sure how to do that yet, but i'm wondering if I can get clues from this: - David_Bradley_2
Nimbostratus
Actually I think I see what you're saying now. Since these are long-lived TCP connections, I can just simply let the load balancer pick a new target, since the load balancer is out of the loop at that point. So the RVD payload doesn't really matter. The LDAP example I was looking at doesn't apply because it's doing a new TCP connection, so it's able to change pools, etc. I'll work with the F5 guys and see what they say about possible TCP header logic being added to irules. Thanks very much.
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