当前位置:网站首页>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语言plotly可视化:小提琴图、多分类变量小提琴图、分组(grouped)小提琴图、分裂的分组小提琴图、每个小提琴图内部分为两组数据、每个分组占小提琴图的一半、自定义小提琴图的调色板、抖动数据点
- svg上升的彩色气泡动画
- 8 自定义评估函数
- IAR工程适配GD32芯片
- 2 three modeling methods
- 现在券商的优惠开户政策是什么?现在在线开户安全么?
- SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)
- Solidus Labs欢迎香港前金融创新主管赵嘉丽担任战略顾问
- NFT transaction principle analysis (1)
猜你喜欢

JVM notes
![[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long](/img/31/d14316dca740590c1871efe6587e04.png)
[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long

"C language" question set of ⑩

NFT transaction principle analysis (1)

Everyone is a scientist free gas experience Mint love crash

Anaconda3 installation tensorflow version 2.0 CPU and GPU installation, win10 system

NFT 项目的开发、部署、上线的流程(1)

NFT交易原理分析(1)

Have you ever had a Kindle with a keyboard?

3. Keras version model training
随机推荐
Audio and video learning (II) -- frame rate, code stream and resolution
NFT 项目的开发、部署、上线的流程(2)
Canvas three dot flashing animation
Handwritten numeral recognition, run your own picture with the saved model
8 自定义评估函数
R language plot visualization: plot visualizes the normalized histogram, adds the density curve KDE to the histogram, and uses geom at the bottom edge of the histogram_ Adding edge whisker graph with
svg环绕地球动画js特效
大话领域驱动设计——表示层及其他
(DFS search) acwing 2005 horseshoe
Cookie和Session详解
【思考】在买NFT的时候你在买什么?
Keepalived 实现 Redis AutoFailover (RedisHA)1
3. Keras version model training
Quickly get started with federal learning -- the practice of Tencent's self-developed federal learning platform powerfl
5000字解析:实战化场景下的容器安全攻防之道
Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
6 custom layer
[untitled]
Panoramic analysis of upstream, middle and downstream industrial chain of "dry goods" NFT
Tweenmax+svg switch color animation scene