https://github.com/vipshop/redis-migrate-tool #仅支持redis3及以下版本

https://github.com/tanruixing88/redis-migrate-tool #基于上述版本修改,支持redis4及以上版本

依赖

yum -y install automake libtool autoconf bzip2

安装

git clone https://github.com/tanruixing88/redis-migrate-tool.git
redis-migrate-tool
autoreconf -fvi
./configure
make
cp src/redis-migrate-tool /usr/local/bin/redis-migrate-tool

也可以直接上传迁移工具
链接:https://pan.baidu.com/s/1NH0uw0-sMBcBh3M9n-X3Ww 提取码:zmiv

1、进入目标机器
编辑配置文件
配置文件示例:从redis cluster集群迁移数据到twemproxy集群

vim a.conf
[source]
type: redis cluster
servers:
 - 172.24.9.79:7000
 - 172.24.9.79:7001
 - 172.24.9.80:7000
 - 172.24.9.80:7001
 - 172.24.9.81:7000
 - 172.24.9.81:7001
[target]
type: twemproxy
servers:
 - 172.24.10.53:8000
 - 172.24.10.53:8001
 - 172.24.10.54:8000
 - 172.24.10.54:8001
 - 172.24.10.55:8000
 - 172.24.10.55:8001
[common]
listen: 0.0.0.0:8888

运行./redis-migrate-tool -c a.conf -o a.log -d