简体   繁体   English

将Redis数据迁移到群集

[英]Migrate Redis Data To Cluster

We have a single Redis instance with a good amount of data (over 100GB). 我们有一个具有大量数据(超过100GB)的Redis实例。 We also have an empty Redis Cluster with 6 nodes. 我们还有一个空的Redis群集,包含6个节点。 What would be the best way to move all that data from the stand-alone instance to the Redis Cluster and make it distribute it evenly? 将所有数据从独立实例移动到Redis群集并使其均匀分布的最佳方法是什么?

After some searching around, I came across a post detailing how to move data over to a cluster. 经过一番搜索后,我遇到了一篇文章,详细介绍了如何将数据移到群集中。 It may take some time to move lots of data over but this is the best way I've seen so far. 移动大量数据可能需要一些时间,但这是我迄今为止看到的最佳方式。

You can read about it here: https://fnordig.de/2014/03/11/redis-cluster-with-pre-existing-data/ 你可以在这里阅读: https//fnordig.de/2014/03/11/redis-cluster-with-pre-existing-data/

You could make it easier by using redis-rdb-tools and a cluster proxy programm like redis-cerberus after you dump data into an RDB file 将数据转储到RDB文件后,使用redis-rdb-tools和集群代理程序(如redis-cerberus)可以更轻松

rdb --command protocol RDB_FILE_PATH | nc PROXY_HOST PROXY_PORT

Piping an AOF file into a proxy maybe doesn't work somehow if the AOF file contains cross-slots commands like RPOPLPUSH (depending on the proxy's implementation). 如果AOF文件包含RPOPLPUSH类的交叉槽命令(取决于代理的实现),将AOF文件管道到代理中可能无法以某种方式工作 However if you are actually using this kind of commands, you are not supposed to use a cluster. 但是,如果您实际使用此类命令,则不应使用群集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM