[erlang-questions] : erl -name doesn't work

Raimo Niskanen <>
Fri Feb 23 09:38:02 CET 2007


On Thu, Feb 22, 2007 at 05:29:59PM -0800, David Tucker wrote:
> Aha.  So 
> http://www.erlang.org/doc/doc-5.5.3/erts-5.5.3/doc/html/erl.htmlsays
> that for -name, you have to specify
> , which contradicts the example at
> http://www.erlang.org/doc/doc-5.5.3/doc/reference_manual/distributed.html#11.2.
> (Could someone correct the docs?)
> 
> Next question: in the absence of an fqdn for my computer, what should I
> specify for the Host part?  An IP address doesn't seem to work.
> 
> Thanks.
> 

Try the hostname 'localhost'. It works most of the times, even on windows.
	erl -sname 

The catch is that you can not reach such a node from another machine,
since the name 'localhost' has to resolve to the first machine from
the other machine.

To make it work, the part after the @ must be a hostname that resolves
to the machine the node is running on. And an IP address will unfortunately
not do. Use 'ping' from a DOS prompt to see if the hostname works.

The hostname part is used to contact the Erlang Port Mapper Daemon
on the target machine. That daemon (epmd) is autostarted on every
machine that starts an Erlang node in distributed mode (-sname or -name).

The nodename part (before the @) is used to ask epmd for a port that
the target Erlang node is listening to. That port is used to contact
the node and now comes a few final quirks: 

* If the complete name of the target node as used on the source node
does not exactly match the name of the target node as used on 
the target node; the connection will be rejected.

* If both nodes are not using the same connection cookie, the connection
will fail. This often works automatically since the default cookie
is autogenerated and put as the file .erlang.cookie in the home
directory of the user starting the Erlang node. So if both nodes
see the same home directory and are started by the same user; 
it works. Otherwise use the argument -setcookie "any secret string"
for both nodes.



> Dave
> 
> 
> On 2/22/07, Ludovic Coquelle <> wrote:
> >
> >Isn't it a problem with localname/fullname?
> >On my ubuntu installation, "erl -name foo" exits with a lot of crash error
> >reports.
> >But "erl -sname foo" work very well; as well as "erl -name
> >"
> >Hope this can help (see doc erts/erl for details on options).
> >
> >On 2/22/07, David Tucker <> wrote:
> >>
> >> Hi,
> >>
> >> I'm running the latest release of Erlang (R11B-3) on Windows XP.  When I
> >> run:
> >>
> >> C:\WINDOWS\system32>"c:\Program Files\erl5.5.3\bin\erl.exe" -name foo
> >>
> >> it exits immediately -- no shell, no error message of any sort.
> >> However, the following brings up a shell as expected:
> >>
> >> C:\WINDOWS\system32>"c:\Program Files\erl5.5.3\bin\erl.exe" -sname foo
> >> Eshell V5.5.3  (abort with ^G)
> >> ()1>
> >>
> >> Any idea what I'm doing wrong?  Thanks.
> >>
> >> Dave
> >>
> >> **
> >> _______________________________________________
> >> erlang-questions mailing list
> >> 
> >> http://www.erlang.org/mailman/listinfo/erlang-questions
> >>
> >>
> >

> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions


-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list