A tricky "Can I create a virtual IP grabbing Erlang Solution Or Is There an Easier Way

Klacke <>
Fri Dec 6 10:23:54 CET 2002


On Fri, Dec 06, 2002 at 09:31:18AM +0200, DANIESC SCHUTTE wrote:
> Morning all,
> 
> this morning I'm asking, a hopefully trivial question, about making a system more robust, and the more I see from Erlang, the more I am impressed.
> 
> I have the following scenario, I have EXTERNAL clients, connecting to a specific IP and Port and an Erlang Server managing the connections and requests.  Unfortuanately the External clients are stupid and can NOT change the IP they connect to when that box fails.
> 
> Is there a way of creating a "virtual ip address" to which external clients can connect, but which is handled and failed over between / among erlang nodes as there are multiple nodes available for processing? 
> 
> Or is the only solution a server cluster with hardware failover?


This is the sort of software that we have written at Alteon
for years now. There are no libraries in the erlang distro
to do this. You have to write it yourself.

One way to do it is:

1. Decide which node should have the IP.

2. Bring up virtual interface on that machine. (This is even 
   doable on win32, I did that a couple of years ago)

3. Start to listen for incoming tcp conns.

4. All nodes monitor each other. If they see that a node
   goes down, they must migrate the virt IPs that were previously
   on that node to themselves.

5. Once they have decided which node has which IP, the surviving
   nodes bring up virt interfaces and 
   do gratiotous (uhhh is that hard to spell or what) ARP on the IPs
   thereby moving the IP address from one dead machine to themselves.


This was done in the eddie project initially and I think you can
find at least some useable erlang code in that project that you can
snitch. Search google for eddie.



/klacke


-- 
Claes Wikstrom                        -- Caps lock is nowhere and
Alteon WebSystems                     -- everything is under control          
http://www.bluetail.com/~klacke      
cellphone: +46 70 2097763



More information about the erlang-questions mailing list