liveBook · Manning

Short name

As explained in Elixir in Action, Third Edition

A short node name identifies a distributed Erlang node using a host name without a fully qualified domain name.

A short node name identifies a BEAM instance with the form prefix@host, using the host name without a fully qualified domain name. Start it with --sname; the prefix distinguishes nodes on one machine, while the host identifies the machine. section 12.3.1 section 12.1.1

Use short names with these operational constraints:

  • The host part must resolve to the machine’s IP address before nodes can connect. section 12.3.1
  • A short-named node can connect only to another short-named node; long and short names cannot interoperate. section 12.3.1
  • Inspect the current name with Kernel.node/0 and connected peers with Node.list/0. section 12.1.1
$ iex --sname node1@localhost    #1
iex(node1@localhost)1>           #2

Start an IEx node with --sname and observe the resulting short name. section 12.1.1

How Elixir in Action, Third Edition covers it

How deep it goes
Explains naming, resolution, compatibility, inspection, and release configuration, but stops short of distribution protocol internals.
Examples
Uses --sname node1@localhost, Node.connect, Node.list, and RELEASE_NODE assignments for release commands.
What it assumes
Assumes familiarity with IEx and BEAM nodes while teaching node naming, host resolution, and cluster connections progressively.
What you can do after
Operate/configure short-named IEx nodes, connect them into clusters, and launch releases with RELEASE_NODE.
How it connects
Connects node names with BEAM nodes, distributed clusters, host resolution, long node names, and release configuration.

Also explained in

Compare how 2 books explain short name →

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.