Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang nodes can't see each other

Tags:

erlang

I am new to Erlang and trying to set two nodes on my laptop.

In one terminal I type:

eli@elimayost: ~/erlang_apps> erl -sname foo -setcookie secret

And in the second terminal:

eli@elimayost: ~/erlang_apps> erl -sname bar -setcookie secret

If I use the first terminal to ping the second:

(foo@elimayost)1> net_adm:ping(bar@elimayost).

I get a pang response (same response if I use the second term to ping the first term).

Any idea why?

like image 361
elimayost Avatar asked Aug 14 '10 13:08

elimayost


3 Answers

Try starting the nodes like this:

eli@elimayost: ~/erlang_apps> erl -sname foo@elimayost -setcookie secret
eli@elimayost: ~/erlang_apps> erl -sname bar@elimayost -setcookie secret

Then ping them like you did before.

(foo@elimayost)1> net_adm:ping(bar@elimayost).

If that doesn't work for you, try pinging the node from itself.

like image 155
mjcopple Avatar answered Nov 15 '22 09:11

mjcopple


Did You check the syslog for errors?

Is apparmor active? Maybe turn it off and try again. One day I had very strange effects with apparmor running... but it is just a guess.

like image 29
Boris Mühmer Avatar answered Nov 15 '22 10:11

Boris Mühmer


it's a DNS problem, your host name 'elimayost' can't be found on the DNS. You can use 'localhost' as the host part, which like 'foo@localhost' and 'bar@localhost', it will always work.

like image 30
tianxiao Avatar answered Nov 15 '22 10:11

tianxiao