当前位置:网站首页>Redis cluster (master-slave) brain crack and solution
Redis cluster (master-slave) brain crack and solution
2022-07-05 11:44:00 【We've been on the road】
1 Cluster cleft brain
redis The cluster brain crack refers to the network problem , Lead to redis master The node follows redis slave Nodes and sentinel Clusters are in different network partitions , At this time because sentinel The cluster cannot perceive master The existence of , So will slave The node is promoted to master node . There are two different master node , It's like one brain split into two .
In the cluster cleft problem , If the client is still based on the original master The node continues to write data , So new master Nodes will not be able to synchronize this data , When the network problem is solved ,sentinel The cluster will be the original master The node is reduced to slave node , Now it's time to start again master Data synchronization in , It will cause a lot of data loss .
2 Solution
redis In the configuration file , There are two parameters :
min-slaves-to-write 3 min-slaves-max-lag 10
- The first parameter indicates the connection to master At least slave Number
- The second parameter represents slave Connect to master Maximum delay time
Follow the above configuration , At least 3 individual slave node , And the delay of data replication and synchronization cannot exceed 10 second , Otherwise master Will refuse to write the request , After configuring these two parameters , If cluster cleft occurs , The original master When the node receives a write request from the client, it will reject , Data loss after data synchronization can be reduced .
Be careful : Newer versions of redis.conf The parameters in the file become
min-replicas-to-write 3 min-replicas-max-lag 10
redis These two parameters can also be used for data loss in the case of asynchronous replication in .
</article>
边栏推荐
- redis 集群模式原理
- Is it difficult to apply for a job after graduation? "Hundreds of days and tens of millions" online recruitment activities to solve your problems
- 管理多个Instagram帐户防关联小技巧大分享
- 分类TAB商品流多目标排序模型的演进
- Question and answer 45: application of performance probe monitoring principle node JS probe
- C#实现WinForm DataGridView控件支持叠加数据绑定
- Go language learning notes - first acquaintance with go language
- Proof of the thinking of Hanoi Tower problem
- MySQL statistical skills: on duplicate key update usage
- 12.(地图数据篇)cesium城市建筑物贴图
猜你喜欢
紫光展锐全球首个5G R17 IoT NTN卫星物联网上星实测完成
12.(地图数据篇)cesium城市建筑物贴图
iTOP-3568开发板NPU使用安装RKNN Toolkit Lite2
How to make your products as expensive as possible
Cdga | six principles that data governance has to adhere to
XML解析
The ninth Operation Committee meeting of dragon lizard community was successfully held
分类TAB商品流多目标排序模型的演进
高校毕业求职难?“百日千万”网络招聘活动解决你的难题
《增长黑客》阅读笔记
随机推荐
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
《增长黑客》阅读笔记
Guys, I tested three threads to write to three MySQL tables at the same time. Each thread writes 100000 pieces of data respectively, using F
CDGA|数据治理不得不坚持的六个原则
An error is reported in the process of using gbase 8C database: 80000305, host IPS long to different cluster. How to solve it?
跨境电商是啥意思?主要是做什么的?业务模式有哪些?
Implementation of array hash function in PHP
无线WIFI学习型8路发射遥控模块
Redis集群(主从)脑裂及解决方案
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
【TFLite, ONNX, CoreML, TensorRT Export】
Splunk configuration 163 mailbox alarm
Unity Xlua MonoProxy Mono代理类
Dynamic SQL of ibatis
Zcmu--1390: queue problem (1)
Redis如何实现多可用区?
Cdga | six principles that data governance has to adhere to
redis 集群模式原理
liunx禁ping 详解traceroute的不同用法
Pytorch MLP