RabbitMQ脑裂处理

脑裂现象:

Network partition detected
Mnesia reports that this RabbitMQ cluster has experienced a network partition. There is a risk of losing data. Please read RabbitMQ documentation about network partitions and the possible solutions.

 

转载请在文章开头附上原文链接地址:https://www.cnblogs.com/Sunzz/p/13632322.html

  官网问题的链接是: https://www.rabbitmq.com/partitions.html

 查看集群状态

 可以看到133服务器已经分裂出去了

在脑裂的服务上查看集群状态

使用上的问题:

消息会翻倍,在两个集群上均存在消息,不过不用担心,带集群恢复后,message_ready会自动消除

 

解决方法: 

  修改配置文件: /etc/rabbitmq/rabbitmq.config

[
  {
    rabbit,
      [
        {loopback_users, []},
        {cluster_partition_handling, pause_minority}
      ]
  }
].

 

posted @ 2022-12-31 10:20  Sunzz  阅读(201)  评论(0编辑  收藏  举报