[rabbitmq-discuss] How to create a rabbitmq cluster using existing application without losing existing data?

Joshua Lim joshua__lim at hotmail.com
Thu Dec 12 16:34:26 GMT 2013


> Date: Wed, 11 Dec 2013 10:32:00 +0000
> From: simon at rabbitmq.com
> To: rabbitmq-discuss at lists.rabbitmq.com
> CC: joshua__lim at hotmail.com
> Subject: Re: [rabbitmq-discuss] How to create a rabbitmq cluster using existing application without losing existing data?
> 
> 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
Thanks for your pointers, this now works.  :) 
I was a bit confused by the 3 node example (see config below) mentioned in http://www.rabbitmq.com/clustering.html  That's why I put all the nodes into cluster_nodes field.
{cluster_nodes, {['rabbit at rabbit1', 'rabbit at rabbit2', 'rabbit at rabbit3'], disc}},
How about the cluster_nodes configuration field on existing machine?  I left it as {cluster_nodes, {['rabbit at existing-machine', 'rabbit at new-machine'], disc}}
Is that the correct way?  I need active-active ha.  By the way, I've not gone into http://www.rabbitmq.com/ha.html yet.

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131212/4586d834/attachment.html>


More information about the rabbitmq-discuss mailing list