简体   繁体   English

Rabbitmq镜像队列如何工作?

[英]How does rabbitmq mirrored queue works?

If I'm about to create a mirrored queue in a node within a cluster and create mirrors in some other nodes in the same cluster. 如果要在集群中的节点中创建镜像队列,并在同一集群中的其他一些节点中创建镜像。 Suppose I hit the ip address(or make use of queue name) of that master queue every time I send the message to the queue and if the master node fails will the message will be sent to the oldest mirrored queue by hitting the same ip address(or queue name)? 假设我每次将消息发送到该队列时都命中该主队列的IP地址(或使用队列名称),并且如果主节点失败,则通过命中相同的IP地址将消息发送到最早的镜像队列(或队列名称)?

RabbitMQ will not automagically failover a slave node to the same IP address of the (previous) master. RabbitMQ不会自动将从节点故障转移到(先前)主节点的相同IP地址。 The IP address of the broker is provided by the host O/S (either statically or via DHCP), and RabbitMQ can't do much about it. 代理的IP地址由主机O / S提供(静态或通过DHCP),RabbitMQ对此无能为力。

You can setup a kind of failover yourself, with normal IT means or failing over servers. 您可以使用正常的IT手段或对服务器进行故障转移来自行设置一种故障转移。

Alternatively, some RabbitMQ client libraries or wrappers support multiple hosts, and will send messages to a secondary broker if they detect that the master is unreachable. 另外,某些RabbitMQ客户端库或包装器支持多个主机,如果它们检测到主服务器不可达,则会将消息发送到辅助代理。 You can also code such behavior yourself. 您也可以自己编写此类行为的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM