当前位置:网站首页>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 )
边栏推荐
- Horizontal visual error effect JS special effect code
- MOOG servo valve d661-4577c
- 编写C语言的最简单小程序Hello world
- Parker proportional overflow valve rs10r35s4sn1jw
- Nielseniq welcomes dawn E. Norvell, head of retail lab, to accelerate the expansion of global retail strategy
- 阿里云ECS导入本地,解决部署的问题
- Exch:完整性检查 Database Integrity Checking
- Rainbow Brackets 插件的快捷键
- 【义修换届大礼包】
- Exch: repair the missing system mailbox
猜你喜欢

如何写一个技术方案

Booking UI effect implemented by svg

vue3 响应式数据库—— reactive

Exploration and practice of "flow batch integration" in JD

TFTP download kernel, NFS mount file system

Advanced Mathematics (Seventh Edition) Tongji University General exercises one person solution

Interview shock 60: what will cause MySQL index invalidation?

Compile and generate busybox file system

水平视觉错误效果js特效代码

大文件处理(上传,下载)思考
随机推荐
Taishan Office Technology Lecture: how to align and draw words of different sizes on the same line
Exch: database integrity checking
ABAP-发布Restful服务
Nft: unlimited possibilities to open the era of encryption Art
TFTP下载kernel,nfs挂载文件系统
大文件处理(上传,下载)思考
港科大&MSRA新研究:关于图像到图像转换,Finetuning is all you need
小程序容器与物联网结合的方式
如何写一个技术方案
Analysis on the construction scheme and necessity of constructing expressway video monitoring platform
Hyper-V: enable SR-IOV in virtual network
Exploration and practice of "flow batch integration" in JD
Exch:Exchange Server 2013 即将终止支持
A tough battle for Tencent cloud
Word中添加代码块(转载)
AnimeSR:可学习的降质算子与新的真实世界动漫VSR数据集
IEEE TBD SCI影响因子提升至4.271,位列Q1区!
Servlet operation principle_ API details_ Advanced path of request response construction (servlet_2)
Acwing game 57
广电5G正式启航,黄金频段将如何应用引关注



