惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security @ Cisco Blogs
罗磊的独立博客
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
美团技术团队
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
博客园 - Franky
G
Google Developers Blog
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
腾讯CDC
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements
博客园 - 叶小钗
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
L
LangChain Blog
Vercel News
Vercel News
Forbes - Security
Forbes - Security
PCI Perspectives
PCI Perspectives
N
News | PayPal Newsroom
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
J
Java Code Geeks
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hacker News: Ask HN
Hacker News: Ask HN
Schneier on Security
Schneier on Security
A
About on SuperTechFans
Attack and Defense Labs
Attack and Defense Labs
Google Online Security Blog
Google Online Security Blog
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Cloudbric
Cloudbric
B
Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic

博客园 - Don

在Chrome中调试Android微信浏览器中的网页,不出现供选择页面的怎么办?(chrome://inspect/#devices) 使用Crontab集合sh脚本自动删除过期的Confluence Docker容器中的备份文件 Docker PHP中安装gd扩展并生成图形验证码 解决命令行提示“cannot create temp file for here-document: No space left on device”但磁盘使用率并未满的问题 SSH登录后提示LC_ALL: cannot change locale (en_US.UTF8) 的解决办法 解决git操作一直要求输入用户名和密码的问题 CentOS如何增加虚拟内存 zookeeper日志定时清理 Alibaba Centos ECS 安全更新记录 AWS EC2配置CloudWatch 记录AWS Linux2 的yum安全更新步骤 记录Docker系统盘空间占用过大的解决方法 AWS EC2 EBS数据盘挂载与相关日常维护操作 AWS Amazon Linux2 安装Docker和Docker Compose [转]提升 Docker Desktop For macOS 磁盘使用率 AndroidGetAPKInfo --- 检查包名(packageName)、版本(versionName\versionCode)、应用签名(Signature)等信息 - Don OpenSSL命令—pkcs12 Linux下User与Group的常用操作命令解析 Docker搭建openvpn - Don
RabbitMQ集群脑裂故障处理
Don · 2022-09-20 · via 博客园 - Don

网络抖动或故障均可能会导致RabbitMQ集群发生脑裂故障,在不同节点的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. 

此时集群的节点与节点间通讯失败了,但是各自都能独立提供服务,这种情况也可能导致数据处理出现异常。

故障分析与处理:

分别到集群各个节点上,执行rabbitmqctl cluster_status命令,查看RabbitMQ集群信息。

注意看partitions值为空数组,意思是集群网络没有分区:

# rabbitmqctl cluster_status
Cluster status of node rabbit1@mqcluster ...
[{nodes,[{disc,[rabbit1@mqcluster,rabbit2@mqcluster]}]},
{running_nodes,[rabbit1@mqcluster,rabbit2@mqcluster]},
{partitions,[]}]

脑裂故障发生时partitions值非空,意思是集群网络出现分区:

# rabbitmqctl cluster_status
Cluster status of node rabbit1@mqcluster ...
[{nodes,[{disc,[rabbit1@mqcluster,rabbit2@mqcluster]}]},
{running_nodes,[rabbit1@mqcluster,rabbit2@mqcluster]},
{partitions,[{rabbit1@mqcluster,[rabbit2@mqcluster]},{rabbit2@mqcluster,[rabbit1@mqcluster]}]}]

参考网上的一些解决方案后,处理如下:

在出现以上网络分区问题的节点上执行: 

rabbitmqctl stop_app

rabbitmqctl start_app

注意:mq集群不能采用kill -9 杀死进程,否则生产者和消费者不能及时识别mq的断连,会影响生产者和消费者正常的业务处理。 

---------------

脑裂后自动修复的方法
修改节点的配置文件
在/etc/rabbitmq下新建rabbitmq.conf,加入:

[
  {
    rabbit,
   	[
   	  {tcp_listeners,[5672]},
   	  {cluster_partition_handling, autoheal}
   	]
  }
]

若已有配置文件,则直接添加{cluster_partition_handling, autoheal}配置,详情介绍可去官网搜索。

然后重启RabbitMQ:systemctl restart rabbitmq-server

参考:https://www.cnblogs.com/liyongsan/p/9640361.html