Erlang/OTP Forums

Author Message

<  Open Telecom Platform (OTP)  ~  spawning nodes programatically

jacobvorreuter
Posted: Fri Aug 01, 2008 6:50 am Reply with quote
Joined: 01 Aug 2008 Posts: 1 Location: San Francisco
Is it possible to create nodes (ie: [node1@localhost, node2@localhost]) programmatically?

If you had a fragmented Mnesia database running across 10 nodes for example, are you forced to start 10 erl consoles from the shell?

Is there a way to manage (start and stop) nodes from an erlang process? Something like the following?

spawn_node(Name, Host) -> {ok, Node} | {error, Reason}

then you could do:

{ok, _Node} = spawn_node(node1, net_adm:localhost()),
pong = net_adm:ping(node1@localhost),
rpc:call(node1@localhost, mnesia, start, []).

Thanks,
Jake
View user's profile Send private message Visit poster's website AIM Address
michal
Posted: Fri Aug 01, 2008 7:07 am Reply with quote
User Joined: 20 Jul 2006 Posts: 44 Location: London
Check here: http://www.erlang.org/doc/man/slave.html

Michal

_________________
http://www.erlang-consulting.com
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 can attach files in this forum
You can download files in this forum