Node communication by public IP address

Juan José Sánchez Penas jjsanchez@REDACTED
Sat May 27 13:04:34 CEST 2006


Hi,

On Fri, May 26, 2006 at 09:57:08PM +0200, Eric Shun wrote:
> I would like to ping a node using its public IP address (over the Internet).
> I try to run my nodes using erl -sname node1@REDACTED but that doesnt
> work.
> How can I run both nodes so they can communicate using their IP address?

Have you tried with -name instead of -sname?

In my two machines it works fine.

In machine 192.168.0.1 I try:

$ erl -name node2@REDACTED -setcookie hicookie
Erlang (BEAM) emulator version 5.4.6 [source] [threads:0]
Eshell V5.4.6  (abort with ^G)
(node2@REDACTED)1> register(b,self()).
true
(node2@REDACTED)2> receive X -> X end.


Then, i do the following in machine 192.168.0.2:

$ erl -name node1@REDACTED -setcookie hicookie
Erlang (BEAM) emulator version 5.4.6 [source] [hipe]
Eshell V5.4.6  (abort with ^G)
(node1@REDACTED)3> nodes().
[]
(node1@REDACTED)4> {b,'node2@REDACTED'}!hi.
hi
(node1@REDACTED)5> nodes().
['node2@REDACTED']

And I receive the hi message in 192.168.0.1.

Cheers.



More information about the erlang-questions mailing list