当前位置:网站首页>Redis (VII) - sentry
Redis (VII) - sentry
2022-06-30 18:02:00 【Zhaoliwen is a pig】
Redis( 7、 ... and )—— sentry
List of articles
1、 brief introduction
sentry (sentinel) It's a Distributed systems , It's used to do... On each server in the master-slave structure monitor , In case of failure, through the voting mechanism choice new master And put all slave Connect to the new master.
2、 effect
- monitor
- Keep checking master and slave Is it working . master Survival tests 、master And slave Operation detection
- notice ( remind )
- When there is a problem with the monitored server , To the other ( The sentry room , client ) Sending notice .
- Automatic failover
- To break off master And slave Connect , Pick one slave As master, Will others slave Connect to the new master, And inform the client of the new server address
Be careful :
The sentry is also a redis The server , It just doesn't provide data services Usually, the number of sentinels is singular
3、 Deploy sentinels
Configure the master-slave structure of one drag two
Three sentries ( The configuration is the same , Different ports )
- see sentinel.conf
Activate the sentry
redis-sentinel sentinel Port number .conf

4、 working principle
Monitoring phase
- It is used to synchronize the status information of each node
- Get each sentinel The state of ( Whether online )
- obtain master The state of
- master attribute
- runid
- role:master
- each slave Details of
- master attribute
- Get all slave The state of ( according to master Medium slave Information )
- slave attribute
- runid
- role:slave
- master_host、master_port
- offset
- …
- slave attribute
[

Notification stage
- The Sentinels will get information synchronized with each other ( Information symmetry )
Fail over
confirm master Offline
- When a sentry finds that the main server is down , Will master Medium SentinelRedistance Medium master Change it to SRI_S_DOWN( Subjective offline ), And inform the other sentinels , Tell them they found master Hang up .
- Other sentinels receive the information sent by the sentinel , Will also try to connect master, If more than half ( In the configuration file ) confirm master After hanging up , Will master Medium SentinelRedistance Medium master Change it to SRI_O_DOWN( Objective offline )
Select sentinels to deal with
- Upon confirmation of master After hanging up , A sentinel will be selected for failover ( It is up to the sentry to specify which slave To make a new master).
- The filtering method is that sentinels send messages to each other , And vote , Those with more votes are elected .
Specific treatment
- The Sentinels chosen by him are responsible for the current slave Screening , The screening criteria are :
- Select the alternative from the server list master
- online
- Slow response
- And the original master Disconnected for a long time
- The principle of priority
- priority
- offset
- runid
- Send instructions ( sentinel )
- To the new master send out slaveof no one( Disconnect from the original master The connection of )
- To the other slave send out slaveof new masterIP port ( Let others slave With the new master Connected to a )
边栏推荐
- 水平视觉错误效果js特效代码
- 【剑指Offer】剑指 Offer 53 - II. 0~n-1中缺失的数字
- Daily interview 1 question - basic interview question of blue team - emergency response (1) basic idea process of emergency response +windows intrusion screening idea
- JS from prototype chain to inheritance
- MySQL reports that the column timestamp field cannot be null
- 【义修换届大礼包】
- Is there an optimal solution to the energy consumption anxiety in the data center?
- Canvas cloud shape animation
- Zero foundation can also be an apple blockbuster! This free tool can help you render, make special effects and show silky slides
- vue3 响应式数据库—— reactive
猜你喜欢

Splitting.js文本标题缓慢加载js特效

【网易云信】播放demo构建:无法将参数 1 从“AsyncModalRunner *”转换为“std::nullptr_t”**

ABAP-发布Restful服务

流批一体在京东的探索与实践

AnimeSR:可学习的降质算子与新的真实世界动漫VSR数据集

Key to understanding the trend of spot Silver

Parker proportional overflow valve rs10r35s4sn1jw

知名互联网房屋租赁服务公司物联网关键业务迁移上云实践
![leetcode:787. The cheapest transfer flight in station K [k-step shortest path + DFS memory + defaultdict (dict)]](/img/28/78e2961877776ca3dfcba5ee7e35d2.png)
leetcode:787. The cheapest transfer flight in station K [k-step shortest path + DFS memory + defaultdict (dict)]

Mo Tianlun salon | Tsinghua qiaojialin: Apache iotdb, originated from Tsinghua, is building an open source ecological road
随机推荐
svg实现的订票UI效果
K-line diagram must be read for quick start
.NET ORM框架HiSql实战-第一章-集成HiSql
联想“双平台”运维解决方案 助力智慧医疗行业智慧管理能力全面提升
腾讯云的一场硬仗
Tubes响应性数据系统的设计与原理
【剑指Offer】53 - I. 在排序数组中查找数字 I
K-line diagram interpretation and practical application skills (see position entry)
5G商用三年,未来创新何去何从?
[binary tree] preorder traversal to construct binary search tree
TFTP下载kernel,nfs挂载文件系统
港科大&MSRA新研究:关于图像到图像转换,Finetuning is all you need
Exch:修复丢失的系统邮箱
vue3 响应式数据库—— reactive
canvas鼠标控制重力js特效
Send the injured baby for emergency medical treatment. Didi's driver ran five red lights in a row
Vue3 reactive database
腾讯云安装mysql数据库
分享 5 大常用的特征选择方法,机器学习入门必看!!!
Booking UI effect implemented by svg



