Setting Up Mirrored Queues
You can configure mirroring using policy.
Example: mirror all queues across all nodes.
rabbitmqctl set_policy ha-all ".*" '{"ha-mode":"all"}'
Options for ha-mode
:
all
: mirror across all nodes.exactly
: mirror to an exact number of nodes.nodes
: mirror to specific nodes.
Best Practices
- Use clustering for scaling connections.
- Use mirrored queues or quorum queues for durability.
- Prefer quorum queues for new deployments (more predictable, Raft-based).
- Always monitor your cluster health with RabbitMQ management tools.
- Use HAProxy or Load Balancer in front of your cluster.
Conclusion
RabbitMQ offers strong support for high availability.
- Clustering keeps nodes working together but does not protect queue data by itself.
- Mirrored queues (or better, quorum queues) replicate data across nodes, making sure no messages are lost if one node fails.
If you want simple scaling and load balancing, clustering is enough.
If you need true fault tolerance and no message loss, use quorum queues.
Pages: 1 2
Category: RabbitMQ