RabbitMQ Cluster 2019(3)Remove a Node from Cluster

RabbitMQCluster2019(3)RemoveaNodefromCluster

Inmycase,oneofmyRabbitMQNodechangedIPaddress,itjuststopstowork.

Somyplanistoremovethisnodeoutoftheclusterandadditback.

Checkallthelistcommand

>sbin/rabbitmqctl-nrabbit1-help

Usage

rabbitmqctl[--node<node>][--timeout<timeout>][--longnames][--quiet]<command>[<commandoptions>]

Availablecommands:

Removeanodefromthecluster

>sbin/rabbitmqctl-nrabbit1forget_cluster_noderabbit2@ubuntu-dev2

Checkthestatus

>sbin/rabbitmqctl-nrabbit1cluster_status

Clusterstatusofnoderabbit1@ubuntu-master...

[{nodes,[{disc,['rabbit1@ubuntu-master']}]},

{running_nodes,['rabbit1@ubuntu-master']},

{cluster_name,<<"rabbit1@ubuntu-master">>},

{partitions,[]},

{alarms,[{'rabbit1@ubuntu-master',[]}]}]

Restartmynode

>sudoRABBITMQ_NODE_PORT=5672RABBITMQ_SERVER_START_ARGS="-rabbitmq_managementlistener[{port,15672}]"RABBITMQ_NODENAME=rabbit2sbin/rabbitmq-server-detached

Jointheclusteragain

>sudosbin/rabbitmqctl-nrabbit2stop_app

>sudosbin/rabbitmqctl-nrabbit2join_clusterrabbit1@ubuntu-master

>sudosbin/rabbitmqctl-nrabbit2start_app

Afterthat,checkthestatus

>sbin/rabbitmqctl-nrabbit2cluster_status

Clusterstatusofnoderabbit2@ubuntu-dev2...

[{nodes,[{disc,['rabbit1@ubuntu-master','rabbit2@ubuntu-dev2']}]},

{running_nodes,['rabbit1@ubuntu-master','rabbit2@ubuntu-dev2']},

{cluster_name,<<"rabbit1@ubuntu-master">>},

{partitions,[]},

{alarms,[{'rabbit1@ubuntu-master',[]},{'rabbit2@ubuntu-dev2',[]}]}]

References:

相关推荐