Skip to content

Instantly share code, notes, and snippets.

@lorenzosinisi
Created January 17, 2018 19:45
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 lorenzosinisi/b4933fa659aa1641fc9dc28e2039fb20 to your computer and use it in GitHub Desktop.
Save lorenzosinisi/b4933fa659aa1641fc9dc28e2039fb20 to your computer and use it in GitHub Desktop.
Elixir Test Cluster with Slave Nodes
:ok = :net_kernel.monitor_nodes(true)
_ = :os.cmd('epmd -daemon')
{ok, master} = Node.start(:master@localhost, :shortnames)
setup_slaves = fn(limit) ->
Enum.each(1..limit, fn(index) ->
:slave.start_link(:localhost, 'slave_#{index}')
end)
[node() | Node.list()]
end
setup_slaves.(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment