- Clustering is intended to facilitate scalability, not availability!!!
- repeat the steps of the article RabbitMq deploy to host
- as a result, we have two RabbitMq servers deployed on two virtual machines
-
Step 1: for u200401 show ip address
Click to show the picture
-
Step 2: for u200402 show ip address
Click to show the picture
-
Step 3: modify /etc/hosts as shown below
Click to show the picture
-
Step 4: modify /etc/hosts as shown below
Click to show the picture
- /var/lib/rabbitmq/.erlang.cookie files
-
Note: the cookie must be the same on both servers
-
Step 5: modify /var/lib/rabbitmq/.erlang.cookie as shown below
sudo nano /var/lib/rabbitmq/.erlang.cookie
Click to show the picture
-
Step 6: modify /var/lib/rabbitmq/.erlang.cookie as shown below
sudo nano /var/lib/rabbitmq/.erlang.cookie
Click to show the picture
sudo systemctl restart rabbitmq-server
sudo systemctl restart rabbitmq-server
-
Step 9: On both machines run diagnostics commands:
sudo rabbitmq-diagnostics -n rabbit@u200401 ping
sudo rabbitmq-diagnostics -n rabbit@u200402 ping
sudo rabbitmq-diagnostics -n rabbit@u200401 check_running
sudo rabbitmq-diagnostics -n rabbit@u200402 check_running
-
Step 10: On both machines run the command:
sudo rabbitmq-server -detached
sudo rabbitmqctl cluster_status
-
Step 11: run the commands
sudo rabbitmqctl stop_app
sudo rabbitmqctl reset
sudo rabbitmqctl join_cluster rabbit@u200401
sudo rabbitmqctl start_app
Click to show the picture
sudo rabbitmqctl cluster_status
Click to show the picture
Click to show the picture