docker 搭建RabbitMQ出现报错
一、当cookie配置错误解决办法:检查容器启动时候一、主机名造成报错:检查加入主节点名字是否为docker1
·
情况一、当cookie配置错误
解决办法:容器启动cookie一致
情况二、主机名造成报错:
解决问题:
1、检查node 节点加入主节点容器主机名是否为docker1?
2、还需要保证hosts文件挂载到容器中可以正常解析寻址
正常规范启动:
总结: 保证启动容器的主机名
与 挂载到容器中的hosts文件
内容中的主机与IP能够保证互相解析。
情况三、hosts文件造成报错:
问题:
hosts 对应主机错误
解决办法如下:
1、修改 hosts文件
2、 重启 容器即可
命令: docker restart rabbit3
[root@docker3 rabbitmq]# cat hosts
192.168.11.134 docker1
192.168.11.156 docker2
192.168.11.157 docker3
[root@docker3 rabbitmq]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
02fbffb2e20c rabbitmq:3.6.15-management "docker-entrypoint.s…" About an hour ago Up About an hour rabbit3
[root@docker3 rabbitmq]# docker restart rabbit3
rabbit3
[root@docker3 rabbitmq]# docker exec -it rabbit3 /bin/bash
root@docker3:/#
root@docker3:/# cat /etc/hosts
192.168.11.134 docker1
192.168.11.156 docker2
192.168.11.157 docker3
root@docker3:/# rabbitmqctl join_cluster rabbit@docker1
Clustering node rabbit@docker3 with rabbit@docker1
Error: Mnesia is still running on node rabbit@docker3.
Please stop the node with rabbitmqctl stop_app first.
root@docker3:/# rabbitmqctl stop_app
Stopping rabbit application on node rabbit@docker3
root@docker3:/# rabbitmqctl reset
Resetting node rabbit@docker3
root@docker3:/# rabbitmqctl join_cluster rabbit@docker1
Clustering node rabbit@docker3 with rabbit@docker1
root@docker3:/# rabbitmqctl start_app
Starting node rabbit@docker3
root@docker3:/# rabbitmqctl cluster_status
Cluster status of node rabbit@docker3
[{nodes,[{disc,[rabbit@docker1,rabbit@docker2,rabbit@docker3]}]},
{running_nodes,[rabbit@docker1,rabbit@docker2,rabbit@docker3]},
{cluster_name,<<"rabbit@docker1">>},
{partitions,[]},
{alarms,[{rabbit@docker1,[]},{rabbit@docker2,[]},{rabbit@docker3,[]}]}]
更多推荐
已为社区贡献3条内容
所有评论(0)