Erlang Advocacy and kill -kill

Klas Johansson klas.johansson@REDACTED
Tue Jan 20 15:59:27 CET 2004


Hi Gordon,

I noticed that the aardvark node is referred to as aardvark@REDACTED
in one case and aardvark@REDACTED in another (i.e. an extra `a' in
one of the machine names).

Regards,
Klas


"Gordon Guthrie, BTP, BT, SE" <gordon.guthrie@REDACTED> writes:

> Folks
> 
> I am trying to do a spot of Erlang advocacy. I want to show how you can
> start a distributed app across two machines, kill one and then have the
> other take over.
> 
> However, I want to do it on a laptop as I have to go visiting with it.
> 
> I have written a simple app with a top supervisor, a single supervisor under
> it which can starts a worker.
> 
> I deploy this app to two nodes, 'aardvark' and 'badger' which I start with
> batch files (boot scripts will come later) which reference .config files.
> These 4 files are shown below:
> 
> *********start of start_aardvark ******************
> 
> #! /bin/bash
> cd /opt/erlang_apps/swarm
> erl -s toolbar -sname aardvark -config
> /opt/erlang_apps/swarm/aardvark.config -heart
> 
> *********end of start_aardvark ********************
> 
> *********start of start_badger*********************
> 
> #! /bin/bash
> cd /opt/erlang_apps/swarm
> erl -s toolbar -sname badger -config /opt/erlang_apps/swarm/badger.config
> -heart
> 
> *********end of start_badger***********************
> 
> *********start of aardvark.config******************
> 
> [{kernel,
>   [{distributed, [{swarm, 5000, [aardvark@REDACTED,
> {badger@REDACTED}]}]},
>    {sync_nodes_manadatory, [badger@REDACTED]},
>    {sync_nodes_timeout, 5000}
>   ]
>  }
> ].
> 
> *********end of aardvark.config********************
> 
> *********start of badger.config********************
> 
> [{kernel,
>   [{distributed, [{swarm, 5000, [aardvark@REDACTED,
> {badger@REDACTED}]}]},
>    {sync_nodes_manadatory, [aardvark@REDACTED]},
>    {sync_nodes_timeout, 5000}
>   ]
>  }
> ].
> 
> *********end of badger.config**********************
> 
> So far so good, the two nodes start up, I do application:start(swarm) on
> both of them, the application starts on one of them, but not the other.
> 
> In order to demonstrate the magic of Erlang I now want to kill the node that
> has the app on it and watch the app migrate over, and the node to restart -
> kill is our friend. However running 'kill <erlang node pid>' or 'kill -kill
> <erlang node pid>' will kill the node but it doesn't failover. I suspect
> that this is because Erlang knows I am cheating, and is behaving gracefully.
> 
> Have tried 'man murder' but no joy ;-> How can I really slaughter the node
> to make sure it fails over (or having I got something wrong in my configs?).
> 
> TIA
> 
> Gordon
> 
> ______________________________________________________________________
> Scottish Enterprise Network
> http://www.scottish-enterprise.com
> 
> Address & Contact Numbers
> 
> 150 Broomielaw
> 5 Atlantic Quay
> Glasgow
> G2 8LU.
> Tel:  +44 (0)141 248 2700.
> Fax:  +44 (0)141 221 3217
> 
> message is sent in confidence for the addressee only.
> It may contain legally privileged information. The contents are not to
> be disclosed to anyone other than the addressee. Unauthorised recipients
> are requested to preserve this confidentiality and to advise the sender
> immediately of any error in transmission.



More information about the erlang-questions mailing list