novice question

Steve Elkins sgelkins@REDACTED
Tue Sep 5 11:01:09 CEST 2000


Raimo Niskanen wrote:
> 
> Hi.
> 
> epmd is automatically started if needed when the node is started.
> 
> Try this:
> 
> In window 1
>         erl -sname bank
> 
> In window 2
>         erl -sname sge
> when erlang has started
>         net_adm:ping('bank@REDACTED').
> You should get the response 'pong' from that, 'pang' means failure

Thanks, I should've said that I'd tried that, too.  pang is what I get.

>         net_adm:nodes().
> 
> net_adm:ping/1 is not at all the only way to establish a connection, in
> fact a connection is established whenever necessary. You rarely need to
> bother with epmd. For example, if the a process on the node bank@REDACTED
> registers a name with erlang:register(Name, Pid), when a process on node
> sge@REDACTED sends using {Name, Node} ! Message, the connection is
> automatically established.

And I should have made clear that the failure of this is what led me to
my experiments with epmd -d -d and names().

Pascal Brisset wrote:
> 
>  > (bank@REDACTED)1> net_adm:names().
>  > {error,nxdomain}
> 
> I have similar name resolutions problems on a system with dynamic IP
> (Linux, ADSL, DHCP). Use tcpdump to see which addresses Erlang is
> trying to resolve or contact.

Haven't tried this yet, but I certainly will, because...

> For a quick start, try "erl -sname bank@REDACTED".

...this gives me {error,nxdomain} too.

Thanks very much to both of you.


> Steve Elkins wrote:
> >
> > Hi,
> >
> > I've run into a few problems getting 2 nodes on the same machine
> > connected.  I hope someone on the list will tell me what I should
> > look at next.  Details follow.
> >
> > I've killed and restarted epmd with 2 -d flags...
> >
> > sge@REDACTED:16$ ./epmd -d -d
> > epmd: Mon Sep  4 13:42:59 2000: epmd running - daemon = 0
> > epmd: Mon Sep  4 13:42:59 2000: try to initiate listening port 4369
> > epmd: Mon Sep  4 13:42:59 2000: starting
> > epmd: Mon Sep  4 13:42:59 2000: entering the main select() loop
> >
> > In another window...
> >
> > sge@REDACTED:56$ erl -sname bank
> > Erlang (BEAM) emulator version 4.9.1 [source]
> >
> > Eshell V4.9.1  (abort with ^G)
> > (bank@REDACTED)1>
> >
> > ...and back in the 1st window...
> >
> > epmd: Mon Sep  4 13:43:10 2000: opening connection on file descriptor 4
> > epmd: Mon Sep  4 13:43:10 2000: got 19 bytes
> > ***** 00000000  00 11 78 b4 41 4d 00 00  05 00 05 00 04 62 61 6e  |..x.AM.......ban|
> > ***** 00000010  6b 00 00                                          |k..|
> > epmd: Mon Sep  4 13:43:10 2000: ** got ALIVE2_REQ
> > epmd: Mon Sep  4 13:43:10 2000: registering 'bank:2', port 46145
> > epmd: Mon Sep  4 13:43:10 2000: type 77 proto 0 highvsn 5 lowvsn 5
> > epmd: Mon Sep  4 13:43:10 2000: got 4 bytes
> > ***** 00000000  79 00 00 02                                       |y...|
> > epmd: Mon Sep  4 13:43:10 2000: ** sent ALIVE2_RESP for "bank"
> >
> > ...in a 3rd window...
> >
> > sge@REDACTED:12$ /usr/local/lib/erlang/bin/epmd -names
> > epmd: up and running on port 4369 with data:
> > name bank at port 14917
> > sge@REDACTED:13$
> >
> > ...and back in the 1st window...
> >
> > epmd: Mon Sep  4 13:47:44 2000: opening connection on file descriptor 5
> > epmd: Mon Sep  4 13:47:44 2000: got 3 bytes
> > ***** 00000000  00 01 6e                                          |..n|
> > epmd: Mon Sep  4 13:47:44 2000: ** got NAMES_REQ
> > epmd: Mon Sep  4 13:47:44 2000: got 4 bytes
> > ***** 00000000  00 00 11 11                                       |....|
> > epmd: Mon Sep  4 13:47:44 2000: got 24 bytes
> > ***** 00000000  6e 61 6d 65 20 62 61 6e  6b 20 61 74 20 70 6f 72  |name bank at por|
> > ***** 00000010  74 20 34 36 31 34 35 0a                           |t 46145.|
> > epmd: Mon Sep  4 13:47:44 2000: ** sent NAMES_RESP
> > epmd: Mon Sep  4 13:47:44 2000: closing connection on file descriptor 5
> >
> > ...which all makes sense, but...
> >
> > (bank@REDACTED)1> net_adm:names().
> > {error,nxdomain}
> > (bank@REDACTED)2>
> >
> > ...hmmm?  nslookup works here for short name, long name, and dotted
> > quad.  net_adm:host_file() parses my .hosts.erlang file ok.
> >
> > Still with me?  What other information should I provide?  Got into
> > this trying to run the Erlang book's banking example in chapter 6.
> > Works fine in a single shell, of course, but I got a nodedown when
> > trying to talk between 2 nodes and started poking around.  I'm on
> > OpenBSD 2.7.
> >
> > Thanks for reading,
> > Steve



More information about the erlang-questions mailing list