Reproduce RabbitMQ network partition scenario

Viewed 3743

I would like to reproduce the network partition scenario with all the three modes - ignore, autoheal and pause_minority. How can I achieve this? I tried stopping(/sbin/service reboot) one of the nodes of the cluster but this didn't cause any network partitioning. I also tried deleting the mnesia on one node to create inconsistent mnesia across the cluster but that also didn't help.

4 Answers

I managed to simulate / reproduce network partition for RabbitMQ by blocking 25672 port.

25672: used for inter-node and CLI tools communication

I had two RabbitMQ nodes in different AWS instances.

To simulate a network partition I configured dropping tcp packets for that port, waited 60 seconds (may differ according to Net Tick Time parameter) and then removed the port blocking (that's required for network partition detection).

Adding the rules for port blocking (with the highest priority):

sudo iptables -I INPUT 1 -p tcp --dport 25672 -j DROP
sudo iptables -I OUTPUT 1 -p tcp --dport 25672 -j DROP

Removing the rules (after 60+ seconds):

sudo iptables -D INPUT -p tcp --dport 25672 -j DROP
sudo iptables -D OUTPUT -p tcp --dport 25672 -j DROP

To check that network partition has occurred:

sudo rabbitmqctl cluster_status

partitions property will have nodes in it's array like this

{partitions,[{'rabbit@ip-163-10-1-10',['rabbit@ip-163-10-0-15']}]}

RabbitMQ network partition docs

If you are using a docker, disconnecting the connected network will activate the partitioning.

docker network disconnect network_name rabbitmq_container_name
Related