当前位置:网站首页>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 .
边栏推荐
- 用Pytorch搭建第一个神经网络且进行优化
- Error: `brew cask` is no longer a `brew` command. Use `brew <command> --cask` instead.
- Container adapter - stack: stack queue: queue priority_ Queue: priority queue
- FatMouse and Cheese
- 手机买同业存单基金开户选哪家证券公司比较好,比较安全呢
- Webrtc advantages and module splitting
- How to implement two factor authentication MFA based on RADIUS protocol?
- Rman Backup Report Ora - 19809 Ora - 19804
- break database---mysql
- 【.NET6】gRPC服务端和客户端开发案例,以及minimal API服务、gRPC服务和传统webapi服务的访问效率大对决
猜你喜欢

Common tools for interface testing --postman

如何抑制SiC MOSFET Crosstalk(串扰)?

Lilda low code data large screen, leveling the threshold of data application development

与普通探头相比,差分探头有哪些优点

High rise building fire prevention

webrtc优势与模块拆分

rman備份報ORA-19809 ORA-19804

Webrtc advantages and module splitting

It only takes two steps to find the right PMP organization, one check and two questions

Construire le premier réseau neuronal avec pytorch et optimiser
随机推荐
Comment supprimer le crosstalk SiC MOSFET?
STL -- binder
Matlab tips (20) matrix analysis -- principal component regression
Data modeling based on wide table
Where is CentOS mysql5.5 configuration file
Is it safe for CICC fortune to open an account? How much do you charge?
网上炒股开户安不安全?
Music website design based on harmonyos (portal page)
Application of energy management system in iron and steel enterprises
Apache Doris becomes the top project of Apache
Android studio interview preparation
[go ~ 0 to 1] on the first day, June 24, variables, conditional judgment cycle statement
[go ~ 0 to 1] the next day, June 25, switch statement, array declaration and traversal
Installation of containerd1.5.5
Loggerfactory uses log4j Parameter introduction of properties
[untitled]
Mysql8.0 forgot the root password
High rise building fire prevention
【大案例】学成在线网站
Privacy computing fat----- offline prediction