如何把阿里云上redis实例的数据迁移到另外的实例?

参考:
https://help.aliyun.com/document_detail/43850.html
做好公网连接Redis

用 github 上的 redis 迁移工具 redis-migrate-tool 就可以解决。
系统:阿里云CentOS Linux release 7.2.1511
1、安装git
a.sudo yum install “Development Tools”
b.sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
c.wget https://Github.com/Git/Git/archive/v2.3.0.tar.gz
d.tar xvf v2.3.0.tar.gz
e.cd git-2.3.0
f.安装依赖包:
yum install libcurl-dev libcurl-devel
yum install expat-devel
g.make install
h.git –version
2、安装 autoconf 和 automake
curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
tar -xzvf m4-1.4.13.tar.gz
cd m4-1.4.13
./configure
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
tar -xzvf autoconf-2.65.tar.gz
cd autoconf-2.65
./configure
make
sudo make install
cd ..
//here you might want to restart your terminal session, to ensure the new autoconf is picked up and used in the rest of the script
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
tar xzvf automake-1.11.tar.gz
cd automake-1.11
./configure
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzvf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure
make
sudo make install

3、编译生成 redis-migrate-tool
yum -y install bzip2
git clone https://github.com/vipshop/redis-migrate-tool.git
cd redis-migrate-tool
autoreconf -fvi
./configure
make

4、修改 redis-migrate-tool 的 rmt.conf 配置文件
[source]
type:rdb file
servers :
-/data/hins-xxxxxx.rdb

[target]
type:single
servers:
-xxxxxx.redis.rds.aliyuncs.com:6379
redis_auth:xxxxxx

[common]
listen: 0.0.0.0:8888

并拷贝一份rmt.conf 到 src文件夹下

5、完成迁移
src/redis-migrate-tool -c rmt.conf -o log -d
需要查看过程的话,使用:
src/redis-migrate-tool -c rmt.conf

你可能感兴趣的:(数据管理,redis,centos,git,阿里云)