当前位置:网站首页>Redis sentinel mechanism
Redis sentinel mechanism
2022-07-04 08:07:00 【Mar, LiuNian】
List of articles
effect
Solve the problem of master-slave mode , Master slave switchover after master instance failure ( Will be promoted from the instance
Main example ), To ensure that the system is available
Monitor the running status of master-slave instances
While the master-slave instance is running , There is also a special redis The process is running ( sentry )
It is responsible for monitoring the master , From the running state of the instance ( The heartbeat detection : Respond to the sentry within the specified time )
If the instance does not respond within the specified time , Mark it as offline
If the primary instance does not respond within the specified time , Then start the master-slave switching process
Because a single sentinel may respond overtime due to its own network fluctuations or the pressure of the primary instance at that time , Misjudge the primary instance as offline ( Subjective offline ). So as to execute unnecessary master-slave switching logic . Therefore, sentinels are generally made into clusters , Judge whether the main instance is offline by obeying the majority ( Objective offline )
Select the main process
When the main instance is judged to be offline , Operation scoring mechanism
1. First exclude the offline from the instance
2. Exclude nodes that have been disconnected from the main instance for a certain number of times during the operation of the instance
3. Determine the priority of the slave instance ( Priority can be achieved by :slave-priority To configure ), High priority , Score high
4. Compare the ring buffer from the Library slave_repl_offset( This parameter is used to record the replication difference between the primary instance and the primary instance , When the main instance hangs ,master_repl_offset There will be no increase in , So from the example slave_repl_offset The bigger it is , The smaller the difference with the main instance ),slave_repl_offset The bigger it is , The higher the score
5. perform redis The default rule for : runID The smaller it is , The higher the score
After the above scoring process , After choosing the Lord
The sentry tells the master's information to other slave instances
From the instance through replicaof Synchronize with the new primary instance
The sentinel informs the client to connect to the new primary instance


边栏推荐
- Advanced MySQL: Basics (5-8 Lectures)
- ZABBIX 5.0 monitoring client
- Go learning notes - constants
- Tri des fonctions de traitement de texte dans MySQL, recherche rapide préférée
- Leetcode(215)——数组中的第K个最大元素
- zabbix监控系统邮件报警配置
- In the era of low code development, is it still needed?
- Is l1-029 too fat (5 points)
- Moher College webmin unauthenticated remote code execution
- How to improve your system architecture?
猜你喜欢

Système de surveillance zabbix contenu de surveillance personnalisé

1. Getting started with QT

Take you to master the formatter of visual studio code

1. Kalman filter - the best linear filter

Preliminary study on temporal database incluxdb 2.2

深入浅出:了解时序数据库 InfluxDB

MySQL中的文本處理函數整理,收藏速查

PCIE知识点-010:PCIE 热插拔资料从哪获取

Email alarm configuration of ZABBIX monitoring system

【性能测试】一文读懂Jmeter
随机推荐
OKR vs. KPI figure out these two concepts at once!
Relations courantes de la fiche de données d'exploitation pour les activités
【性能測試】一文讀懂Jmeter
Put a lantern on the website during the Lantern Festival
Go learning notes - constants
真空介电常数和真空磁导率究竟是由什么决定的?为何会存在这两个物理量?
zabbix监控系统邮件报警配置
Conversion of yolov5 XML dataset to VOC dataset
[network security] what is emergency response? What indicators should you pay attention to in emergency response?
Jianmu continuous integration platform v2.2.2 release
Life planning (flag)
Tri des fonctions de traitement de texte dans MySQL, recherche rapide préférée
zabbix监控系统自定义监控内容
[gurobi] establishment of simple model
How to improve your system architecture?
Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future
Convert datetime string to datetime - C in the original time zone
Devops Practice Guide - reading notes (long text alarm)
SQL注入测试工具之Sqli-labs下载安装重置数据库报错解决办法之一(#0{main}thrown in D:\Software\phpstudy_pro\WWW\sqli-labs-……)
Linear algebra 1.1

