Add backup nodes to the RabbitMQ master node cluster to help you enable queue mirroring. This ensures that messages published to a queue are replicated to all mirrors.
Before you begin
Procedure
-
Run the RabbitMQ Command Prompt (sbin dir) application in Administrator mode.
This application is installed with RabbitMQ by default
-
To stop the node, execute the following command:
rabbitmqctl.bat stop_app
-
To add the node to the cluster, execute the following command:
rabbitmqctl.bat join_cluster rabbit@<MasterNodeName>
NOTE: <MasterNodeName> is case sensitive. -
To restart the node, execute the following command:
rabbitmqctl.bat start_app
NOTE: You can verify that the correct node has been added successfully by executing the following command:
or through the RabbitMQ web interface at https://<node hostname>:15671.rabbitmqctl.bat cluster_status
-
Enable queue mirroring on each node so they become highly available:
- On all the nodes, including the master node, open the RabbitMQ Command Prompt.
-
Execute the following command:
rabbitmqctl.bat set_policy -p Genetec.MissionControl ha-all "" "{""ha-mode"":""all"", ""ha-sync-mode"":""automatic""}"
NOTE: You can also do this through the RabbitMQ web portal (https://localhost:15671).In the Admin tab, Policies section, ensure that the Genetec.MissionControl virtual host has the policy ha-all.
If the Genetec.MissionControl virtual host policy is not set to ha-all:- In the Name text box, enter ha-all.
- From the Apply to list, select Queues.
- From the Queues [Classic] tags list, click HA mode.
- Ensure the Definition > ha-mode is set to all.
- From the Queues [Classic] tags list, click HA sync mode.
- Ensure the Definition > ha-sync-mode is set to automatic.
- Click Add / Update policy.
After you finish
Parent topic: Configuring failover for RabbitMQ