[rabbitmq-discuss] How to create a rabbitmq cluster using existing application without losing existing data?
Simon MacMullen
simon at rabbitmq.com
Wed Dec 11 10:32:00 GMT 2013
On 11/12/13 10:26, Joshua Lim wrote:
> I'm trying to find out if it is possible to create a rabbitmq cluster
> for an existing production instance with data on it.
Yes.
> The reason is
> because I'm starting with only 1 server for the start and would like to
> expand to a 2 server cluster only in the future.
Which makes sense.
> What I did is:
>
> 1. Issue rabbitmqctl stop_app, rabbitmqctl reset, rabbitmqctl stop on
> both nodes.
rabbitmqctl reset is the culprit here - it will erase all information on
the node.
> 2. Add auto-config to rabbitmq.config on both nodes: {cluster_nodes,
> {['rabbit at existing-machine', 'rabbit at new-machine'], disc}}
Note that the auto-config lists nodes in an existing cluster that the
machine should attempt to contact when coming up from a new installation
(or post reset). And a standalone node is a cluster of size one.
So what you really wanted to do was:
* Not touch existing-machine
* Add {cluster_nodes, {['rabbit at existing-machine'], disc}} to new-machine
* Reset new-machine if you've previously used RabbitMQ on it
* Start new-machine
It should then join the existing machine.
Cheers, Simon
--
Simon MacMullen
RabbitMQ, Pivotal
More information about the rabbitmq-discuss
mailing list