: net_adm:ping not working -- still not answered

Raimo Niskanen raimo+erlang-questions@REDACTED
Fri Sep 1 09:42:44 CEST 2006


Well, it should work.

Try the following diagnosis:

$ erl -sname a
$ erl -sname b

(a@REDACTED)> erl_epmd:names().
{ok,[{"a",43500},{"b",43505}]}
(a@REDACTED)> inet:gethostbyname("my-server").
{ok,{hostent,"my-server",[],inet,4,[{192,168,0,100}]}}
(a@REDACTED)> net_adm:ping('b@REDACTED').
pong
(a@REDACTED)> nodes().
['b@REDACTED']


And if that does not work as above try:

$ erl -sname a@REDACTED
$ erl -sname b@REDACTED

(a@REDACTED)> inet:gethostbyname("localhost").
{ok,{hostent,"localhost",[],inet,4,[{127,0,0,1}]}}
(a@REDACTED)> erl_epmd:names().
{ok,[{"b",43527},{"a",43530}]}
(a@REDACTED)> net_adm:ping('b@REDACTED').
pong
(a@REDACTED)> nodes().
['b@REDACTED']


I am suspecting your machine may have misconfigured network.

To make sure the cookie is the same, add the argument
-setcookie my-cookie4711
to the command line of both nodes, but if you have the wrong cookie,
the target node should print: 
=ERROR REPORT==== 1-Sep-2006::09:40:06 ===
** Connection attempt from disallowed node b@REDACTED ** 
when net_adm:ping(a@REDACTED) fails.



On Thu, Aug 31, 2006 at 09:29:48AM -0700, erlang wrote:
> > 
> > Sorry, this is indeed a typo in my email. Should be:
> > (b@REDACTED)1> net_adm:ping('a@REDACTED').
> > 
> > > 
> > > Hi, is the colon ":" just a typo in your email? It should be
> > > "@" as you can see from the node name in the Erlang shell prompt.
> > > 
> > > Best Regards
> > > Lennart
> > > 
> > > > (b@REDACTED)1> net_adm:ping('a:my-server').
> > > 
> > > > I can't get the ping-pong distributed example to work, so I tried simply
> > > > pinging another node. This doesn't work either.
> > > > 
> > > > os: windows server 2003, machine name is my-server.
> > > > EShell v5.5.1
> > > > 
> > > > command lines: erl -sname a
> > > >                             erl -sname b
> > > > 
> > > > (b@REDACTED)1> net_adm:ping('a:my-server').
> > > > 
> > > > always returns pang. The cookie file is being read, and the cookie is
> > > > the same in both nodes. What to try next?
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> 
> 

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list