当前位置:网站首页>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>
边栏推荐
- 中非 钻石副石怎么镶嵌,才能既安全又好看?
- AutoCAD -- mask command, how to use CAD to locally enlarge drawings
- redis 集群模式原理
- pytorch-多层感知机MLP
- Is it difficult to apply for a job after graduation? "Hundreds of days and tens of millions" online recruitment activities to solve your problems
- Web API configuration custom route
- Risc-v-qemu-virt in FreeRTOS_ Scheduling opportunity of GCC
- 龙蜥社区第九次运营委员会会议顺利召开
- ACID事务理论
- 【SingleShotMultiBoxDetector(SSD,单步多框目标检测)】
猜你喜欢
MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
谜语1
7.2 daily study 4
【TFLite, ONNX, CoreML, TensorRT Export】
12.(地图数据篇)cesium城市建筑物贴图
无线WIFI学习型8路发射遥控模块
iTOP-3568开发板NPU使用安装RKNN Toolkit Lite2
Ziguang zhanrui's first 5g R17 IOT NTN satellite in the world has been measured on the Internet of things
XML parsing
How to protect user privacy without password authentication?
随机推荐
中非 钻石副石怎么镶嵌,才能既安全又好看?
871. Minimum Number of Refueling Stops
Ffmpeg calls avformat_ open_ Error -22 returned during input (invalid argument)
12. (map data) cesium city building map
Riddle 1
Is it difficult to apply for a job after graduation? "Hundreds of days and tens of millions" online recruitment activities to solve your problems
Redis集群(主从)脑裂及解决方案
汉诺塔问题思路的证明
Proof of the thinking of Hanoi Tower problem
Prevent browser backward operation
Manage multiple instagram accounts and share anti Association tips
1.php的laravel创建项目
【无标题】
《增长黑客》阅读笔记
Splunk configuration 163 mailbox alarm
C # implements WinForm DataGridView control to support overlay data binding
pytorch-线性回归
百问百答第45期:应用性能探针监测原理-node JS 探针
COMSOL -- establishment of geometric model -- establishment of two-dimensional graphics
Pytorch weight decay and dropout