当前位置:网站首页>Redis migration (recommended operation process) 1
Redis migration (recommended operation process) 1
2022-06-26 16:06:00 【franket】
Except for the following two , Other configurations are the same
router_id: Different nodes are different
priority:master Above slave
modify iptables
Add the following configuration to b and c Of filter surface , then reload
-A INPUT -d 224.0.0.18 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
Note: Finished loading iptables To configure , It is best to perform an access test on another machine , Avoid network problems
b Synchronize to a
Select the low peak operation
SLAVEOF a 6379
You can use the following command to observe the synchronization status master_sync_in_progress
info replication
Note: b After the synchronization of , Use the same method to make c Sync b
close slave read-only
stay b Up close slave read-only
Tip: This setting was intended for security , Avoid being right slave Data inconsistency caused by write operation of , But for smooth switching , A little safety consideration in this area needs to be sacrificed , If this setting is not turned on , Some write errors will occur
CONFIG SET slave-read-only no
Switch keepalived, Publish to new VIP
1. Switch keepalived, hold ip Switch to b ( You can adjust the priority , then reload)
2. Then publish the application to the new VIP( Modify the configuration , New VIP As a pair of redis The interview of IP)
Note: If the first step 2 , The next steps 1 , For some time, this was due to arp The reason for caching , At the same time a and b Read and write , If the data read / write is well divided at the application level , In a short time , It won't cause too much problems (a b Data inconsistency ), But not for a long time , The most radical solution , Or new VIP Republish it again
Disconnect synchronization
Observe for a while , Pay attention to the following aspects
1.a Upper redis Number of network connections ( The number of connections is reduced to 0)
2.b Upper redis Number of network connections ( The number of connections gradually stabilized )
3. Log and error reporting ( There is no error message that deserves special attention )
stay b Use the following command to disconnect from a Synchronization of
slaveof no one
At this point, the switch is completed ,b Has become c Of master
Tip: You may consider reintroducing a As b Of slave, And it turns out a Of slave You can also consider recycling ( The data is old and useless ), Be careful keepalived Priority of the instance , Avoid drifting back
Original address
边栏推荐
- R语言广义线性模型函数GLM、glm函数构建逻辑回归模型(Logistic regression)、分析模型是否过离散(Overdispersion)、使用残差偏差与二项式模型中的剩余自由度的比率评估
- 神经网络“炼丹炉”内部构造长啥样?牛津大学博士小姐姐用论文解读
- Ideal path problem
- Swiftui retrieves the missing list view animation
- Keepalived 实现 Redis AutoFailover (RedisHA)
- Selenium chrome disable JS disable pictures
- Transaction input data of Ethereum
- NFT Platform Security Guide (2)
- 人人都当科学家之免Gas体验mint爱死机
- Analyse panoramique de la chaîne industrielle en amont, en aval et en aval de la NFT « Dry goods»
猜你喜欢

首例猪心移植细节全面披露:患者体内发现人类疱疹病毒,死后心脏重量翻倍,心肌细胞纤维化丨团队最新论文...

TweenMax+SVG切换颜色动画场景

2 three modeling methods

How to create your own NFT (polygon) on opensea

理想路径问题

Solana扩容机制分析(1):牺牲可用性换取高效率的极端尝试 | CatcherVC Research

全面解析Discord安全问题

Transformation of zero knowledge QAP problem

Development, deployment and online process of NFT project (2)

油田勘探问题
随机推荐
『C语言』题集 of ⑩
TweenMax+SVG切换颜色动画场景
redis的二进制数组命令
NFT 项目的开发、部署、上线的流程(2)
SAP OData development tutorial - from getting started to improving (including segw, rap and CDP)
Swiftui retrieves the missing list view animation
[time complexity and space complexity]
Audio and video learning (II) -- frame rate, code stream and resolution
5 模型保存与加载
How to identify contractual issues
Keepalived 实现 Redis AutoFailover (RedisHA)
NFT合约基础知识讲解
如何辨别合约问题
SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)
How to configure and use the new single line lidar
5000字解析:实战化场景下的容器安全攻防之道
基于 MATLAB的自然过渡配音处理方案探究
Redis顺序排序命令
Transaction input data of Ethereum
Selenium chrome disable JS disable pictures