codis迁移数据

codis官方文档

https://github.com/CodisLabs/codis/blob/master/doc/tutorial_zh.md

 

1、阿里开源工具:Codis/Redis集群版通过redis-shake迁移上云

https://help.aliyun.com/document_detail/125941.html?spm=5176.2020520141.0.0.308c6375KXAK0c

2、官方工具:https://github.com/CodisLabs/redis-port

   华为云示例:使用Redis-cli和Redis-port工具迁移自建Codis集群

  https://support.huaweicloud.com/migration-dcs/dcs-migrate-demo01.html

复制代码
#!/bin/bash

source_redis_address=(
172.18.11.1
172.18.11.2
172.18.11.3
172.18.11.4
172.18.11.5
)

source_redis_port='6379'
source_redis_password='passwd'

for i in ${source_redis_address[@]}
do
  echo "[$i]"
  /opt/codis/bin/redis-cli -h $i -p ${source_redis_port} -a ${source_redis_password} --rdb ${i}.rdb
  if [ $? -ne 0 ];then
    echo "redis-cli rdb failed!"
    exit 1
  else
    echo "redis-cli rdb successed."
  fi

  /opt/soft/redis-port-v2.0-beta-go1.10.1-linux/redis-restore -n 4 -i ${i}.rdb -t  {new_redis_passwd}@{new_redis_host}:{new_redis_port}   
  if [ $? -ne 0 ];then
    echo "redis-restore failed!"
    exit 1
  else
    echo "redis-restore successed."
  fi
done

echo "Finished"
复制代码

 

posted @   Justtosee  阅读(51)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
点击右上角即可分享
微信分享提示