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

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


OK. I think I discovered the relevant caveat in the documentation:

"A node with a long node name cannot communicate with a node with a
short node name."

The node I'd like to connect to is using short names, but I'm having
to use a long name on the host (because of the differing domain
suffix).

*But* when I set the remote node to use long name mode, I *still* can't connect.

*However*, I found various places (e.g. [1]) which state that you
can't mix short and long names at all. This is obviously incorrect,
'cos I successfully connected from the short-name node to the
long-name node. Also, in that documentation, "communicate with"
implies (to me, at least) both directions. Did something accidentally
get "fixed", allowing short-to-long, but not long-to-short?

[1] https://stackoverflow.com/questions/26474591/connecting-erlang-nodes-when-an-internal-and-external-ip-address-are-at-play

On Wed, 5 Jun 2019 at 14:22, Roger Lipscombe <roger@REDACTED> wrote:
>
> On Wed, 5 Jun 2019 at 13:28, Juan Jose Comellas <juanjo@REDACTED> wrote:
> > This is most probably not a problem with Erlang but missing configuration settings in Docker. Have you published or exposed the ports outside of the Docker container [1]? Are you starting the containers individually or are you using docker-compose or something like that?
>
> Using docker-compose. The ports are not forwarded to localhost,
> because I've got a whole bunch of Erlang nodes in docker containers,
> and that approach won't scale.
>
> > I would recommend reading up on the different options that Docker provides for networking.
>
> Docker networking is fine; using the IP address of the container (or
> DNS name; I've got dnsmasq forwarding a domain suffix), I can telnet
> to the epmd port and to the distribution port (and to various HTTP
> ports, etc.). It's Erlang's node discovery/connection process that's
> not working. erl_epmd:names works fine if I run it on the host, and
> specify one of the containers.
>
> So I'm guessing that Erlang doesn't like the lashed-up DNS resolution,
> or something, but it won't connect using the IP address in the node
> name either.
>
> As I pointed out, if I connect from a node in the container to a node
> on the host, it works fine, which also implies that it's not a
> networking problem, per se. But rather it's a discovery/resolution
> problem. But I don't understand how that actually works in OTP, so...
>
> > If you send some sample Dockerfile or docker-compose.yml file with the arguments you're using to start the nodes, we could provide better feedback.
>
> The nodes are using relx-generated startup scripts, identical to the
> ones we're using in production (where they're not running in
> containers). We start them using s6-overlay.



More information about the erlang-questions mailing list