Skip to content

Instantly share code, notes, and snippets.

@jashmenn
Created January 27, 2009 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashmenn/53129 to your computer and use it in GitHub Desktop.
Save jashmenn/53129 to your computer and use it in GitHub Desktop.
# An easy way to test run a cluster of erlang nodes. An idea for skelerl, does
# not currently function.
# The following code would evaluate to running:
#
# erl -pa ./ebin -kernel inet_dist_listen_min 7000 inet_dist_listen_max 7050 \
# -setcookie chordjerl -s chordjerl_srv start -s chordjerl_srv create_ring \
# -sname node0
#
# erl -pa ./ebin -kernel inet_dist_listen_min 7000 inet_dist_listen_max 7050 \
# -setcookie chordjerl -s chordjerl_srv start -s chordjerl_srv state \
# -chordjerl_srv join node0 -s init stop -sname node1
#
# I would probably add an 'iterm' directive to run nodes in consistent tabs.
## Suggestions?
erlang_cluster do
options do
path "ebin"
kernel "inet_dist_listen_min 7000 inet_dist_listen_max 7050"
cookie "chordjerl"
end
with_node(:node0, :stop => false) do
start
chordjerl_srv::create_ring
end
with_node(:node1) do
namespace :chordjerl_srv do
start
state
join(:node0)
# will 'init stop' here
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment