RabbitMQ HA模式全部或完全差异?
我们有一个带有3个节点的群集,目前我们有以下HA(高可用性)镜像策略,如下所示:
- 看到我们指定 ha-params 2 ,这意味着其他两个节点的镜子,还是总共2个节点或3个节点?
- 这与以下我们刚刚指定所有的情况相同,因为只有3个节点?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
2 2 的计数值表示 2 replicas :1队列领导者和1个队列镜。换句话说:
numberFqueeMirrors = numberOfnodes -1
。挖掘更多详细信息:
A count value of 2 means 2 replicas: 1 queue leader and 1 queue mirror. In other words:
NumberOfQueueMirrors = NumberOfNodes - 1
.to dig more details: https://www.rabbitmq.com/ha.html#mirroring-arguments
深入研究更深入的了解,我可以看到指定 ha-params 作为 2 将意味着总共2个节点会被镜像,因此其中一个节点不会是!这与 all 一个都不一样,因为这与所有节点相吻合,这对我目前更有意义。
Delving deeper and with a bit more understanding I can see that specifying ha-params as 2 will mean that a total of 2 nodes will be mirrored, so one of the nodes wont be! It's no the same as the all one, as that would mirror to all nodes, which would make more sense to me currently.
使用 ha-mode 恰好和 ha-params 作为 2 ,将在2个节点上启用镜像/复制在集群中(包括领导者)。如果在这种情况下添加了一个新节点,则仅在2个节点上继续复制。
另一方面,使用 ha-mode 作为所有,将在群集中的所有节点上启用镜像/复制。在这里,如果将新节点添加到群集中,则在新节点上也将开始复制。
您可以在此处阅读有关经典镜像队列的更多信息 - https> https:///wwwwww.rabbitmq。 com/doc/3.13/ha#镜像 - arguments
此外,经典镜像队列已在最新版本的RabbitMQ中弃用。一种现代的方法是使用法定人数 - https://wwww.rabbitmq.com/docs/quorumq.com/quorumquorumquorumquorum - 标题
With ha-mode as exactly and ha-params as 2, mirroring/replication will be enabled across 2 nodes in the cluster (including the leader). If a new node is added in this case, replication will continue to happen only on 2 nodes.
On the other hand, with ha-mode as all, mirroring/replication will be enabled across all the nodes in the cluster. Here, if a new node is added to the cluster, replication will also start happening on the new node.
You can read more about Classic Mirrored Queues here - https://www.rabbitmq.com/docs/3.13/ha#mirroring-arguments
Moreover, Classic Mirrored Queues have been deprecated in the latest version of RabbitMQ. A modern approach is to use Quorum Queues - https://www.rabbitmq.com/docs/quorum-queues