Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is redis cluster brain fissure? How to solve it?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

What is redis cluster schisencephaly?

Redis cluster brain split refers to network problems, resulting in redis master node and redis slave node and sentinel cluster in different network partitions, at this time because sentinel cluster can not sense the existence of master node, so the slave node will be promoted to master node.

There are two different master nodes, just like a brain splitting into two.

In the cluster brain split problem, if the client continues to write data based on the original master node, then the new master node will not be able to synchronize these data. When the network problem is solved, the sentinel cluster will reduce the original master node to a slave node, and then synchronize the data from the new master node, which will cause a lot of data loss.

solutions

There are two parameters in the redis configuration file

min-slaves-to-write 3

min-slaves-max-lag 10

The first parameter indicates the minimum number of slaves connected to the master

The second parameter indicates the maximum latency for slave to master connections

If the number of slaves connected to the master is less than the first parameter, and the ping delay time is less than or equal to the second parameter, then the master will reject the write request. After configuring these two parameters, if the cluster brain split occurs, the original master node will reject the write request received by the client, which can reduce the data loss after data synchronization.

Note: The parameters in the redis.conf file in newer versions change to

min-replicas-to-write 3

min-replicas-max-lag 10

The data loss problem in asynchronous replication cases in redis can also use these two parameters

The above is the detailed content of how many nodes redis split brain, please pay more attention to other related articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report