当前位置:网站首页>Redis sentinel cluster main database failure data recovery ideas # yyds dry goods inventory #
Redis sentinel cluster main database failure data recovery ideas # yyds dry goods inventory #
2022-06-28 09:41:00 【Jiangxiaolong's technology blog】
Redis Sentinel cluster main database fault data recovery
When the main database is repaired and re launched, first know who is the current main database through the sentry , Then you will go to the main database to synchronize data , And it will automatically modify the configuration file , After data synchronization , If you want to restore the primary database to become the primary database again, you need to increase the weight of the primary database , And then re elect , At this time, the original master database can become a new master database , After adjustment, adjust the weight value of the main library to the default value
Realize the idea :
1. Restore the failed primary library
2. View the current master-slave status , Verify that the main library is down , Whether it is synchronized with the data generated from the library
3. Adjust the weight value
4. Re election , Change the original master database into a new master database
5. After the restored primary database becomes the new primary database again , To change all the adjusted weight values to the default values
The premise that the main library can rejoin the sentinel cluster : One of the remaining two nodes must be master, And the two node configuration files have specified new nodes master Address
1. Recover the damaged main library

2. View the recovered Primary Library redis-1 The configuration file
You can see that it has been automatically modified to the address of the current library

3. View the recovered Primary Library redis-1 The master-slave relationship of
4. Configure the weight value of the recovered primary library , Make it re elected as the main library
The sentinel election is first of all
1. Check who has higher weight priority is selected as the main library
2. Weight and priority are consistent , On the comparison id,id Big election
According to the output of the log , It can be clearly seen that the adjustment redis-1 The weight priority of is 150, Higher than the other two nodes , therefore redis-1 It becomes the main library

View the master-slave replication relationship of the node
There is no synchronized Library in the main library , The other two nodes are synchronized redis-1 Main library
5. Adjust the weight value to the default value
Adjust the weight value to the default value , As a condition for judgment in the next election
边栏推荐
猜你喜欢
随机推荐
Global exception handlers and unified return results
Resource scheduling and task scheduling of spark
函数的分文件编写
2020-10-27
Matplotlib属性及注解
Calculation of stock purchase and sale expenses
1181: integer parity sort
如何查看谷歌浏览器保存的网页密码
File operations in QT
2022-06-27:给出一个长度为n的01串,现在请你找到两个区间, 使得这两个区间中,1的个数相等,0的个数也相等, 这两个区间可以相交,但是不可以完全重叠
1182: group photo effect
new URL(“www.jjj.com“)
桥接模式(Bridge)
Abnormal occurrence and solution
纵观jBPM从jBPM3到jBPM5以及Activiti
How to reduce the risk of project communication?
Installing redis under Linux and windows (ultra detailed graphic tutorial)
Edit the live broadcast source code with me. How to write the live broadcast app code
Scenario method and error recommendation method for learning basic content of software testing (2)
How do I open an account on my mobile phone? Is it safe to open an account online now?







