最近我在Ubuntu 14上安装了Rabbitmq 3.6.2,但每当我运行rabbitmq-server命令时它都会给我错误:
{error_logger,{{2016,7,5},{13,45,12}},"Protocol: ~tp: register/listen error: ~tp~n",["inet_tcp",econnrefused]}
{error_logger,{{2016,7,5},{13,45,12}},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.93>,<0.18.0>]},{dictionary,[{longnames,false}]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,805}],[]]}
{error_logger,{{2016,7,5},{13,45,12}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[[rabbitmqprelaunch1853,shortnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2016,7,5},{13,45,12}},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,{{2016,7,5},{13,45,12}},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,133}]},{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,{{2016,7,5},{13,45,12}},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,[]]}}}"}
我检查了iptables,那里没有规则。我确信rabbitmq没有运行且端口可用。我不是linux大师,所以不确定在哪里搜索。
更新:
/ etc / rabbitmq文件夹是空的,可能是因为它没有用apt-get完成配置(并且没有rabbitmq-env.conf):
Setting up rabbitmq-server (3.6.2-1) ...
* Starting message broker rabbitmq-server
* FAILED - check /var/log/rabbitmq/startup_\{log, _err\} [fail]
invoke-rc.d: initscript rabbitmq-server, action "start" failed.
dpkg: error processing package rabbitmq-server (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我的ifconfig看起来像这样(出于隐私原因在ip地址中添加了xx):
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2800 (2.8 KB) TX bytes:2800 (2.8 KB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:7323 errors:0 dropped:0 overruns:0 frame:0
TX packets:8256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:919045 (919.0 KB) TX bytes:1688814 (1.6 MB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:185.xx.xx.176 P-t-P:185.xx.xx.176 Bcast:185.xx.xx.176 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
谢谢!
答案 0 :(得分:0)
查看您的环回接口,似乎您在计算机上禁用了IPv6(没有inet6
条目。)
现在,相应于this bug epmd
并不支持IPv6,所以他们修补了它,但现在要求启用IPv6(查看评论) #16和#17)。
由于该错误没有其他活动,我建议您尝试在您的计算机上启用IPv6。
可能的解决方法是使用IPV4-mapped IPV6 address。
将/etc/rabbitmq/rabbitmq-env.conf
添加到以下行:
ERL_EPMD_ADDRESS=::ffff:127.0.1.1
旧答案
您的错误有很多不同的可能根本原因。我假设您将RabbitMq配置为使用IPv6地址,或者您有一些奇怪的网络配置没有IPv4。
我认为值得尝试编辑/etc/rabbitmq/rabbitmq-env.conf
并添加:
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-proto_dist inet6_tcp"
如果它不起作用,请发布/etc/rabbitmq/rabbitmq-env.conf
中的其他内容以及ifconfig
的输出,请
答案 1 :(得分:0)
解决方案是从官方网站下载最新的ErLang:
https://www.erlang-solutions.com/resources/download.html
我已经为Ubuntu Precise下载了v19,现在效果很好。