<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hello Cameron:<br>
<br>
To resolve any confusion, let me make a table to clarify. I DO have "x-ha-policy" set to "all"<br>
<br>
Steps | vm1 | vm2<br>
------------------------------------------------------------------------------<br>
1. | started (10 msg, disk, master) | started (10 msg, disk)<br>
2. | stop | started (10 msg, disk, became master)<br>
3. | started (10 msg, disk, slave) | started (10 msg, disk, master)<br>
4. | started (0 msg, disk, master) | stop<br>
<br>
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.<br>
<br>
Thanks for your help.<br>
<br>
Jeffrey.<br><br><div>> From: cameron.davison@gmail.com<br>> Date: Mon, 21 Nov 2011 23:46:24 -0600<br>> Subject: Re: [rabbitmq-discuss] active/active message persistence problem<br>> To: cpthk@hotmail.com<br>> CC: rabbitmq-discuss@lists.rabbitmq.com<br>> <br>> What order are you restarting the nodes? Any rabbitmq server that<br>> connects to a cluster will start its queue fresh and begin replicating<br>> from the master. You should wait and make sure that all the queues are<br>> synchronized before you shut down the master, or new master. Old<br>> messages are not read from nodes that connect to the cluster because<br>> the assumption is that the queue will go to 0 soon and then the old<br>> messages will not matter so only the new messages will be important.<br>> Also, you should make sure that the "x-ha-policy" is set to "all" or<br>> to the "nodes" that you would like the queue to be mirrored to.<br>> <br>> Cameron<br>> <br>> On Mon, Nov 21, 2011 at 7:14 PM, Jeffrey Chen <cpthk@hotmail.com> wrote:<br>> > Hi RabbitMQ community:<br>> ><br>> > I am encounter this problem about message persistence. Here is my case, I<br>> > have 2 server nodes with active/active setup, both are persisted to DISK.<br>> > The queue declarations are defined as durable.<br>> > This is what I got when doing:<br>> ><br>> > # rabbitmqctl cluster_status<br>> > Cluster status of node 'rabbit@aaron-vm177' ...<br>> > [{nodes,[{disc,['rabbit@vm1','rabbit@vm2']}]},<br>> > {running_nodes,['rabbit@vm1','rabbit@vm2']}]<br>> > ...done.<br>> ><br>> > # rabbitmqctl list_queues<br>> > Listing queues ...<br>> > test 10<br>> > ...done.<br>> ><br>> ><br>> > My vm1 is currently master node. When I stop RabbitMQ service in vm1, and<br>> > start it back up. I check my messages in the queue, the messages are still<br>> > there. This time when I stop RabbitMQ service in vm2. The messages will be<br>> > gone. It seems like when I restart both server nodes, the data will be lost.<br>> > Does anyone know the reason? Is there any way to work around this?<br>> ><br>> > My goal is that any server nodes down, and when I bring it back up, no data<br>> > will be lost.<br>> ><br>> > Jeffrey.<br>> ><br>> > _______________________________________________<br>> > rabbitmq-discuss mailing list<br>> > rabbitmq-discuss@lists.rabbitmq.com<br>> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br>> ><br>> ><br></div>                                            </div></body>
</html>