[rabbitmq-discuss] active/active message persistence problem

Jeffrey Chen cpthk at hotmail.com
Tue Nov 22 06:37:14 GMT 2011


Hello Cameron:



To resolve any confusion, let me make a table to clarify. I DO have "x-ha-policy" set to "all"



  Steps    |   vm1                                       |        vm2

  ------------------------------------------------------------------------------

  1.         |  started (10 msg, disk, master)   |  started (10 msg, disk)

  2.         |  stop                                         |  started (10 msg, disk, became master)

  3.         |  started (10 msg, disk, slave)      |  started (10 msg, disk, master)

  4.         |  started (0 msg, disk, master)     | stop



Noticed that in my step 4, when I stop my VM2, the message in VM1 
immediately disappear. You are right, each step has interval of about 10
 seconds, I didn't wait very long to stop the new master. You mentioned 
that I have to I have to wait until the queues are synchronized. How 
long is that waiting? Is there a command that I could find out if they 
finished the synchronization? Like rabbitmqctl command or anything? Or 
any way to force synchronize right now. I am only testing 10 messages, 
it shouldn't take that long.



Thanks for your help.



Jeffrey.

> From: cameron.davison at gmail.com
> Date: Mon, 21 Nov 2011 23:46:24 -0600
> Subject: Re: [rabbitmq-discuss] active/active message persistence problem
> To: cpthk at hotmail.com
> CC: rabbitmq-discuss at lists.rabbitmq.com
> 
> What order are you restarting the nodes? Any rabbitmq server that
> connects to a cluster will start its queue fresh and begin replicating
> from the master. You should wait and make sure that all the queues are
> synchronized before you shut down the master, or new master. Old
> messages are not read from nodes that connect to the cluster because
> the assumption is that the queue will go to 0 soon and then the old
> messages will not matter so only the new messages will be important.
> Also, you should make sure that the "x-ha-policy" is set to "all" or
> to the "nodes" that you would like the queue to be mirrored to.
> 
> Cameron
> 
> On Mon, Nov 21, 2011 at 7:14 PM, Jeffrey Chen <cpthk at hotmail.com> wrote:
> > Hi RabbitMQ community:
> >
> > I am encounter this problem about message persistence. Here is my case, I
> > have 2 server nodes with active/active setup, both are persisted to DISK.
> > The queue declarations are defined as durable.
> > This is what I got when doing:
> >
> > # rabbitmqctl cluster_status
> > Cluster status of node 'rabbit at aaron-vm177' ...
> > [{nodes,[{disc,['rabbit at vm1','rabbit at vm2']}]},
> >  {running_nodes,['rabbit at vm1','rabbit at vm2']}]
> > ...done.
> >
> > # rabbitmqctl list_queues
> > Listing queues ...
> > test    10
> > ...done.
> >
> >
> > My vm1 is currently master node. When I stop RabbitMQ service in vm1, and
> > start it back up. I check my messages in the queue, the messages are still
> > there. This time when I stop RabbitMQ service in vm2. The messages will be
> > gone. It seems like when I restart both server nodes, the data will be lost.
> > Does anyone know the reason? Is there any way to work around this?
> >
> > My goal is that any server nodes down, and when I bring it back up, no data
> > will be lost.
> >
> > Jeffrey.
> >
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> >
> >
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111121/807ca663/attachment.htm>


More information about the rabbitmq-discuss mailing list