RabbitMQ启动失败解决

使用systemctl start rabbitmq-server.service启动rabbitmq时报错:

[root@rhos5-rabbitmq1 ~]# systemctl start rabbitmq-server
Jun 13 21:03:08 jeckersb-f20 systemd[1]: Starting RabbitMQ broker...
Jun 13 21:03:09 jeckersb-f20 rabbitmqctl[1186]: Waiting for 'rabbit@jeckersb-f20' ...
Jun 13 21:03:09 jeckersb-f20 rabbitmqctl[1186]: pid is 1185 ...
Jun 13 21:03:09 jeckersb-f20 systemd[1]: rabbitmq-server.service: main process exited, code=exited, status=1/FAILURE
Jun 13 21:03:09 jeckersb-f20 rabbitmqctl[1186]: Error: process_not_running
Jun 13 21:03:09 jeckersb-f20 systemd[1]: rabbitmq-server.service: control process exited, code=exited status=2
[root@rhos5-rabbitmq1 ~]# rabbitmqctl status
Status of node 'rabbit@rhos5-rabbitmq1' ...
Error: unable to connect to node 'rabbit@rhos5-rabbitmq1': nodedown

DIAGNOSTICS
===========

nodes in question: ['rabbit@rhos5-rabbitmq1']

hosts, their running nodes and ports:
- rhos5-rabbitmq1: [{rabbitmqctl2980,45861}]

current node details:
- node name: 'rabbitmqctl2980@rhos5-rabbitmq1'
- home dir: /var/lib/rabbitmq
- cookie hash: vzI5NUyusQhCrkRr6GAhpQ==

这个根本看不出启动失败原因
看了一些原因,有的说是文件需要删除
/var/lib/rabbitmq/mnesia 目录下存在[email protected]、rabbit@localhost、rabbit@localhost-plugins-expand,删除这3项后,再使用systemctl start rabbitmq-server启动,发现还是启动失败
又换了直接使用rabbitmq-server启动
这次提示:

{"could not start kernel pid",application_controller,"error in config file \"c:/Users/yupeipei/AppData/Roaming/RabbitMQ/
rabbitmq.config\" (256): syntax error before: ']'"}
could not start kernel pid (application_controller) (error in config file "c:/Users/yupeipei/AppData/Roaming/RabbitMQ/ra
bbitmq.config" (256): syntax error before: ']')

发现自己编辑 /etc/rabbitmq/rabbitmq.config 文件。添加远程访问用户的配置多了一个逗号 ‘,’

[
{rabbit, [{tcp_listeners, [5672]}, {loopback_users, [“asdf”]},]}
]

删除逗号在次重启,服务成功启动!

你可能感兴趣的:(【----linux----】,RabbitMQ,Liunx)