Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the sentinel drift caused by redis flushdb?

Shulou Source: shulou.com Published: 2022-05-31 14:17:10 10月26日 Update

Today, I would like to talk to you about the sentinel drift caused by redis flushdb, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something from this article.

Found that the amount of redis data is too large, the data is not normal, and R & D discussed the use of flushall to clean up. After execution on the master node, it is found that the master drifts to other nodes, and then the data is synchronized from other nodes. So execute flushall on three machines at the same time, and then check and find that the data has been cleaned up and the state of the redis cluster is normal.

According to the analysis, due to the large amount of data, the time of flushall takes nearly 6 seconds, and it is blocked. Because the sentry cannot connect in 3s, the master node will be re-elected, resulting in master drift.

Solution: 1. Execute flushall operation on three machines at the same time.

2. Stop the Sentinel, perform flushall on the master node, and then start the Sentinel

3. Restart redis in turn. After shutting down, you need to clean up rdb data. (this operation has not been performed, there is also a problem of data writeback, and it may be risky to stop the sentinel to cooperate.)

After reading the above, do you have any further understanding of the sentinel drift caused by redis flushdb? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Data sentry node content larger at the same time machine three sets not big method time is in more status knowledge articles industry information information channels questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Docker Huawei Shulou Technology MariaDB