: net_adm:ping not working -- still not answered

Raimo Niskanen <>
Fri Sep 1 09:42:44 CEST 2006


Well, it should work.

Try the following diagnosis:

$ erl -sname a
$ erl -sname b

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


And if that does not work as above try:

$ erl -sname 
$ erl -sname 

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


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  ** 
when net_adm:ping() fails.



On Thu, Aug 31, 2006 at 09:29:48AM -0700, erlang wrote:
> > 
> > Sorry, this is indeed a typo in my email. Should be:
> > ()1> net_adm:ping('').
> > 
> > > 
> > > 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
> > > 
> > > > ()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
> > > > 
> > > > ()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