<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>> Date: Wed, 11 Dec 2013 10:32:00 +0000<br>> From: simon@rabbitmq.com<br>> To: rabbitmq-discuss@lists.rabbitmq.com<br>> CC: joshua__lim@hotmail.com<br>> Subject: Re: [rabbitmq-discuss] How to create a rabbitmq cluster using existing application without losing existing data?<br>> <br>> On 11/12/13 10:26, Joshua Lim wrote:<br>> > I'm trying to find out if it is possible to create a rabbitmq cluster<br>> > for an existing production instance with data on it.<br>> <br>> Yes.<br>> <br>> > The reason is<br>> > because I'm starting with only 1 server for the start and would like to<br>> > expand to a 2 server cluster only in the future.<br>> <br>> Which makes sense.<br>> <br>> > What I did is:<br>> ><br>> > 1. Issue rabbitmqctl stop_app, rabbitmqctl reset, rabbitmqctl stop on<br>> > both nodes.<br>> <br>> rabbitmqctl reset is the culprit here - it will erase all information on <br>> the node.<br>> <br>> > 2. Add auto-config to rabbitmq.config on both nodes:   {cluster_nodes,<br>> > {['rabbit@existing-machine', 'rabbit@new-machine'], disc}}<br>> <br>> Note that the auto-config lists nodes in an existing cluster that the <br>> machine should attempt to contact when coming up from a new installation <br>> (or post reset). And a standalone node is a cluster of size one.<br>> </div><div><span style="font-size: 12pt;">> So what you really wanted to do was:</span></div><div>> <br>> * Not touch existing-machine<br>> * Add {cluster_nodes, {['rabbit@existing-machine'], disc}} to new-machine<br>> * Reset new-machine if you've previously used RabbitMQ on it<br>> * Start new-machine</div><div><br></div><div><div>Thanks for your pointers, this now works.  :) </div><div><br></div><div>I was a bit confused by the 3 node example (see config below) mentioned in <a href="http://www.rabbitmq.com/clustering.html" target="_blank" style="font-size: 12pt;">http://www.rabbitmq.com/clustering.html</a>  That's why I put all the nodes into cluster_nodes field.</div><div><br></div><div>{cluster_nodes, {['rabbit@rabbit1', 'rabbit@rabbit2', 'rabbit@rabbit3'], disc}},</div></div><div><br></div><div>How about the <span style="font-size: 12pt;">cluster_nodes configuration field </span><span style="font-size: 12pt;">on existing machine</span><span style="font-size: 12pt;">?  I left it as </span><span style="font-size: 12pt;">{cluster_nodes,</span><span style="font-size: 12pt;"> {['rabbit@existing-machine', 'rabbit@new-machine'], disc}}</span></div><div><span style="font-size: 12pt;"><br></span></div><div>Is that the correct way?  I need active-active ha.  By the way, I've not gone into <a href="http://www.rabbitmq.com/ha.html" target="_blank">http://www.rabbitmq.com/ha.html</a> yet.<br><div><br></div></div>                                          </div></body>
</html>