I've got 2 redis cluster, and I wish to move a lot of data from old cluster to new cluster.
I've write a script using redis-cli
and MIGRATE
command.
It success at about first 20 keys, then it start failing and getting this error.
10.233.141.88:11300: MOVED 13905 10.233.141.9:11300
10.233.141.10:11300: MOVED 13905 10.233.141.9:11300
10.233.141.89:11300: MOVED 13905 10.233.141.9:11300
10.233.141.9:11300: ERR Target instance replied with error: MOVED 13905 10.241.164.59:7000
10.233.141.90:11300: MOVED 13905 10.233.141.9:11300
10.233.141.91:11300: MOVED 13905 10.233.141.9:11300
Also when I query the new redis, all migrated key is in node1
. node2
and node3
are empty.
The migrate command I use is in following format, and I can't find an option which can move old data to new cluster and balance it.
redis-cli -a ${OLD_REDIS_PASSWORD} --cluster call ${OLD_REDIS_NODE1_IP}:${OLD_REDIS_NODE1_PORT} MIGRATE ${NEW_REDIS_NODE1_IP} ${NEW_REDIS_NODE1_PORT} ${KEY} 0 100 COPY AUTH ${NEW_REDIS_PASSWORD}
Is there a way to move data to a cluster using MIGRATE
command.