Distributed Erlang: connect nodes and message across machines

9 steps · about 4 h 10 min · Intermediate

  1. Concurrent Programming — Erlang System Documentation (doc, erlang.org, 30 min)

    Start with processes and message passing on a single node, including the Distributed Programming section that sends to {Name, Node}.

  2. Distributed Erlang — Erlang System Documentation v29.1.3 (doc, erlang.org, 25 min)

    The official overview of nodes, short and long names, epmd, cookies and net_kernel gives you the vocabulary for everything that follows.

  3. How Does Erlang Pass Messages Across nodes (video, YouTube, 15 min)

    A visual explanation of how a message gets from a process on one node to a process on another.

  4. Distribunomicon (article, Learn You Some Erlang (Fred Hebert), 1 h)

    A hands-on walkthrough of two nodes, connect_node, cookies, remote shells and hidden nodes, plus the fallacies of distributed computing.

  5. A... B... C... Distributed Erlang (blog, ayikoyo.com, 20 min)

    A second worked example that goes beyond localhost, with long names, cookies and the port range for nodes on different hosts.

  6. OTP Distribution · Elixir School (tutorial, Elixir School, 15 min)

    Shows remote spawning and the group leader, which explains why output appears on the calling node; it is in Elixir but uses the same BEAM features.

  7. Distribution Protocol — OTP 29.1.2 (erts 17.1.1) (doc, erlang.org, 25 min)

    Once the basics work, see what happens underneath: epmd registration, port lookup and the handshake.

  8. Distribution Protocol and EPMD (guide, Erlang Ecosystem Foundation security working group, 20 min)

    Cookies are not strong security, so learn to bind interfaces and restrict epmd before putting nodes on a real network.

  9. Distributed OTP Applications (article, Learn You Some Erlang (Fred Hebert), 40 min)

    Last step: take over and fail over between nodes, with a warning about netsplits.