【Redis】 redis数据迁移

本文介绍多种Redis数据迁移方案,包括利用AOF文件、RDB文件直接迁移,以及使用redis-migration、redis-rdb-cli等工具进行在线迁移的方法。

0.redis_dump与redis_load

https://github.com/307545758/redis-dump

http://blog.51cto.com/wujianwei/2105124


1aof迁移

开启现有 Redis 实例的 AOF 功能(如果实例已经启用 AOF 功能则忽略此步骤)。
# redis-cli -h old_instance_ip -p old_instance_port config set appendonly yes
通过 AOF 文件将数据导入到新的云数据库 Redis 版实例(假定生成的 AOF 文件名为 appendonly.aof)。
# redis-cli -h aliyun_redis_instance_ip -p 6379 -a password --pipe < appendonly.aof
注意    
如果原有旧的 Redis 实例不需要一直开启 AOF,可在导入完成后通过以下命令关闭。    
# redis-cli -h old_instance_ip -p old_instance_port config set appendonly no




2.拷贝rdb文件

注意:版本不一致会导致启动失败



3.使用迁移工具如:

优势:数据在线迁移,增量也同步,支持集群架构等

https://github.com/helifu/redis-migration

https://github.com/vipshop/redis-migrate-tool


4.强烈推荐这个工具

很强大:包括内存分析 数据备份 数据过滤 在线迁移等等

https://github.com/leonchen83/redis-rdb-cli


5.阿里云工具集

1.单实例迁移:redis-port(全量与时时增量,跨版本成功)

参考:

http://www.aboutyun.com/thread-17544-1-1.html

https://www.jianshu.com/p/a6f32234a398


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29096438/viewspace-2199591/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29096438/viewspace-2199591/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值