[rabbitmq-discuss] Balancing Queues across nodes in a cluster

Simon MacMullen simon at rabbitmq.com
Thu May 16 13:45:40 BST 2013


On 15/05/13 20:02, Cordell, Ron L wrote:
> We are using RabbitMQ 3.0.1 in a cluster behind an F5 load balancer.

<snip>

> My question is around balancing node resources. If a queue becomes
> somewhat busy, can I move make a different node master for that queue
> (assuming a mirrored queue)? I don’t want to take down the node as I
> have other queues on that node; I just want to move the master for a
> particular queue, if possible.

Not with 3.0.x. This was fixed in 3.1.x.

If you want to control exactly which nodes a queue is on, you need the 
"nodes" policy.

With 3.0.x if you set a "nodes" policy such that a queue should change 
masters, it won't. Any old slaves will go down, and new slaves will come 
up, but the master won't change. This is to avoid losing messages if the 
new master wasn't synchronised (or even a slave) before the change.

With 3.1.x we are a bit smarter. Now if you set a "nodes" policy such 
that the master should change, it will do so immediately if one of the 
new mirrors was previously a synchronised slave. If not, the old master 
will stick around until one of the new mirrors becomes synchronised, 
then it will vanish.

See '"nodes" policy and migrating masters' under 
http://www.rabbitmq.com/ha.html#genesis

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list