erlang slave:启动/ 2连接被拒绝

时间:2012-03-28 10:57:54

标签: erlang

os是Mac os lion。 如果命令为'erl -name aa''erl -name bb',则两个节点之间的长名称连接正常。

但是如果使用slave:start / 2,则连接混淆错误发生如下:

(emacs@yus-iMac.local)33> slave:start('yus-iMac.local',bb).
connect to address 192.168.64.1: Connection refused
Trying 192.168.213.1...
connect to address 192.168.213.1: Connection refused
Trying 192.168.0.101...
connect to address 192.168.0.101: Connection refused
Trying fe80::654:53ff:fe0e:b2ee%en1...
connect to address fe80::654:53ff:fe0e:b2ee%en1: Connection refused
Trying 192.168.64.1...
connect to address 192.168.64.1: Connection refused
Trying 192.168.213.1...
connect to address 192.168.213.1: Connection refused
Trying 192.168.0.101...
connect to address 192.168.0.101: Connection refused
Trying fe80::654:53ff:fe0e:b2ee%en1...
connect to address fe80::654:53ff:fe0e:b2ee%en1: Connection refused
Trying 192.168.64.1...
connect to address 192.168.64.1: Connection refused
Trying 192.168.213.1...
connect to address 192.168.213.1: Connection refused
Trying 192.168.0.101...
connect to address 192.168.0.101: Connection refused
Trying fe80::654:53ff:fe0e:b2ee%en1...
connect to address fe80::654:53ff:fe0e:b2ee%en1: Connection refused
Trying 192.168.64.1...
connect to address 192.168.64.1: Connection refused
Trying 192.168.213.1...
connect to address 192.168.213.1: Connection refused
Trying 192.168.0.101...
connect to address 192.168.0.101: Connection refused
Trying fe80::654:53ff:fe0e:b2ee%en1...
connect to address fe80::654:53ff:fe0e:b2ee%en1: Connection refused
Trying 192.168.64.1...
connect to address 192.168.64.1: Connection refused
Trying 192.168.213.1...
connect to address 192.168.213.1: Connection refused
Trying 192.168.0.101...
connect to address 192.168.0.101: Connection refused
Trying fe80::654:53ff:fe0e:b2ee%en1...
connect to address fe80::654:53ff:fe0e:b2ee%en1: Connection refused
Trying 192.168.64.1...
connect to address 192.168.64.1: Connection refused
Trying 192.168.213.1...
connect to address 192.168.213.1: Connection refused
Trying 192.168.0.101...
connect to address 192.168.0.101: Connection refused
Trying fe80::654:53ff:fe0e:b2ee%en1...
yus-imac.local: Connection refused
{error,timeout}

longname测试如下:

yus-iMac:~ yuchen$ erl -name cc
Erlang R15B (erts-5.9) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9  (abort with ^G)
(cc@yus-iMac.local)1> 

yus-iMac:~ yuchen$ erl -name dd
Erlang R15B (erts-5.9) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9  (abort with ^G)
(dd@yus-iMac.local)2> net_adm:ping('cc@yus-iMac.local').
pong
(dd@yus-iMac.local)3> 

1 个答案:

答案 0 :(得分:2)

默认情况下,当您通过slave API启动节点时,会使用RSH连接。阅读doc

  

“从属节点在与主节点相同的主机上启动   来自主服务器的环境值,例如当前目录和   环境变量。对于可以假设的   在另一台主机上启动从站时的环境,请阅读   rsh程序的文档。“

也许这就是问题所在。您应该验证主机上的RSH连接是否正常。当启动'erl'命令时,可以在命令行上指定rsh程序的替代方法:

erl -rsh ssh

希望这可能会让你走向正确的方向。我不是在跑狮子,所以我无法说出来。