Erlang/OTP Forums

Author Message

<  Erlang  ~  dynamic node creation?

saketkunwar
Posted: Fri May 01, 2009 4:19 pm Reply with quote
Joined: 11 Feb 2009 Posts: 6
hi
how would i create nodes dynamically at runtime.
instead of erl -sname ss ,i need to create nodes
from inside a function?

saket
View user's profile Send private message
seancribbs
Posted: Sun May 03, 2009 5:38 pm Reply with quote
User Joined: 03 May 2009 Posts: 17 Location: Chapel Hill, NC
You can dynamically create extra nodes using the slave application which exists in stdlib. The caveat is that the created nodes are not independent; that is, they are "linked" and will die when the node that creates them (the "master" node) goes down. The other option is to run a function on a node on the target machine that shells out to the "erl" command and immediately uses net_adm:ping/1 to contact the origin node. Not pretty, but it would work.
View user's profile Send private message
flodis
Posted: Tue Jun 16, 2009 5:40 pm Reply with quote
User Joined: 09 Jul 2008 Posts: 27
seancribbs wrote:
You can dynamically create extra nodes using the slave application which exists in stdlib. The caveat is that the created nodes are not independent; that is, they are "linked" and will die when the node that creates them (the "master" node) goes down. The other option is to run a function on a node on the target machine that shells out to the "erl" command and immediately uses net_adm:ping/1 to contact the origin node. Not pretty, but it would work.


When reading the documentation for the module slave the function start does not create a link between the nodes which should result in an independent "slave" node.

http://www.erlang.org/doc/man/slave.html
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum