当前位置:网站首页>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
边栏推荐
- "Three routines" of digital collection market
- Path alias specified in vite2.9
- BACnet/IP网关如何采集楼宇集中控制系统数据
- 自动化测试的生命周期是什么?
- 逆波兰表达式求值<难度系数>
- Principle and practice of bytecode reference detection
- 7-2 Finnish wooden chess structure Sorting
- 8 figures | analyze Eureka's first synchronization registry
- Kubelet garbage collection (exiting containers and unused images) source code analysis
- Leetcode+ 66 - 70 high precision, two sub topics
猜你喜欢
随机推荐
ice, protobuf ,thrift -- 笔记
linux下修改mysql用户名root
Code submission specification
mysql57 zip文件安装
ES6 use of return in arrow function
An important term in MySQL -- CRUD
Is it safe to open an account on Dongfang fortune
Alibaba cloud server creates snapshots and rolls back disks
A small code editor can also run programs -- a summary of sublime Text3 running programs in various languages
数字藏品市场“三大套路”
Mysql8.0和Mysql5.0访问jdbc连接
8 figures | analyze Eureka's first synchronization registry
7-1 understand everything
实时数据库 - 笔记
Mysql57 zip file installation
Libuv framework echo server C source code explanation (TCP part)
Server body 18: understanding and thinking of UDP reliable transmission (feeling from reading Yunfeng blog)
云原生(待更新)
Kubelet garbage collection (exiting containers and unused images) source code analysis
Comprehensive analysis of real enterprise software testing process







