I am new to RabbitMQ, so please excuse me for asking some trivial questions:
When running a RabbitMQ cluster, if a node fails the load shifts to another node (without stopping the other nodes). Similarly, we can also add new nodes to the existing cluster without stopping existing nodes in the cluster. Is that correct?
Assume that we start with a single RabbitMQ node, and create 100 queues on it. Now let's say that producers start sending messages at a faster rate. To handle this load, we add more nodes and make a cluster. But queues exist on the first node only. How does the load get balanced among nodes now? And if we need to add more queues, on which node should we add them? Or can we add them using the load balancer?
- When running a RabbitMQ cluster, if a node fails the load shifts to another node (without stopping the other nodes). Similarly, we can also add new nodes to the existing cluster without stopping existing nodes in the cluster. Is that correct?
If a node on which the queue was created fails, RabbitMQ will elect a new master for that queue in the cluster as long as mirroring for the queue is enabled. Clustering provides high availability (HA) based on a policy that you can define.
- Assume that we start with a single RabbitMQ node, and create 100 queues on it. Now let's say that producers start sending messages at a faster rate. To handle this load, we add more nodes and make a cluster. But queues exist on the first node only. How does the load get balanced among nodes now?
The load is not balanced. The distributed cluster provides high availability and not load balancing. Your requests will be redirected to the node in the cluster on which the queue resides.
And if we need to add more queues, on which node should we add them? Or can we add them using the load balancer?
That depends on your use case. Some folks use a round robin and create queues on separate nodes.