当前位置:网站首页>Redis sentinel mechanism
Redis sentinel mechanism
2022-07-24 07:03:00 【Bustling.】
Learn before redis The master-slave mechanism of , among slave After the node goes down, you can find master Node synchronization data , that master How to deal with node downtime ?
One 、 The role and principle of sentinels
effect :

Master Condition monitoring :

primary Master New election after failure Master:

new Master He began to reign :

summary :

Two 、 The construction of sentry group
Here we build a three node Sentinel colony , To supervise the previous Redis Master-slave cluster :

Three sentinel Example information of :

1、 Create folder :
# Get into /tmp Catalog
cd /tmp
# Create directory
mkdir s1 s2 s32、 stay s1 Create a directory sentinel.conf file , Add the following :
port 27001
sentinel announce-ip 192.168.1.103
sentinel monitor mymaster 192.168.1.103 7001 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000
dir "/tmp/s1"notes :

3、 take s1/sentinel.conf File copy to s2、s3 In both directories ( stay /tmp Directory execute the following command ):
# Mode one : Copy one by one
cp s1/sentinel.conf s2
cp s1/sentinel.conf s3
# Mode two : Pipe combination command , One click Copy
echo s2 s3 | xargs -t -n 1 cp s1/sentinel.confmodify s2、s3 Configuration files in two folders , Change the ports to 27002、27003:
sed -i -e 's/27001/27002/g' -e 's/s1/s2/g' s2/sentinel.conf
sed -i -e 's/27001/27003/g' -e 's/s1/s3/g' s3/sentinel.conf4、 start-up
For the convenience of viewing the log , We turn on 3 individual ssh Windows start separately redis( stay /tmp Directory execute the following command ):
# The first 1 individual
redis-sentinel s1/sentinel.conf
# The first 2 individual
redis-sentinel s2/sentinel.conf
# The first 3 individual
redis-sentinel s3/sentinel.confAfter starting :

5、 test
Try to make master node 7001 Downtime , see sentinel journal :

see 7003 Log :

see 7002 Log :

边栏推荐
- chm文件打开时提示乱码
- MySQL gets the self incrementing line mark (different from MySQL version)
- 三级分类/菜单的查询——树形结构
- vs2019配置运行open3d例子
- [learning notes] see the difference between a+++a and a+a++ from the compilation
- MapReduce(一)
- owasp top10 渗透测试
- Love yourself first, then others.
- 一个AI玩41个游戏,谷歌最新多游戏决策Transformer综合表现分是DQN的两倍
- [USB voltmeter and ammeter] Based on stm32f103c8t6 for Arduino
猜你喜欢

An AI plays 41 games, and the comprehensive performance score of Google's latest multi game decision transformer is twice that of dqn

tensorflow einsum函数

Sparksql core usage, 220724,

数据分析思维之从整体出发分析零售行业——全方位多方面细节分析

STM32外部中断(寄存器版本)

Mac can't connect to local MySQL server through socket '/tmp/mysql Sock '(2) problem

The function of extern, static, register, volatile keywords in C language; Nanny level teaching!

在线问题反馈模块实战(十二):实现图片删除功能

STM32 ADC based on Hal library uses DMA multi-channel sampling and solves the problems encountered

Esp32 ultra detailed learning record: NTP synchronization time
随机推荐
[lvgl] API functions for setting, changing and deleting styles of components
xavier_ normal_ Initialization test
10分钟就能写出来的——25~30K的国外企业招聘面试考题,这不是轻轻松松吗~
【学习笔记】url输入到页面展现中发生了什么?
上传图片base64
reflex
(笔记整理未完成)【图论:求单源最短路径】
String question
ROS starts non native nodes
(note sorting is not completed) [graph theory: find the shortest path of single source]
一首伟大的赞歌
Lambda expressions sort list objects in multiple fields
Upload pictures Base64
Sealos 打包部署 KubeSphere 容器平台
Introduction to pyqt5 - student management system
OSS authorizes a single bucket permission
反射
5. Template cache. Drawing a square can only move within the triangle
Job search memo
XXL execute node error log swiping