Erlang报告了epmd_closed错误

时间:2013-04-20 14:48:46

标签: erlang

Erlang ver:R16B

操作系统:Fedora17

erl -name aerl -sname a都报告了以下错误:

{error_logger,{{2013,4,20},{14,50,20}},"Protocol: ~tp: register/listen error: ~tp~n",["inet_tcp",epmd_close]}
{error_logger,{{2013,4,20},{14,50,20}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.21.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,320}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[net_sup,kernel_sup,<0.10.0>]},{messages,[]},{links,[#Port<0.56>,<0.18.0>]},{dictionary,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,728}],[]]}
{error_logger,{{2013,4,20},{14,50,20}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[[s,longnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2013,4,20},{14,50,20}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2013,4,20},{14,50,20}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.9.0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,138}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[<0.8.0>]},{messages,[{'EXIT',<0.10.0>,normal}]},{links,[<0.8.0>,<0.7.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,117}],[]]}
{error_logger,{{2013,4,20},{14,50,20}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{k

以下是iptables:

> iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       icmp --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

以下是erl:

> erl
Erlang R16B (erts-5.10.1) [source] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.1  (abort with ^G)
1>

它在Linode VPS上并且过去没问题。我不知道这个问题的原因是什么。

2 个答案:

答案 0 :(得分:11)

问题可能在于您的iptables配置。

默认情况下,Erlang不允许从非本地地址连接到epmd。如果我没有弄错,这种行为在新的Erlang版本中是实际的。看起来您有与NAT / MASQUERADING相关的iptables问题 - 您的传出流量被iptables伪装成外部IP地址(包括来自/到127.0.0.1的流量)。

示例

伪装所有传出流量

-A POSTROUTING -j SNAT --to-source x.x.x.x

这是'iptables -t nat --list'

的输出
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       all  --  anywhere             anywhere             to:x.x.x.x

检查'erl -sname a' - 不起作用,完全相同的错误

现在,伪装除了定向到127.0.0.0/8的所有传出流量

-A POSTROUTING ! -d 127.0.0.0/8 -j SNAT --to-source x.x.x.x

注意添加'! -d 127.0.0.0/8'

再次检查iptables

#iptables -t nat --list
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       all  --  anywhere            !127.0.0.0/8          to:x.x.x.x

再次检查erlang:

#erl -sname a
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.1  (abort with ^G)
(a@akitaki)1> q().
ok
(a@akitaki)2> %

效果很好。

因此,请尝试检查您的iptables /防火墙NAT / MASQUERADING配置。

<强>更新

要实现NAT / MASQUERADING,您可以使用以下iptables规则之一:

-A POSTROUTING ! -d 127.0.0.0/8 -j SNAT --to-source x.x.x.x

-A POSTROUTING ! -d 127.0.0.0/8 -j MASQUERADE

在第一种情况下('source NAT'),您应该明确指出您的外部IP地址。你可以使用这个命令知道它:

#ifconfig

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=3<RXCSUM,TXCSUM>
    inet 127.0.0.1 netmask 0xff000000
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 70:56:81:98:d1:b9
    inet X.X.X.X netmask 0xffffff00 broadcast Y.Y.Y.Y
    media: autoselect
    status: active

inet X.X.X.X 网络掩码0xffffff00广播Y.Y.Y.Y

此处X.X.X.X是您应该在“--SNAT x.x.x.x”命令中指向的外部IP地址

在第二种情况('伪装')中,您没有明确指出外部IP地址 - 您的服务器会自动执行此操作。

答案 1 :(得分:1)

问题与epmd无法完成工作有关。其他一切似乎都是这个问题的后果。我将专注于epmd并首先在VPS中工作,然后专注于Erlang节点。

出于某种原因,你没有获得epmd,结果事情就会失败。