当前位置:网站首页>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 :

边栏推荐
- [USB voltmeter and ammeter] Based on stm32f103c8t6 for Arduino
- Input the names of 10 people and output them in descending order
- tensorflow scatter_nd函数
- Redis.conf details
- Redis 分片集群
- [lvgl (5)] label usage
- 数据分析思维之从整体出发分析零售行业——全方位多方面细节分析
- ROS starts non native nodes
- 2022-07-22 mysql/stonedb parallel hashjoin memory usage analysis
- Don't care too much about others' eyes, it will erase your glory
猜你喜欢
![[lvgl (important)] style attribute API function and its parameters](/img/55/f25a510cf04caff7ee15e72360c3a1.png)
[lvgl (important)] style attribute API function and its parameters
![(note sorting is not completed) [graph theory: find the shortest path of single source]](/img/58/e61aea3c4d0a33d3615144763160f7.png)
(note sorting is not completed) [graph theory: find the shortest path of single source]

Redis distributed cache learning notes

Esp32 ultra detailed learning record: NTP synchronization time

Record the pits encountered in the deserialization of phpserializer tool class

GE口:SGMII模式和serdes模式

Redis.conf details

渗透学习-SQL注入篇-靶场篇-安全狗的安装与绕过实验(后续还会更新)

Sparksql core usage, 220724,

C语言中extern,static, register,volatile 关键字的作用;保姆级教学!
随机推荐
Vs2019 configuration running open3d example
你不可能让每个人都满意!
tensorflow boolean_ Mask function
Cmake notes
你是谁由你自己决定!
Geek planet ByteDance one stop data governance solution and platform architecture
You can't satisfy everyone!
[essays: discretization]
An AI plays 41 games, and the comprehensive performance score of Google's latest multi game decision transformer is twice that of dqn
STM32 ADC based on Hal library uses DMA multi-channel sampling and solves the problems encountered
UE4/5 无法打开文件“xxx.generated.h”(Cannot open file xxx.generated.h)的解决方法总结
Redis data type - list list
Day (0~6) represents the starting position of the first day of each month, stop represents the number of days of each month, and there are two blank spaces between each day. Input different days and s
数据分析思维之从整体出发分析零售行业——全方位多方面细节分析
2022-07-22 mysql/stonedb并行hashJoin内存占用分析
Libevent multithreaded server + client source code
【学习笔记】网页出现白屏可能的原因与优化方法
【LeetCode】444. 序列重建
Can you increase muscle without exercise??? Just get an injection of hibernating black bear serum
上传excel文件