当前位置:网站首页>Sentinel mechanism of redis cluster
Sentinel mechanism of redis cluster
2022-06-28 07:34:00 【Huangyuewang】
When redis Cluster master (master) It's down. , The cluster can only read but not write ! How to solve this problem ?
The answer is : Sentinel mechanism , Solve the problem of master-slave replication The election question
One Sentry group set up
1. Server introduction
Here's the picture ,redis The cluster of 5 Servers , Master node ip by 192.168.1.100
redis For cluster setup, please refer to : redis One master multi slave cluster setup _huangyuewang The column -CSDN Blog
sentry Mechanism principle
- Sentinel mechanism, each 10s We only need to configure our master node to monitor the time, and then we can get the current whole time Redis List of cluster environments , use info Order form .
- Sentinels are not recommended to be stand-alone , It's better for each one Redis All nodes need to be configured with sentinel monitoring .
- What is the principle of sentinel cluster : Multiple sentinels perform the same master master node , Subscribe to the same channel , When new sentries join, they will send their own service information to the channel , Subscribers to the channel can find the addition of new sentinels , Then establish a long connection with each other .
- Master Fault discovery of A single sentinel will turn to the Lord master The node sends ping The order of , If master The node did not respond in time , The Sentry will think it's time to master The node is “ Subjective unavailability ” It will be sent to other sentinels to confirm the Master Whether the node is unavailable , Number of sentinel nodes currently confirmed >=quorum( Configurable ), There will be a re-election .
2. Build sentry clusters
find redis Unzip folder , hold sentinel.conf File copy to redis The installation directory
cp /application/redis-6.2.6/sentinel.conf /application/redis/etc

Modify the sentry profile vim /application/redis/sentinel.conf

Activate the sentry
/application/redis/bin/redis-sentinel /application/redis/etc/sentinel.conf
Other commands
sentinel down-after-milliseconds mymaster 3000#sentinel Heartbeat detection master 3 No response in seconds , Regarded as hanging up , Start switching from other to main
sentinel parallel-syncs mymaster 1# There can be at most 1 Slave synchronization master . One from the end of synchronization , The other synchronizes from .
sentinel failover-timeout mymaster 18000# Master slave switching timeout
Activate the sentry ./redis-sentinel ./sentinel.confAbove 5 All servers set up and start sentries
边栏推荐
- Spark 离线开发框架设计与实现
- Top 25 most popular articles on vivo Internet technology in 2021
- 自动化测试的生命周期是什么?
- ACM笔记
- Force buckle 515 Find the maximum value in each tree row
- GoLand IDE and delve debug Go programs in kubernetes cluster
- QT -- communication protocol
- MMR重排(相似度通过编辑距离和重复度计算)
- Evaluation of inverse Polish expression < difficulty coefficient >
- MMR rearrangement (similarity is calculated by editing distance and repeatability)
猜你喜欢

ACM笔记

Unity-UI-shadow组件

ES6 use of return in arrow function

open62541直接导入NodeSet文件

腾讯下半年继续裁员,所有事业群至少缩减 10%,对此你怎么看?关注者

Cloud native (to be updated)

小小一款代码编辑器竟然也可以有程序运行之功能——Sublime Text3运行各种语言程序的总结

MySQL installation steps - installing MySQL on Linux (3)

Comment la passerelle BACnet / IP recueille - t - elle les données du système central de contrôle des bâtiments?

推荐系统系列精讲(第五讲): 排序模型的调优实践
随机推荐
Mysql8.0和Mysql5.0访问jdbc连接
No suspense about the No. 1 Internet company overtime table
DBeaver 22.1.1 发布,可视化数据库管理平台
分析 NFT 项目的 5 个指标
Ice, protobuf, thrift -- Notes
Is it safe to open an account on Dongfang fortune
R language ggmap visual cluster
This keyword details
Principle and practice of bytecode reference detection
腾讯下半年继续裁员,所有事业群至少缩减 10%,对此你怎么看?关注者
Mysql57 zip file installation
linux下修改mysql用户名root
MySQL installation steps - Linux configuration file JDK installation (II)
Dbeaver 22.1.1 release, visual database management platform
Cloud native (to be updated)
NDK cross compilation
GoLand IDE and delve debug Go programs in kubernetes cluster
LLVM 与 Clang
mysql57 zip文件安装
Face to face experience --- test engineer web side automation --- interview questions for large factories