重现RabbitMQ网络分区方案 [英] Reproduce RabbitMQ network partition scenario

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

问题描述

我想用ignoreautohealpause_minority三种模式重现网络分区方案. 我怎样才能做到这一点?我尝试停止(/sbin/service restart)集群的节点之一,但这没有引起任何网络分区.我还尝试删除一个节点上的记忆缺失,以在整个群集中创建不一致的记忆缺失,但这也无济于事.

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个节点:

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天全站免登陆