1,执行在host文件中配置主名字
192.168.1.21 <span style="font-family: Arial, Helvetica, sans-serif;">platform-api1</span> 192.168.1.22 <span style="font-family: Arial, Helvetica, sans-serif;">platform-api2</span>
2,分别启动21,22 rabbitmq服务
3,,将集群的cooke设置一直,在21上执行下面的命令,将内容copy到22上
sudo vi /var/lib/rabbitmq/.erlang.cookie
4,执行命令
rabbitmqctl join_cluster [email protected]
看到一下结果则创建成功
Cluster status of node '[email protected]' ... [{nodes,[{disc,['[email protected]','[email protected]']}]}] ...done.
备注:如果报下面的错误:
Rabbit - Error: mnesia_unexpectedly_running
则执行下面的命令即可:
rabbitmqctl stop_app rabbitmqctl reset rabbitmqctl cluster [email protected]
Ubuntu 下 rabbitmq集群配置
时间: 2024-10-08 16:23:42