Skip to content

Amazon MQ cluster classic queues with ha-mode exactly 2

0

We have a a Rabbitmq cluster with AmazonMQ and three nodes where we set our custom policies with Terraform. We wanted to change the ha-mode from all to exactly 2 because according to the documentation:

Mirroring to all nodes is the most conservative option. It will put additional strain on all cluster nodes, including network I/O, disk I/O and disk space usage. Having a replica on every node is unnecessary in most cases. For clusters of 3 and more nodes it is recommended to replicate to a quorum (the majority) of nodes, e.g. 2 nodes in a 3 node cluster or 3 nodes in a 5 node cluster. Since some data can be inherently transient or very time sensitive, it can be perfectly reasonable to use a lower number of mirrors for some queues (or even not use any mirroring).

It doesn't seem to work. And probably because AWS adds custom values:

Note In cluster deployments, ha-mode and ha-sync-mode broker policies are required for classic mirroring and high availability (HA).

If you delete the default AWS-DEFAULT-POLICY-CLUSTER-MULTI-AZ policy, Amazon MQ uses the ha-all-AWS-OWNED-DO-NOT-DELETE policy with a priority value of 0. This ensures that the required ha-mode and ha-sync-mode policies are still in effect. If you create your own custom policy, Amazon MQ automatically appends ha-mode and ha-sync-mode to your policy definitions.

Is there any way to change this mode?

asked a year ago189 views
1 Answer
2

Unfortunately, it is not possible to change the ha-mode from "all" to "exactly 2" in Amazon MQ for RabbitMQ cluster deployments. Amazon MQ enforces specific high availability (HA) policies for cluster brokers to ensure proper mirroring and high availability.

For cluster deployments, Amazon MQ automatically applies the "ha-mode: all" and "ha-sync-mode: automatic" policy definitions. This is a requirement for classic mirroring and high availability in Amazon MQ managed RabbitMQ clusters.

Even if you attempt to create a custom policy with different ha-mode settings, Amazon MQ will automatically append the required "ha-mode: all" and "ha-sync-mode: automatic" to your policy definitions. This behavior is intentional to maintain the high availability guarantees that Amazon MQ provides for RabbitMQ clusters.

If you delete the default "AWS-DEFAULT-POLICY-CLUSTER-MULTI-AZ" policy, Amazon MQ will fall back to using the "ha-all-AWS-OWNED-DO-NOT-DELETE" policy with a priority value of 0. This ensures that the required HA policies remain in effect.

While it's understandable that you want to optimize your cluster based on RabbitMQ's general recommendations, Amazon MQ's managed service takes a more conservative approach to ensure maximum availability and data durability across all nodes in the cluster.

If you have specific performance concerns or requirements, you may want to consider other queue types or configurations within the constraints of Amazon MQ's managed service. Alternatively, you could explore using RabbitMQ's quorum queues, which are designed for better performance and scalability in distributed systems, if they meet your use case requirements.
Sources
Applying policies to Amazon MQ for RabbitMQ - Amazon MQ
Amazon MQ for RabbitMQ broker defaults - Amazon MQ

answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.