views:

105

answers:

2

This is what I am trying to achieve but I'm not familiar with the subject well enough, so please bear with me :)

I've got a server to which some devices get connected and periodically upload some data. Communication is done over plain TCP sockets using a proprietary protocol we designed for speed and efficiency. Every such connection is basically a session which is open as long as device stays connected. What I need now is (1) design failover mechanism and (2) scale up. There would be another server node which would pick up once first instance fails. I've been looking at Terracotta to do a lightweight cluster. But what I don't understand is HOW would devices know to run for the second node?? I could probably "teach" them to try several access points.. but this would really be a pain as some of them are out of my control. Ideally, I want some magic in a middle which would re-redirect connection automatically to any available node in a cluster.

Now. First thing I want to know is how such tools called in a world. Second - I need simple off-the-shelf solution, preferably free or open source with friendly commercial license. We don't use any heavy weight containers, server instance is a bunch of POJO's wired up with Spring, everything runs in one JVM. Ideally, I would like to place such magic box on one of the nodes, expose single IP/port for all devices and do some config. setup. Is this possible or am I dreaming for cheap solution on a tough problem?

+1  A: 

You are looking for Load balancing, I think. You can pick from software or hardware solution. In both cases idea is the same: load balancer will monitor the state of both nodes and route connections to one which is alive.

Try this link, as an example.

Georgy Bolyuba
Darn.. you beat me for seconds.
Paulo Santos
So, it's load balancing.. Thanks. I looked around and what I see most are Linux specific solutions. What I'm after is platform neutral software solution which installs on most computers. Can you suggest any? Or perhaps it's always hardware dependent?
Dima
I do not really get why do you need "solution which installs on most computers" :). I mean, you know exactly what kind of server you are running. Windows Server can do this out of box, I think. For Linux, I gave you one link and you can find a lot more using Google. If you want more control "for free", write your own implementation. Simple app, which reads confing, opens connection to all of your real app servers, monitors them and uses http://en.wikipedia.org/wiki/Round-robin_scheduling to route the request. But I would rather installed Linux one.
Georgy Bolyuba
For truly transparent operation, you'll likely want a load balancing solution that supports IP takeover - so the devices only ever need to connect to one IP address.
Taylor Gautier
If all apps will connect to the service using IP address of load balancer, why would author need IP takeover? Apps will not know about how many servers there are, it is just one IP for them.
Georgy Bolyuba
Georgy, thanks, I've got the info I needed. "Solution which installs on most computers" question raised because I didn't know that there are hardware as well as software boxes doing that job. Described system needs to scale up and do failover, and now I understand that we can forget about load balansers as part of the system, because end user can use and install whatever balancers they like if they want to scale up our application. For us (vendors of the system) it's just another system requirement. Thanks for the help!
Dima
+1  A: 

First I think this question should be posted at serverfault.com, but once you asked here, I believe what you're looking is some sort of load balance appliance or box.

Paulo Santos
Thanks for the link, this is very useful.
Dima