Andrew
Andrew

Reputation: 2939

RabbitMQ ha-mode all or exactly differences?

We have a cluster with 3 nodes, we currently have the following HA (High Availability) mirror policy as shown below:

enter image description here

  1. Seeing as we specify the ha-params as 2, does this mean mirror to the 2 other nodes, or 2 nodes in total or the 3?
  2. Is this the same as the following where we just specify all, as there are only 3 nodes?

enter image description here

Upvotes: 1

Views: 7775

Answers (3)

Avin
Avin

Reputation: 59

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

Upvotes: 0

mehrdad.f
mehrdad.f

Reputation: 321

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

Upvotes: 3

Andrew
Andrew

Reputation: 2939

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.

Upvotes: 1

Related Questions