-
Book Overview & Buying
-
Table Of Contents
RabbitMQ Cookbook
By :
In the Mirroring queues recipe, we have seen how to mirror a queue across all the nodes in the cluster. Replicating messages on more than two nodes improves the system availability minimally, but if the cluster grows because of the higher load, it will negatively impact the application's performance. In this recipe we'll show you how to distribute each queue to a pair of nodes, in order to have two copies for each queue as follows:

In this way, each queue has one master and one slave.
You need a RabbitMQ cluster with mirror policies (refer to the Mirroring queues recipe).
In this recipe we have used four machines; let's see the steps in detail:
Create a RabbitMQ cluster with four nodes named rabbit@rabbitmqc1, rabbit@rabbitmqc2, rabbit@rabbitmqc3, and rabbit@rabbitmqc4. The following screenshot shows our cluster in action:

Create an ha-policy using the following code:
"mirr-pair" as name, "^pair\."as pattern "ha-mode":"exactly" "ha-params...
Change the font size
Change margin width
Change background colour