HA RabbitMQ without set mirror policy

混江龙づ霸主 提交于 2019-12-25 08:48:39

问题


I set up lab about ha for rabbitmq using cluster and mirror queue. I am using centos 7 and rabbitmq-server 3.3.5. with three server (ha1, ha2, ha3).

I have just joined ha1 and ha2 to ha3, but do not set policy for mirror queue. When I test create queue with name "hello" on ha1 server, after i check on ha2, and ha3 using rabbitmqctl list queue, hello queue is exist on all node on cluster.

I have a question, why i do not set policy to mirror queue on cluster, but it automatic mirror queue have been created on any node on cluster?

Please give me advice about I have mistake or only join node on cluster, queue will be mirror on all node of cluster. Thanks


回答1:


In rabbitmq , by default, one queue is stored only to one node. When you create a cluster, the queue is available across nodes.

But It does't mean that the queue is mirrored, if the node gets down the queue is marked as down and you can't access.

Suppose to create one queue to the node, the queue will work until the node is up, as:

if the node is down you will have:

you should always apply the mirror policy, otherwise you could lose the messages



来源:https://stackoverflow.com/questions/36328510/ha-rabbitmq-without-set-mirror-policy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!