当前位置:网站首页>Redis5.0 slot migration, free play (single machine migration cluster)
Redis5.0 slot migration, free play (single machine migration cluster)
2022-06-28 09:03:00 【Endless learning WangXiaoShuai】
Recently doing redis The stand-alone version is migrated to the cluster version , So it was used redis3.0 Version , There was a problem during the migration , Is that if redis5.0 Previous version , When moving the slot point , If there is a value in the slot , Result in an error :Syntax error ,try client(list|kill|getname|setname|pause|reply) , It mainly needs to be modified redis-trib.rb Of documents move_slot This method , Bypass clientCommand, Direct execution migrateCommand( Get rid of .client that will do ). Here's the picture

After the modification , Can reshard With data slot There's a slot . If not modified trib file , There was a mistake in the above (Syntax error ,try client), At this time, the slot with data , Will also be immovable . perform cluster setlot The value of the slot point stable that will do .
The above is just that I have operated redis3.0 Problems and solutions during data migration . Let's talk about it redis5.0 after , operation slot The order of , Get along well with redis5.0 A cinch .
First of all, our redis It is the cluster version , Three masters and three followers , I won't talk about it here redis Of sentinel Sentinel mode ( monitor , remind , Automatic failover has several features ).
Directly above

redis5.0 The version abandoned trib file , change to the use of sth. redis-cli Operation cluster , This is also a lot of improvement and optimization .

You can see redis Version of .

redis-cli --cluster check host:port This command can view the information of each node of the cluster .
Now let's start 7002 and 7003 All slot points of are moved to 7001 On :


Ask how many slot points to move , We move 7002 All ,5462 individual


And then 7003 All slot points of move to 7001 On


At the moment ,7001 There are all the slots on the , Now students who want to migrate data , Just put the stand-alone version dump.rdb Copy the file to the cluster .
Let's start to divide the slot points equally ,

Use here rebalance When , because 7002 and 7003 There are no slots on it , So they do not participate in the election , Also cannot participate in the equalization slot point .

We can use --cluster-use-empty-masters This parameter , Even if 7002 and 7003 No slot can participate in the equal distribution of slot points .

You can see that the slot points are evenly distributed , And the slave nodes are equally divided .

The one we circled can specify which master node the current slave node is under , Be free to distribute , Play around redis5.0 Slot point of . also forget, To delete a node , Other nodes have reserved information , There will still be heartbeat communication , Therefore, each reserved node is required , To carry out forget. There are other funny commands , I won't introduce them here . Thank you for coming .
边栏推荐
- Webrtc advantages and module splitting
- Mysql8.0 forgot the root password
- centos mysql5.5配置文件在哪
- JMeter -- interface test 1
- Protection range and optimization of motor protector for hoist equipment
- Key points of building fire protection design
- Implementation of single sign on
- 理解IO模型
- Which is a better ERP management system for electronic component sales?
- Super Jumping! Jumping! Jumping!
猜你喜欢

从知识到智慧:知识图谱还要走多远?

Comment supprimer le crosstalk SiC MOSFET?

【云原生 | Kubernetes篇】深入了解Pod(六)

Import and export of a single collection in postman

webrtc优势与模块拆分

rman備份報ORA-19809 ORA-19804

TCP

隐私计算FATE-----离线预测

High rise building fire prevention

The Cassandra cluster reinstalls and starts from the node. An error is reported. There is an existing solution
随机推荐
用Pytorch搭建第一個神經網絡且進行優化
Rman Backup Report Ora - 19809 Ora - 19804
Android studio interview preparation
Robot Rapping Results Report
MATLAB小技巧(20)矩阵分析--主成分回归
Fire safety hazards
使用transform:scale之后导致页面鼠标悬浮事件消失
实现全局双指长按返回桌面
AVFrame内存管理api
A - Bi-shoe and Phi-shoe
Which securities company is better and safer to choose when opening an account for the inter-bank certificate of deposit fund with mobile phone
spark的资源调度和任务调度
Basic content learning of software testing (I)
"Jianzhi offer" -- Interview Question 4: finding two-dimensional arrays
[go ~ 0 to 1] the next day, June 25, switch statement, array declaration and traversal
为什么SELECT * 会导致查询效率低?
MySQL8.0 忘记 root 密码
Key points of building fire protection design
中金财富开户安全吗?怎么收费?
Chrome devtools