Search code examples
erlangelixirerlang-shell

Setting up Erlang node fails with "Can't set long node name! Please check your configuration"


$ 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 ...

Solution

  • Quoting José Valim:

    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).