丢失镜像队列

Losing mirrored queues

RabbitMQ 集群的 3 个节点具有镜像所有 HA policies defined。集群发生故障并分区为独立节点。集群已修复,但由于故障,一些队列丢失了。即使镜像所有队列的 HA 策略到位,这是否也是一种可能的情况?

简而言之,是的,但最好了解您的具体情况。

来自https://www.rabbitmq.com/partitions.html

During a network partition

While a network partition is in place, the two (or more!) sides of the cluster can evolve independently, with both sides thinking the other has crashed. Queues, bindings, exchanges can be created or deleted separately. Mirrored queues which are split across the partition will end up with one master on each side of the partition, again with both sides acting independently.

一些示例场景:

如果队列是在网络分区期间创建的,当集群被修复时,不能保证它们会被保留。失败的分区将丢弃其状态并从获胜的分区恢复它。

如果您重新启动具有队列定义的唯一副本的 ram 节点,那么它们将会丢失。由于这个原因,rabbitmq 文档建议不要使用 ram 节点。

我强烈推荐 rabbitmq 文档,它非常广泛且非常精确。