Reputation: 8283
$ erl -name lofa
{error_logger,{{2008,6,18},{21,43,13}},"Can't set long node name!
\nPlease check your configuration\n",[]}
# ... several stacktrace lines follow ...
Upvotes: 3
Views: 5760
Reputation: 330
TL;DR Use erl -sname lofa
instead of erl -name lofa
.
Explanation:
--name
expects a fully qualified name, i.e., <username>@<host>
.--sname
accepts a short name, i.e., just the username, inferring the host from hostname -f
Therefore,
iex --sname joe
erl -sname joe
is equivalent to the following
iex --name joe@$(hostname -f)
erl -name joe@$(hostname -f)
I tested the above from Elixir 1.7.4 & Erlang/OTP 22.3.4.20 up to 1.12.1 & Erlang/OTP 24.0.2 (the latest as of this answer).
References:
Upvotes: 4
Reputation: 8283
This is likely happening because
hostname -f
is not returning a value, i.e. your machine doesn't know how it should be named in the network. You can use--sname
, give the fullname, like--name foo@IP_ADDRESS
or something that makes sense between machines (so they can find each other).
Another solution is to set the hostname directly (sudo hostname <FQDN>
), or update the hosts file (e.g., /etc/hosts
in Linux).
Upvotes: 3