[rabbitmq-discuss] Moving a queue from one node to another

Matthew Sackman matthew at rabbitmq.com
Tue Feb 28 11:21:55 GMT 2012


Hi Ionel,

On Mon, Feb 27, 2012 at 07:25:41PM +0000, Ionel Gog wrote:
> Is there any way I can move queues from one RabbitMQ node to another?

Nope, sorry, not an individual queue.

> - Mirrored queues. But I don't think you can make a queue mirrored *after*
> it has been created. Can you?

No, you can't do that.

> - Shared network disk. But this requires a broker restart - and thus
> implies loosing all non-durable queues and non-persistent messages.
> 
> Is there any other way?

I would suggest something along the lines of the following.

- bring up the new broker. Do not cluster it.
- declare all the exchanges/bindings/queues you need on the new broker
  - i.e. have the topology match exactly
- change all publishers to be publishing to the new broker
- wait for all messages to be drained from the old broker, and then
  switch over all consumers to be consuming from the new broker
- shut down the old broker

In general, whilst this does require manual intervention, and will
certainly require thought especially if your consumers also publish
messages (you'll want to abstract those connections out and generally
start the switchover from the top of the message flow to the bottom),
this process does allow you to upgrade Rabbits with no downtime at all,
though potentially with some service disruption.

Matthew


More information about the rabbitmq-discuss mailing list