6

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?

elimayost
  • 123
  • 1
  • 4
  • 1
    Can you execute `erl_epmd:names()` and post the output? – Manoj Govindan Aug 14 '10 at 13:31
  • I merged your unregistered account into your registered one. You can now leave comments under answers, edit your question, etc. I converted your previous answer to a comment under @mjcopple's answer. – Tim Post Sep 05 '11 at 04:05

3 Answers3

4

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.

mjcopple
  • 1,580
  • 2
  • 13
  • 19
  • Also look at: http://stackoverflow.com/questions/2136918/getting-two-erl-shells-to-talk – mjcopple Aug 16 '10 at 00:47
  • mjcopple: Thanks for your answer. I started the nodes as you suggested. Still they can not see each other. I can ping both nodes from within the node but not from the other node. I am trying it on OpenSUSE 11.3. When trying on Ubuntu 10.04 it works fine. Both machines are virtual machines running under Virtual Box. – elimayost Aug 16 '10 at 09:45
1

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.

tianxiao
  • 13
  • 3
1

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.

Boris Mühmer
  • 476
  • 3
  • 10