In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "sorting out the basic knowledge of redis Sentinel Architecture". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. The introduction of the Sentinel
Sentinel, Chinese is Sentinel.
Sentinel is a very important component of redis cluster architecture, and its main functions are as follows:
(1) Cluster monitoring: responsible for monitoring whether reidis master and slave processes are working properly
(2) message notification: if a redis instance fails, the sentry is responsible for sending a message to the administrator as an alarm notification.
(3) failover: if the master node fails, it will be automatically transferred to the slave node.
(4) configuration Center: if a failover occurs, notify the client client of the new master address
The Sentinel itself is distributed as a Sentinel cluster to run and work together.
(1) during failover, it is necessary to determine that a master node is down, which requires the consent of most sentinels, which involves the issue of distributed election.
(2) even if some of the sentinel nodes are down, the Sentinel cluster can still work properly, because it would be ridiculous if the failover system itself, which is an important part of the high availability mechanism, is a single point. Sentinel2 version is currently used, and sentinel2 rewrites a lot of code compared to sentinel 1, mainly to make the failover mechanism and algorithm more robust and simple.
two。 The core knowledge of Sentinel
(1) Sentinels need at least 3 examples to ensure their robustness.
(2) the deployment architecture of Sentinel + redis master-slave does not guarantee the loss of data 0, but can only ensure the high availability of redis clusters.
(3) for the responsible deployment architecture of Sentinel + redis master-slave, try to conduct adequate tests and drills in both test and production environments.
3. Why is only 2 nodes in the redis Sentinel cluster not working properly?
The Sentinel cluster must deploy more than 2 nodes. If the Sentinel cluster only deploys 2 Sentinel instances, quorum=1
M1 R1
S1 S2
Configuration:quorum = 1 (Sentinel node can be switched if only one node thinks it is down)
Master is down. As long as one sentry in S1 and S2 thinks it is down, it can be switched over. At the same time, one sentry in S1 and S2 will be elected for failover. At this time, majority, that is, most sentinels are running. The majority of two sentinels, that is, two sentinels running here, can be allowed to perform failover, but the whole M1 and S2 running machines are down, so there is only one sentry left. There is no majority to allow failover, and although the other machine has an R1, the failover will not be performed
4. Classic 3-node Sentinel Cluster
M1
S1
R2 R3
S2 S3
Configuration:quorum = 2 majoiry
If the machine on which M1 is located is down, there are two of the three sentinels left. S2 and S3 can agree that master is down, and then choose one to perform the failover; at the same time, the majoiry of the three sentinels is 2, so there are two sentinels left to fail over.
This is the end of the introduction to the basics of the redis Sentinel Architecture. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.