liveBook · Manning

Node name

As explained in Elixir in Action, Third Edition

A node name is an identifier consisting of a name prefix and host name that identifies a BEAM instance for distributed connections.

A node name identifies a BEAM instance for distributed connections. It combines a prefix with a host: short names use a host name, while long names use a fully qualified host name or IP address. BEAM represents the name internally as an atom. section 12.1.1 section 12.3.1

$ iex --sname node1@localhost    #1
iex(node1@localhost)1>           #2

Start an IEx process with a short node name and observe the name shown in the prompt. section 12.1.1

Use node names with these operational constraints:

  • Connect nodes with Node.connect/1, which establishes a TCP connection between BEAM instances. section 12.1.1
  • Resolve the host portion to the machine’s IP address before connecting across hosts. section 12.3.1
  • Use the same naming type on both ends; long-named and short-named nodes cannot connect. section 12.3.1

Connecting named nodes

Start node1 and node2 with compatible names, call Node.connect(:node1@localhost), and inspect the resulting connection with Node.list(). A third connected node can join the existing cluster through one member. section 12.1.1

How Elixir in Action, Third Edition covers it

How deep it goes
Explains short and long formats, host resolution, name compatibility, and connection inspection, while deferring deeper network details.
Examples
Uses locally named node1, node2, and node3 instances with Node.connect/1 and Node.list/0.
What you can do after
Operate/configure BEAM nodes with short or long names, connect compatible nodes, and inspect their cluster membership.
How it connects
Connects node names to BEAM instances, TCP connections, distributed nodes, and clusters.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.