当前位置:网站首页>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
边栏推荐
- 力扣515.在每棵树行中找最大值
- Sword finger offer II 091 Paint the house
- 扩展Prometheus的解决方案thanos的简介和几个月使用心得
- How bacnet/ip gateway collects data of building centralized control system
- flutter 实现摇一摇功能
- Pfizer's new Guankou medicine has entered the Chinese market, and the listing of relevant products of domestic pharmaceutical enterprises is just around the corner
- MMR重排(相似度通过编辑距离和重复度计算)
- Kubelet garbage collection (exiting containers and unused images) source code analysis
- 什么是EC鼓风机(ec blower fan)?
- Block transmission by golang gin framework
猜你喜欢

Kubernetes deploys a secret pit where thanos ruler sends repeated alarms

A gadget can write crawlers faster

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

Hack the box:routerspace

数字藏品市场“三大套路”
![[thanos source code analysis series]thanos query component source code analysis](/img/e4/2a87ef0d5cee0cc1c1e1b91b6fd4af.png)
[thanos source code analysis series]thanos query component source code analysis

The practice of traffic and data isolation in vivo Reviews

在idea中,get和set方法爆红可能是没有安装Lombok插件

The practice of event driven architecture in vivo content platform

kubelet垃圾(退出的容器和未使用的镜像)回收源码分析
随机推荐
剑指offer II 091.粉刷房子
实时数据库 - 笔记
Can okcc call centers work without computers?
Uninstall and reinstall the latest version of MySQL database. The test is valid
Devtools implementation principle and performance analysis practice
推荐系统系列精讲(第五讲): 排序模型的调优实践
PLC -- Notes
网传互联网公司加班表,排名第一的没悬念
R 和 rgl 绘制 3D 结
Leetcode+ 66 - 70 high precision, two sub topics
XML序列化向后兼容
Modifying MySQL user name root under Linux
R 语言绘制 动画气泡图
Top 25 most popular articles on vivo Internet technology in 2021
小小一款代码编辑器竟然也可以有程序运行之功能——Sublime Text3运行各种语言程序的总结
A small code editor can also run programs -- a summary of sublime Text3 running programs in various languages
No suspense about the No. 1 Internet company overtime table
基金的投资交易与结算
大型项目中的Commit Message规范化控制实现
Yesterday, I went to a large factory for an interview and asked me to do four arithmetic operations. Fortunately, I am smart enough