之前将rabbit@pc1剔除了rabbitmq集群,现在想将该节点启动,执行systemctl start rabbitmq-server命令报错:
Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
执行journalctl -xe,看到有如下报错:
{"init terminating in do_boot",{error,{inconsistent_cluster,"Node rabbit@pc1 thinks it's clustered with node rabbit@pc2, but rabbit@pc2 disagrees"}
从rabbit@pc1的启动报错来看,像是集群信息残留。在rabbit@pc2上操作将node-1移除集群,rabbit@pc1的rabbitmq服务已经down掉了,所以数据库无法同步更新,记载的仍是旧的集群信息(数据库记录里自身节点仍属于集群),而rabbit@pc2数据库记录已经更新(数据库信息里面集群不包含rabbit@pc1节点了)。
删除rabbit@pc1的数据库记录,再启动该节点
mv /var/lib/rabbitmq/mnesia/* /tmp/
systemctl start rabbitmq-server
--本篇文章参考了
rabbitmq一个节点无法加入集群的排查-(inconsistent_cluster)_Focus on k8s and python-CSDN博客