4

We have a single Redis instance with a good amount of data (over 100GB). We also have an empty Redis Cluster with 6 nodes. 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?

Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57

2 Answers2

2

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/

Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57
  • Yeah that's the best I've found so far as well, but redis-trib.rb is no longer available in redis version 5. My test cluster gets stuck while resharding slots from instance 1 to instance 2 Moving slot 1186 from 127.0.0.1:30001 to 127.0.0.1:30002: ERR Target instance replied with error: CLUSTERDOWN The cluster is down – Arnoldas Oct 29 '18 at 14:22
0

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 --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). However if you are actually using this kind of commands, you are not supposed to use a cluster.

neuront
  • 9,312
  • 5
  • 42
  • 71