当前位置:网站首页>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
边栏推荐
- QT -- communication protocol
- MySQL master-slave replication, detailed configuration, create unable to connect processing prompt
- R language drawing ggplot2 seasonal graph
- Construction and exploration of vivo database and storage platform
- In idea, the get and set methods may be popular because the Lombok plug-in is not installed
- PLC -- Notes
- Comment la passerelle BACnet / IP recueille - t - elle les données du système central de contrôle des bâtiments?
- Llvm and clang
- Principle and practice of bytecode reference detection
- XML序列化向后兼容
猜你喜欢

vite2.9 中指定路径别名

云原生(待更新)

Spark 离线开发框架设计与实现

What is a consistent hash? What scenarios can it be applied to?

What is EC blower fan?

Cloud native (to be updated)

A small code editor can also run programs -- a summary of sublime Text3 running programs in various languages

Libuv framework echo server C source code explanation (TCP part)

Kubernetes cluster lossless upgrade practice

MySQL installation steps - how to create a virtual machine under Linux (1)
随机推荐
hack the box:RouterSpace题解
What should I do if the version is incompatible with the jar package conflict?
Reading notes - MySQL technology l act: InnoDB storage engine (version 2)
股票炒股注册开户靠谱吗?安全吗?
Sword finger offer II 091 Paint the house
Server body 18: understanding and thinking of UDP reliable transmission (feeling from reading Yunfeng blog)
异或的应用。(提取出数字中最右侧的1,面试中经常用的到)
[ thanos源码分析系列 ]thanos query组件源码简析
Yesterday, I went to a large factory for an interview and asked me to do four arithmetic operations. Fortunately, I am smart enough
Spark 离线开发框架设计与实现
linux下修改mysql端口号
在idea中,get和set方法爆红可能是没有安装Lombok插件
Cloud native (to be updated)
BACnet/IP網關如何采集樓宇集中控制系統數據
Path alias specified in vite2.9
Vivo browser rapid development platform practice - Overview
ABAP skill tree
Optimization steps of SQL statements (II) -- MySQL statement optimization
面经---测试工程师web端自动化---大厂面试题
力扣515.在每棵树行中找最大值