RabbitMq Cluster 和 High Availability


一、RabbitMq Cluster



  • All nodes are connected in pairs
  • users, virtual hosts, exchanges, bindings, queue metadata are automatically mirrored to all Nodes
  • Connect to any Node to see all Queues in the cluster
  • All nodes in the cluster must have the same Erlang cookie
  • Queue messages are only stored in one node
  • If the Consumer connects to Node2 and gets the Queue1 message, Node2 will get the message from Node1 and return it to the Consumer


二、RabbitMq High Availability


  • The mirror queue includes a Master and multiple Mirrors. If the Master dies, the oldest Mirror will be promoted to Master, and the messages that have not been copied from the Master to the Mirrors will be lost.
  • When the Consumer connects to the Mirror node, the Consumer will be redirected to the Master, and the Consumer will only interact with the Master in the end , which ensures the first-in, first-out of messages
  • Mirrored queues only improve high availability without load sharing
  • The newly promoted Master will re-queue the messages that did not receive ack, including the ack message that the old Master did not receive. The Master received the ack, but it was the message that lost the ack when the Master broadcasted to Mirrors. So Consumer may receive duplicate messages.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326362986&siteId=291194637