没有设置镜像策略的 HA RabbitMQ [英] HA RabbitMQ without set mirror policy

查看:47
本文介绍了没有设置镜像策略的 HA RabbitMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用集群和镜像队列为 rabbitmq 建立了关于 ha 的实验室.我正在使用 centos 7 和 rabbitmq-server 3.3.5.三台服务器(ha1、ha2、ha3).

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).

我刚刚将 ha1 和 ha2 加入到 ha3,但没有为镜像队列设置策略.当我在 ha1 服务器上测试创建名为hello"的队列时,在使用 rabbitmqctl 列表队列检查 ha2 和 ha3 后,集群上的所有节点上都存在 hello 队列.

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

推荐答案

在 rabbitmq 中,默认情况下,一个队列只存储到一个节点.创建集群时,队列可跨节点使用.

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.

假设给节点创建一个队列,队列会一直工作到节点up,如下:

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

这篇关于没有设置镜像策略的 HA RabbitMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆