Artem Kalinchuk
Artem Kalinchuk

Reputation: 6652

Migrate Redis Data To Cluster

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?

Upvotes: 5

Views: 7625

Answers (3)

suxb201
suxb201

Reputation: 33

You can use RedisShake to migrate your Redis data to a cluster:

shake.toml:

[sync_reader]
address = "127.0.0.1:6379"

[redis_writer]
cluster = true
address = "127.0.0.1:6380"

Start RedisShake by running the following command:

./redis-shake shake.toml

I hope this helps!

Upvotes: 0

neuront
neuront

Reputation: 9612

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.

Upvotes: 0

Artem Kalinchuk
Artem Kalinchuk

Reputation: 6652

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/

Upvotes: 3

Related Questions