为了提高消息传递交付的可用性,rabbitMQ有几种集群的方案,不同的方案有不同的优缺点
1、普通的集群
rabbitMQ中的exchange和queue都包含meta、contents、state等信息,exchange在集群中的每个节点都保存一份数据,
但是queue不一样,queue在集群中对于contents只存储一份,其他节点只存储meta信息
为什么只在一个节点存储queue的contents,官方是这么说的:
a、 Storage space—If every cluster node had a full copy of every queue, adding nodes
wouldn’t give you more storage capacity. For example, if one node could store
1 GB of messages, adding two more nodes would just give you two more copies
of the same 1 GB of messages.
b、 Performance—Publishing messages would require replicating those messages to
every cluster node. For durable messages, that would require triggering disk
activity on all nodes for every message. Your network and disk load would
increase every time you added a node, keeping the performance of the cluster
the same (or possibly worse).
主备方式(active,passive)只有一个节点处于服务状态,可以结合pacemaker和ARBD,
shovel简单从一个broker的一个队列中消费消息,且转发该消息到另一个broker的交换机。
这两种方式用的比较少,这里就不做介绍了。
本文探讨了RabbitMQ的三种集群方案:普通集群、镜像队列(mirror queue)和其他方式(如active/passive和shovel)。普通集群在提高吞吐量方面表现较好但在高可用性方面较弱;镜像队列通过数据冗余提高了高可用性但牺牲了一部分性能;而active/passive和shovel方式则用于特定场景。
995

被折叠的 条评论
为什么被折叠?



