启用rabbitmq-management后无法启动rabbitmq-server

时间:2018-10-19 09:47:15

标签: magento rabbitmq

我已经安装了Erlang和Rabbitmq。之后启动服务

$ sudo systemctl start rabbitmq-server $ systemctl status rabbitmq-server ● rabbitmq-server.service - RabbitMQ broker Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled) Active: active (running) since Fri 2018-10-19 10:50:10 CEST; 13s ago Main PID: 46976 (beam.smp) CGroup: /system.slice/rabbitmq-server.service ├─46976 /usr/lib64/erlang/erts-5.10.4/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/li... ├─47073 inet_gethost 4 └─47075 inet_gethost 4

然后我启用了Rabbitmq-management,并更改了所有权

$ sudo rabbitmq-plugins enable rabbitmq_management The following plugins have been enabled: mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_management_agent rabbitmq_management Plugin configuration has changed. Restart RabbitMQ for changes to take effect. $ sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/ 比创建用户,为其添加标签并设置权限

$ sudo rabbitmqctl add_user admin password! Creating user "admin" ... ...done. $ sudo rabbitmqctl set_user_tags admin administrator Setting tags for user "admin" to [administrator] ... ...done. $ sudo rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" Setting permissions for user "admin" in vhost "/" ... ...done.

那里发生的不好,无论如何我都无法重启rabbitmq

$ sudo systemctl status rabbitmq-server.service ● rabbitmq-server.service - RabbitMQ broker Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2018-10-19 10:55:23 CEST; 17s ago Process: 59210 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=2) Process: 59024 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=1/FAILURE) Main PID: 59024 (code=exited, status=1/FAILURE) Oct 19 10:55:23 XEMDUB07APXD080 systemd[1]: rabbitmq-server.service: main process exited, code=exited, ...LURE Oct 19 10:55:23 XEMDUB07APXD080 rabbitmqctl[59210]: Stopping and halting node rabbit@XEMDUB07APXD080 ... Oct 19 10:55:23 XEMDUB07APXD080 rabbitmqctl[59210]: Error: unable to connect to node rabbit@XEMDUB07APXD...own Oct 19 10:55:23 XEMDUB07APXD080 rabbitmqctl[59210]: DIAGNOSTICS Oct 19 10:55:23 XEMDUB07APXD080 rabbitmqctl[59210]: =========== Oct 19 10:55:23 XEMDUB07APXD080 rabbitmqctl[59210]: attempted to contact: [rabbit@XEMDUB07APXD080] Oct 19 10:55:23 XEMDUB07APXD080 systemd[1]: rabbitmq-server.service: control process exited, code=exite...us=2 Oct 19 10:55:23 XEMDUB07APXD080 systemd[1]: Failed to start RabbitMQ broker. Oct 19 10:55:23 XEMDUB07APXD080 systemd[1]: Unit rabbitmq-server.service entered failed state. Oct 19 10:55:23 XEMDUB07APXD080 systemd[1]: rabbitmq-server.service failed. Hint: Some lines were ellipsized, use -l to show in full. lskdlskdlskd

我应该怎么做才能重新启动Rabbitmq? 谢谢

2 个答案:

答案 0 :(得分:0)

我想在这里回答:https://github.com/rabbitmq/chef-cookbook/issues/182

在我发现的日志文件中:

`=INFO REPORT==== 19-Oct-2018::12:19:04 ===
Error description:
   {error,
       {cannot_read_enabled_plugins_file,"/etc/rabbitmq/enabled_plugins",
           eacces}}
    Log files (may contain more information):
   /var/log/rabbitmq/rabbit@XEMDUB07APXD080.log
   /var/log/rabbitmq/rabbit@XEMDUB07APXD080-sasl.log
Stack trace:
    [{rabbit_plugins,read_enabled,1,
                    [{file,"src/rabbit_plugins.erl"},{line,80}]},
     {rabbit_plugins,prepare_plugins,3,
                    [{file,"src/rabbit_plugins.erl"},{line,109}]},
    {rabbit,'-boot/0-fun-1-',0,[{file,"src/rabbit.erl"},{line,334}]},
    {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,358}]},
    {init,start_it,1,[]},
    {init,start_em,1,[]}]
 code here
`

我要做的就是更改/ etc / rabbitmq / enabled_plugins的权限,

chmod 644 /etc/rabbitmq/enabled_plugins

它从现在开始。 谢谢

答案 1 :(得分:0)

我在Windows上遇到了同样的问题。我没有通过谷歌搜索找到解决方案。 {错误,{cannot_read_enabled_plugins_file,“ C:\ RabbitMQ \ ENABLE〜1”,eisdir}} 我已经将在环境变量中配置的HOMEDRIVE和HOMEPATH设置为c:和\ RabbitMQ。但是rabbimq忽略了这些值。

我在C:\ RabbitMQ文件夹中有一个名为“ enabled_plugins”的文件夹。 RabbitMQ期望在%HOMEDRIVE %% HOMEPATH%文件夹中有一个文件。

解决方案是删除C:\ RabbitMQ路径中的enabled_plugins文件夹,并在%HOMEDRIVE %% HOMEPATH%文件夹中创建一个名为enabled_plugins的文件。

涉及的其他步骤:

1)安装erlang。检查环境变量是否指向正确的erlang路径  在我的情况下,envName:ERLANG_HOME值:C:\ Program Files \ erl10.0.1

2)安装RabbitMQ Windows安装程序

3)配置防火墙(如有必要)。请参阅“控制面板”中的“高级防火墙设置”(请参阅​​防火墙设置的左面板)。

根据以下内容添加新规则。

规则类型端口 协议和端口TCP 指定的本地端口5672、15672 操作允许连接 配置文件域,私有,公开 名称RabbitMQ

规则类型程序 程序路径%ProgramFiles%\ erl7.2.1 \ bin \ erl.exe 操作允许连接 配置文件域,私有,公开 名称Erlang

规则类型程序 程序路径%ProgramFiles%\ erl10.0.1 \ erts-10.0.1 \ bin \ erl.exe 操作允许连接 配置文件域,私有,公开 命名Erlang RunTime

规则类型程序 程序路径%ProgramFiles%\ erl10.0.1 \ erts-10.0.1 \ bin \ epmd.exe 操作允许连接 配置文件域,私有,公开 名称Erlang端口

4)将RabbitMQ文件夹从%APPDATA%复制到C:驱动器,然后从%APPDATA%文件夹删除
   (这可以在注销并重新登录后完成)。

5)设置环境变量(系统变量)RABBITMQ_BASE = C:\ RabbitMQ和RABBITMQ_MNESIA_BASE = C:\ RabbitMQ \ db,确保db文件夹存在。

6)运行RabbitMQ命令提示符(以管理员身份运行)(或命令提示符路径C:\ Program Files \ RabbitMQ Server \ rabbitmq_server-3.7.8 \ sbin)

7)在命令提示符下设置HOMEDRIVE = C:SET HOMEPATH = \ RabbitMQ

8)Rabbitmq-service.bat删除

9)Rabbitmq-service.bat安装

10)rabbitmq-service.bat启动

11)Rabbitmq-plugins.bat启用rabbitmq_management(如果身份验证与检查erlang cookie不匹配)

12)rabbitmqctl.bat状态(以检查状态)

13)从C:\ Windows \ System32 \ config \ systemprofile.erlang.cookie文件中删除只读属性。(右键单击属性)

14)确保位于C:\ Windows \ System32 \ config \ systemprofile内容的cookie与 %HOMEDRIVE %% HOMEPATH%.erlang.cookie

15)http://localhost:15672/#/,您应该会看到登录屏幕。

16)使用来宾/来宾登录并创建虚拟主机并配置您的总线(发送者)。启动指向该虚拟主机的后台服务。