[erlang-questions] how: Simple distributed Erlang in docker containers

Bengt Kleberg bengt.kleberg@REDACTED
Mon May 16 14:58:45 CEST 2016


Greetings,

What is needed to get two Erlang nodes talking if they are in Docker 
containers (on the same machine)?
  net_kernel:connect/1 fails.


I have started 2 Docker containers (kalle and gustav) and it is possible 
to do
  ping kalle
PING kalle.asd.se (172.17.0.4) 56(84) bytes of data.
64 bytes from kalle.asd.se (172.17.0.4): icmp_seq=1 ttl=64 time=0.137 ms

and
  ping gustav
PING gustav.asd.se (172.17.0.5) 56(84) bytes of data.
64 bytes from gustav.asd.se (172.17.0.5): icmp_seq=1 ttl=64 time=0.147 ms


Starting Erlang like this:
  erl -sname n -setcookie asd
Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:4:4] [async-threads:10] 
[kernel-poll:false]

Eshell V6.3  (abort with ^G)
(n@REDACTED)1>  net_kernel:connect('n@REDACTED').
false

and, from the other side:
  erl -sname n -setcookie asd
Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:4:4] [async-threads:10] 
[kernel-poll:false]

Eshell V6.3  (abort with ^G)
(n@REDACTED)1> net_kernel:connect('n@REDACTED').
false


bengt
  (*) I manually added them to their respective /etc/hosts. If there is 
a way to do it automatically I would like to know.



More information about the erlang-questions mailing list