[erlang-questions] Can't connect to Erlang node in docker

Roger Lipscombe roger@REDACTED
Wed Jun 5 16:43:35 CEST 2019


On Wed, 5 Jun 2019 at 15:06, Magnus Henoch <magnus@REDACTED> wrote:
> Both nodes must have the same cookie

They are.

> The nodes must be using either both -name or both -sname; no mixing long and short names

Except that you can connect from a short name to a long name; see my later post.

> The local node must use the exact same node name (including host name) that the remote node thinks it has

Does "host name" include the domain name suffix for this purpose?

> The local node must be able to resolve the host name part of the node name of the remote node

It can.

> So if the remote node is running with node name foo@REDACTED, you should be able to connect to it with erl -sname whatever -remsh foo@REDACTED

This works fine provided I put 'mycontainer' in /etc/hosts; what
doesn't seem to work is 'mycontainer.docker_network', where I've got
local dnsmasq forwarding '.docker_network' to the docker resolver.

> If mycontainer doesn't resolve to the correct IP address, you can use an inet configuration file: http://erlang.org/doc/apps/erts/inet_cfg.html
> For example, to hard-code an IP address for a host name and force the Erlang node to use this file instead of native name resolution:

That's not a particularly scalable solution, given that docker
hostnames and IP addresses change all the time. I guess I can script
it, though.

> Hope this helps,
> Magnus

Thanks,
Roger.



More information about the erlang-questions mailing list