service rabbitmq-server start启动失败

蔡明贤
2023-12-01

问题如下

  • 执行
service rabbitmq-server start

出现Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup_{log, _err} rabbitmq-server.

  • 具体如下
[root@backbay2 rabbitmq]# service rabbitmq-server start
Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup_{log, _err}
rabbitmq-server.

问题解决

查看rabbitmq状态

/etc/init.d/rabbitmq-server status

结果如下

[root@backbay2 rabbitmq]# /etc/init.d/rabbitmq-server status
Status of node rabbit@backbay2 ...
Error: unable to connect to node rabbit@backbay2: nodedown

查看日志

cat /var/log/rabbitmq/startup_log 

结果如下

[root@backbay2 ~]# cat /var/log/rabbitmq/startup_log 
ERROR: epmd error for host backbay2: timeout (timed out)

分析问题

  • 可以发现问题提示的错误是Host backbay2(youhostname)的错误

解决办法

输入

 vi /etc/rabbitmq/rabbitmq-env.conf

插入这条语句

NODENAME=rabbit@localhost

按ESC然后输入:wq保存离开

启动测试

启动

service rabbitmq-server start

关闭

service rabbitmq-server stop

开启界面管理

rabbitmq-plugins enable rabbitmq_management

重新启动

service rabbitmq-server restart

设置开机自启

chkconfig rabbitmq-server on

防火墙开放15672端口

/sbin/iptables -I INPUT -p tcp --dport 15672 -j ACCEPT
/etc/rc.d/init.d/iptables save
 类似资料: