Answer the question
In order to leave comments, you need to log in
How does RabbitMQ replication align with load balancing?
Hello.
I smoked the manuals for setting up the RabbitMQ HA cluster and something does not add up to the whole picture in my head.
Maybe someone will be able to clarify such issues. they are not described in detail in the manuals:
If you enable mirroring of queues between nodes, then it turns out that one node is the master, and the others are mirrors, and the manuals indicate that all changes first occur on the master and then are already replicated to the slaves.
Hence the questions:
- Is the master slave the level of nodes or queues? In the sense that we can start part of the master queues on one node, and part on another, or do we have all the queues on one master, and on all other nodes only replicas of these queues?
- If the changes are first written to the master, can we, for example, connect and post or receive messages from the slave? If we can, then how is the data synchronized with the master if the changes must first occur on the master and then on all slaves? Or does the slave, if it sees that the master queue is not with it, proxies the request to the master? Or how? How can all this work behind the HAProxy balancer, which stupidly proxies requests to all nodes indiscriminately, that is, the client can attach itself to both the master and the mirror?
Answer the question
In order to leave comments, you need to log in
1) Queue level, queue masters can be on different nodes, here it is described how you can influence the process of choosing a master.
2) You can send / receive messages from any node, even if there is neither a master nor a slave of this queue on it, RabbitMQ itself will ask where you need it (correspondingly, introducing some delays into the request). To work through HAProxy, the latest versions have support for the PROXY protocol, so that in the management console you can see the real addresses of clients, and not proxy addresses.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question