首先将要移除的节点停机.
root@rabbitmq-03:~# rabbitmqctl stop
Stopping and halting node 'rabbit@rabbitmq-03' ...
然后执行如下操作.
在主节点,也就是发起进群的主机上进行节点的移除.
root@rabbitmq-01:/var/lib/rabbitmq# rabbitmqctl  -n rabbit@rabbitmq-01 forget_cluster_node rabbit@rabbitmq-03
Removing node 'rabbit@rabbitmq-03' from cluster ...
 
下面是范例
rabbitmqctl -n hare @ mcnulty forget_cluster_node rabbit @ stringer
 
然后查看集群状态信息.
 
root@rabbitmq-01:/var/lib/rabbitmq# rabbitmqctl cluster_status
Cluster status of node 'rabbit@rabbitmq-01' ...
[{nodes,[{disc,['rabbit@rabbitmq-01','rabbit@rabbitmq-02']}]},
{running_nodes,['rabbit@rabbitmq-02','rabbit@rabbitmq-01']},
{cluster_name,<<"rabbit@rabbitmq-01">>},
{partitions,[]}]
 
发现rabbitmq3节点已经被移除.
posted on 2018-04-24 16:11  DisCover_ry  阅读(6423)  评论(0编辑  收藏  举报