Skip to content

Instantly share code, notes, and snippets.

@lorenzosinisi
Created January 17, 2018 19:45
Show Gist options
  • Select an option

  • Save lorenzosinisi/b4933fa659aa1641fc9dc28e2039fb20 to your computer and use it in GitHub Desktop.

Select an option

Save lorenzosinisi/b4933fa659aa1641fc9dc28e2039fb20 to your computer and use it in GitHub Desktop.

Revisions

  1. lorenzosinisi created this gist Jan 17, 2018.
    12 changes: 12 additions & 0 deletions slaves.ex
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    :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)