重现 RabbitMQ 网络分区场景 [英] Reproduce RabbitMQ network partition scenario

查看:17
本文介绍了重现 RabbitMQ 网络分区场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用所有三种模式重现 网络分区场景 - ignoreautohealpause_minority.我怎样才能做到这一点?我尝试停止(/sbin/service reboot)集群的一个节点,但这并没有导致任何网络分区.我还尝试删除一个节点上的 mnesia 以在集群中创建不一致的 mnesia,但这也没有帮助.

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.

推荐答案

为了模拟网络分区,您可以使用 iptables

In order to simulate a network partition you can block the outgoing connections using iptables

假设你有 3 个节点:

Suppose you have 3 nodes:

node1 - ip : 10.10.0.1
node2 - ip : 10.10.0.2
node3 - ip : 10.10.0.3

创建集群后,以节点2为例,

After creating the cluster, go to node 2 for example and

iptables -A OUTPUT -d 10.10.0.1 -j DROP

这样你就阻塞了连接,节点将进入网络分区.

In this way you blocked the connections and the node will go in network partition.

然后

iptables -F

恢复网络.

这篇关于重现 RabbitMQ 网络分区场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆