In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what Redis Sentinel is, the article is very detailed, has a certain reference value, interested friends must read it!
Introduction to Redis Sentinel
The Sentinel (Sentinel) process is used to monitor the working status of the Master master server in the redis cluster. When the Master master server fails, it can switch between Master and Slave servers to ensure the high availability of the system. It has been integrated into the version of redis2.6+, and the Sentinel mode of Redis has stabilized after version 2.8. It is generally recommended to use later versions of version 2.8 of Redis in production environments. Sentinel is a distributed system where you can run multiple sentinel processes in an architecture that use the rumor protocol (gossipprotocols) to receive information about whether the Master master server is offline, and use the voting protocol (Agreement Protocols) to decide whether to perform an automatic failover and which Slave to choose as the new Master. Each Sentinel process sends regular messages to other Sentinel, Master, and Slave to confirm whether the other party is "alive". If it is found that the other party has not received a response within the specified configuration time (configurable), it will temporarily assume that the other party has been offline, that is, the so-called "subjective downtime", English name: Subjective Down, referred to as SDOWN. If there is subjective downtime, there must be objective downtime. When most of the Sentinel processes in the "Sentinel Group" make the SDOWN judgment to the Master master server and communicate with each other through the SENTINEL is-master-down-by-addr command, the Master Server offline judgment is obtained. This way is "objective downtime", which is called Objectively Down, or ODOWN for short. Through a certain vote algorithm, select one of the remaining slave slave server nodes to be promoted to Master server nodes, then automatically modify the relevant configuration and turn on failover.
Sentinel has a separate executable file redis-sentinel, but in fact it is just a Redis server running in a special mode. You can start sentinel by giving the-- sentinel option when starting an ordinary Redis server. Some of the design ideas of Sentinel are very similar to zookeeper.
Sentinel clusters will communicate with each other, communicate the status of redis nodes, make corresponding judgments and deal with them. The subjective and objective offline states here are more important, which determine whether to fail over. They can subscribe to the specified channel information and notify the administrator when the server fails, and the client can regard Sentinel as a Redis server that only provides subscription functions. You cannot use the PUBLISH command to send messages to this server, but you can use the SUBSCRIBE command or the PSUBSCRIBE command to get event alerts by subscribing to a given channel. A channel can receive events with the same name as that channel. For example, a channel called + sdown can receive events when all instances enter the subjective offline (SDOWN) state.
Role of Sentinel (Sentinel) process:
1. Monitoring: the sentinel will constantly check whether your Master and Slave are working properly.
2. Notification: when there is a problem with a monitored Redis node, the sentinel can send a notification to the administrator or other applications through API.
3. Automatic failover (Automatic failover): when a Master does not work properly, the sentinel will start an automatic failover operation, which will upgrade one of the Slave of the invalid Master to the new Master and change the other Slave of the invalid Master to copy the new Master;. When the client tries to connect to the failed Master, the cluster will also return the address of the new Master to the client, so that the cluster can replace the failed Master with the current Master. After switching between Master and Slave servers, the contents of Master's redis.conf, Slave's redis.conf and sentinel.conf 's configuration files will be changed accordingly, that is, there will be an extra line of slaveof's configuration in the redis.conf configuration file of the Master master server, and the monitoring target of sentinel.conf will be changed accordingly.
The above is all the content of what Redis Sentinel is, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.