Created
January 17, 2018 19:45
-
-
Save lorenzosinisi/b4933fa659aa1641fc9dc28e2039fb20 to your computer and use it in GitHub Desktop.
Elixir Test Cluster with Slave Nodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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