[erlang-questions] clarify: gen_udp Set outbound ip address

Christian G. Warden cwarden@REDACTED
Wed Nov 14 19:36:42 CET 2007


On Wed, Nov 14, 2007 at 06:46:14PM +0100, Decker, Nils wrote:
> Hello
> 
> > Von: erlang-questions-bounces@REDACTED 
> > [mailto:erlang-questions-bounces@REDACTED] Im Auftrag von mog
> > [...]
> > reliability.  So I really need a way to have a cloud of computers
> > running under one ip.  I imagine i could use a mirrored 
> > switch and then
> > forge the udp packets, but I was trying to do this without any custom
> > hardware.  Has anyone developed a system like this? and If not how did
> > you reach such high levels of reliability.
> 
> I did some research into this. There is a CLUSTERIP target in the
> linux iptables firewall that gives all nodes in a cluster the same MAC
> address and accepts connections based on a hash of ip/srcport/dstport.
> You can change dynamically which node serves which hash numbers. So if
> a node leaves the cluster some other node can pick up its hash value.
> This will invalidate all open tcp sessions but the cluster is still
> reachable without delay. You need to have all nodes on a single hub.
> (you could configure a redundant switch to act as a hub...)
> 
> Because i dont have control over the switch, i implemented something
> else. I have one distributed application that owns the cluster ip
> address. It will bring up/down the ip on its node. The drawback is
> that i have to wait for the router refresh its arp cache.

You can usually send a gratuitous arp to update the router's arp cache:
`arping -A -c 10 <cluster ip>`

You can get high availability and load-balancing on the cheap using
round-robin dns where each IP in the pool is active on a single machine,
but can be brought up automatically on a failover machine using
something like heartbeat or ucarp.

Christian



More information about the erlang-questions mailing list