Connect Nodes

An Erlang runtime system — node is identified by a unique name like an email address. Erlang nodes communicate with each other via these names.

Start Erlang epmd for registering node name first:

  1. epmd -daemon

Start n1@127.0.0.1 on a Hamler REPL console:

  1. hamler repl
  2. > import Control.Distributed.Node
  3. > import Control.Distributed.NetKernel
  4. > start :"n1@127.0.0.1"

Start n2@127.0.0.1 on another Hamler REPL console, then connect to the n1@127.0.0.1 node:

  1. hamler repl
  2. > import Control.Distributed.Node
  3. > import Control.Distributed.NetKernel
  4. > start :"n2@127.0.0.1"
  5. > connectNode :"n1@127.0.0.1"
  6. true
  7. > nodes
  8. ['n1@127.0.0.1']