当前位置:网站首页>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


边栏推荐
- Thesis learning -- time series similarity query method based on extreme point characteristics
- 一文了解数据异常值检测方法
- Laravel page load problem connection reset - PHP
- JVM -- class loading process and runtime data area
- Show server status on Web page (on or off) - PHP
- L1-026 I love gplt (5 points)
- 1. Kalman filter - the best linear filter
- Unity write word
- Const string inside function - C #
- Flask 常用组件
猜你喜欢

Unity-Text上标平方表示形式+text判断文本是否为空

Distributed transaction management DTM: the little helper behind "buy buy buy"

Heap concept in JVM

L2-013 red alarm (C language) and relevant knowledge of parallel search

How to send mail with Jianmu Ci

Email alarm configuration of ZABBIX monitoring system

System architecture design of circle of friends

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

Node foundation ~ node operation

Flask 常用组件
随机推荐
[Gurobi] 简单模型的建立
OKR vs. KPI figure out these two concepts at once!
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
Jianmu continuous integration platform v2.2.2 release
促进OKR落地的工作总结该如何写?
Leetcode 23. 合并K个升序链表
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
【性能測試】一文讀懂Jmeter
时序数据库 InfluxDB 2.2 初探
Li Kou today's question -1200 Minimum absolute difference
Laravel page load problem connection reset - PHP
WordPress get_ Users() returns all users with comparison queries - PHP
Activiti common operation data table relationship
Leetcode 23. Merge K ascending linked lists
Sports [running 01] a programmer's half horse challenge: preparation before running + adjustment during running + recovery after running (experience sharing)
神经网络入门(下)
[network security] what is emergency response? What indicators should you pay attention to in emergency response?
Easy to understand: understand the time series database incluxdb
Introduction to neural network (Part 2)
Life planning (flag)

