Quantcast

Node communication by public IP address

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Node communication by public IP address

Eric Shun
Hi,

I would like to ping a node using its public IP address (over the Internet).
I try to run my nodes using erl -sname [hidden email] but that doesnt work.
How can I run both nodes so they can communicate using their IP address?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Node communication by public IP address

Juan José Sánchez Penas-2
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 [hidden email] 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@192.168.0.1 -setcookie hicookie
Erlang (BEAM) emulator version 5.4.6 [source] [threads:0]
Eshell V5.4.6  (abort with ^G)
(node2@192.168.0.1)1> register(b,self()).
true
(node2@192.168.0.1)2> receive X -> X end.


Then, i do the following in machine 192.168.0.2:

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

And I receive the hi message in 192.168.0.1.

Cheers.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Node communication by public IP address

Eric Shun
This works fine in a LAN but doesnt work through the Internet =( I opened those ports on both side: 4369 TCP and 9100 to 9105 and typed on the erlang console:
 application:set_env(kernel, inet_dist_listen_min, 9100).
 application:set_env(kernel, inet_dist_listen_max, 9105).

But when I try net_adm:ping(DistantNode) it doesn't work =(
Any idea?

2006/5/27, Juan José Sánchez Penas <[hidden email]>:
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 [hidden email] 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 [hidden email] -setcookie hicookie
Erlang (BEAM) emulator version 5.4.6 [source] [threads:0]
Eshell V5.4.6  (abort with ^G)
([hidden email])1> register(b,self()).
true
([hidden email])2> receive X -> X end.


Then, i do the following in machine 192.168.0.2:

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

And I receive the hi message in 192.168.0.1.

Cheers.

Loading...