ITPub博客

首页 > 数据库 > NoSQL > 【Redis】 redis数据迁移

【Redis】 redis数据迁移

原创 NoSQL 作者:小亮520cl 时间:2018-08-09 20:53:09 4 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/29096438/viewspace-2199591/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
毕业以后专业任职数据库工程师职位,itpub一直作为自己的笔记记录的地方,blog写的不详细,草书笔记,仅供参考!

注册时间:2013-09-12

  • 博文量
    529
  • 访问量
    1126911