novice question

Raimo Niskanen raimo@REDACTED
Tue Sep 5 10:25:21 CEST 2000


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
	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.

/ Raimo Niskanen, Erlang/OTP

	


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