“Error: Failed to initialize erlang distribution:” trying to run “rabbitmqctl status”

醉酒当歌 提交于 2020-01-04 02:18:12

问题


This question has been asked before (RabbitMQ Failed to initialize erlang distribution), but I haven't been able to find out how to fix it from the existing answers. Following https://www.rabbitmq.com/man/rabbitmqctl.1.man.html, I'd like to run the rabbitmqctl status command to display information about the RabbitMQ broker. However, I get an error message:

kurt@kurt-ThinkPad:~$ rabbitmqctl status

Error: Failed to initialize erlang distribution: {{shutdown, {failed_to_start_child, net_kernel, {'EXIT',nodistribution}}}, {child,undefined, net_sup_dynamic, {erl_distribution, start_link, [['rabbitmq-cli-13', shortnames]]}, permanent,1000,supervisor, [erl_distribution]}}.

Only root or rabbitmq should run rabbitmqctl

If I run the command with sudo, I still get an error message:

kurt@kurt-ThinkPad:~$ sudo rabbitmqctl status

Error: Failed to initialize erlang distribution: {{shutdown, {failed_to_start_child, net_kernel, {'EXIT',nodistribution}}}, {child,undefined, net_sup_dynamic, {erl_distribution, start_link, [['rabbitmq-cli-69', shortnames]]}, permanent,1000,supervisor, [erl_distribution]}}.

How can I fix this?


回答1:


I also faced similar error when trying to enable the rabbitmq management plugin, $rabbitmq-plugins enable rabbitmq_management

Error: Failed to initialize erlang distribution: {{shutdown, {failed_to_start_child, auth, {"Error when reading ./.erlang.cookie: eacces",...}}.

It got solved when I ran with **sudo .**




回答2:


In fact I got the same error:

Only root or rabbitmq should run rabbitmqctl

when I wanted to run the following command:

rabbitmq-plugins enable rabbitmq_mqtt

I just ran it with sudo and it was resolved!

Try to restart the rabbitmq-server then try again with sudo:

sudo service rabbitmq-server restart


来源:https://stackoverflow.com/questions/40980345/error-failed-to-initialize-erlang-distribution-trying-to-run-rabbitmqctl-st

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!