@tom_doerr: 零停机迁移Redis数据 https://github.com/tair-opensource/RedisShake…
摘要
RedisShake是一款开源工具,用于零停机迁移Redis数据,支持多种Redis版本、Valkey以及阿里云和AWS等云服务。
查看缓存全文
缓存时间: 2026/05/31 09:04
零停机迁移Redis数据
https://t.co/2lV9mXr33A https://t.co/vSVAmefz4e
tair-opensource/RedisShake
来源:https://github.com/tair-opensource/RedisShake
RedisShake:Redis 数据转换与迁移工具
CI(https://github.com/tair-opensource/RedisShake/actions/workflows/ci.yml) 网站(https://tair-opensource.github.io/RedisShake/) 发布版(https://github.com/tair-opensource/RedisShake/releases) ghcr.io(https://github.com/tair-opensource/RedisShake/pkgs/container/redisshake)
- 中文文档(https://tair-opensource.github.io/RedisShake/)
- 英文文档(https://tair-opensource.github.io/RedisShake/en/)
概述
RedisShake 是一款强大的 Redis 数据转换与迁移工具,提供以下功能:
-
零停机迁移:实现无缝数据迁移,不丢失数据,不中断服务,确保迁移过程中持续运行。
-
Valkey/Redis 兼容性:支持 Redis(2.8 至 8.4.x)和 Valkey(8.x 至 9.x),涵盖单机、主从、哨兵和集群部署模式。详细功能支持请参见版本兼容性(https://tair-opensource.github.io/RedisShake/zh/others/compatibility.html)。
-
云服务集成:与主流云服务商的 Redis 兼容数据库无缝配合:
- 阿里云:Tair(兼容 Redis® OSS)(https://www.alibabacloud.com/en/product/tair)
- AWS:ElastiCache(https://aws.amazon.com/elasticache/)、MemoryDB(https://aws.amazon.com/memorydb/)
-
模块支持:兼容 TairString(https://github.com/tair-opensource/TairString)、TairZSet(https://github.com/tair-opensource/TairZset)和 TairHash(https://github.com/tair-opensource/TairHash)。
-
灵活的数据源:支持 PSync(https://tair-opensource.github.io/RedisShake/zh/reader/sync_reader.html)、RDB(https://tair-opensource.github.io/RedisShake/zh/reader/rdb_reader.html)和 Scan(https://tair-opensource.github.io/RedisShake/zh/reader/scan_reader.html)数据读取方式。
-
高级数据处理:支持基于自定义脚本的数据转换(https://tair-opensource.github.io/RedisShake/zh/filter/function.html)和易用的数据过滤规则(https://tair-opensource.github.io/RedisShake/zh/filter/filter.html)。
如何获取 RedisShake
面向人类用户
-
从发布版(https://github.com/tair-opensource/RedisShake/releases)下载。
-
使用 Docker:
docker run --network host \
-e SYNC=true \
-e SHAKE_SRC_ADDRESS=127.0.0.1:6379 \
-e SHAKE_DST_ADDRESS=127.0.0.1:6380 \
ghcr.io/tair-opensource/redisshake:latest
- 自行构建:
前提条件: 运行构建脚本前,必须确保系统中已安装 Go 且可用。
git clone https://github.com/tair-opensource/RedisShake
cd RedisShake
sh build.sh
面向 LLM Agent
将以下提示复制粘贴给你的 LLM Agent(如 Claude Code、Cursor 等):
请阅读 RedisShake 使用指南,并协助我完成以下任务:
https://raw.githubusercontent.com/tair-opensource/RedisShake/v4/README_FOR_AGENTS.md
如何使用 RedisShake
在两个 Redis 实例之间迁移数据并跳过某些键:
- 创建名为
shake.toml的文件,包含以下配置:
[sync_reader]
address = "127.0.0.1:6379"
[redis_writer]
address = "127.0.0.1:6380"
[filter]
# 跳过以 "temp:" 或 "cache:" 为前缀的键
block_key_prefix = ["temp:", "cache:"]
- 运行 RedisShake:
./redis-shake shake.toml
更多帮助请查阅文档(https://tair-opensource.github.io/RedisShake/zh/guide/mode.html)。
限制
不支持断点续传(Checkpoint):RedisShake 4.x 不支持断点续传。与阿里云 DTS、Tair 全球多活等商业解决方案不同(这些方案可在中断后从最后一个检查点恢复),RedisShake 重启后会从头开始全量重新同步。
不支持集群拓扑变更感知:RedisShake 假设集群拓扑是静态的。任何拓扑变化(如扩缩容、故障转移、槽迁移)都会导致进程崩溃。结合不支持的断点续传功能,RedisShake 最适合一次性数据迁移场景,而非长期持续同步。
跨版本迁移
在不同主版本 Redis 之间迁移数据前,建议使用 resp-compatibility(https://github.com/tair-opensource/resp-compatibility/) 工具进行兼容性检查,并参考兼容性报告(https://github.com/tair-opensource/resp-compatibility/blob/main/compatibility_report_en_US.md),以避免已知的 breaking changes 和 bug。
历史
RedisShake 由阿里云 Tair 团队(https://github.com/tair-opensource)积极维护,源自 redis-port(https://github.com/CodisLabs/redis-port)。关键里程碑:
- RedisShake 2.x(https://github.com/tair-opensource/RedisShake/tree/v2):改进稳定性和性能。
- RedisShake 3.x(https://github.com/tair-opensource/RedisShake/tree/v3):完全重写代码库,提升效率和易用性。
- RedisShake 4.x(https://github.com/tair-opensource/RedisShake/tree/v4):增强的读取器、配置、可观测性和函数支持。
许可证
RedisShake 采用 MIT 许可证(https://github.com/tair-opensource/RedisShake/blob/v2/license.txt)开源。
相似文章
Redis 与野心的代价
本文批评了 Redis 最近的战略方向,重点指出了许可变更引发的冲突、功能冗余泛滥,以及其向“AI 上下文引擎”定位的转变。文章分析了宏大的企业目标如何影响了项目的开放性和简洁性。
@axiaisacat: Redis 作者 antirez 又扔了个硬核项目:ds4。 不是又一个 GGUF runner,而是专门为 DeepSeek V4 Flash 写的本地推理引擎: Metal / CUDA 2-bit 量化 1M context KV …
Redis creator antirez released ds4, a local inference engine optimized for DeepSeek V4 Flash with 2-bit quantization and support for 1M context KV cache on Metal and CUDA.
@cognition: Beau Rothrock 在 @AngelList 工作两个月时,接手了一个陷入严重困境的从 Redshift 迁移到 Snowflake 的项目……
Beau Rothrock 使用 AI 编程助手 Devin,在五周内将 14,000 个仪表盘从 Redshift 迁移到 Snowflake,成功克服了项目延误的问题。
@VincentLogic: 发现个炸裂的开源项目!Redis 之父 antirez 亲自下场搞了个大新闻! ds4 —— DeepSeek V4 Flash 本地推理引擎,专为 Mac Metal 优化,连续霸榜 GitHub 好几天! 最狠的地方来了: 128GB…
Redis 之父 antirez 发布了名为 ds4 的开源项目,是专为 Mac Metal 优化的 DeepSeek V4 Flash 本地推理引擎,支持磁盘 KV 缓存、超长上下文,性能优异。
Redis 8.8:新数组数据结构、速率限制器、性能改进
Redis 8.8 现已推出,包含新的数组数据结构、窗口计数器限流器、哈希字段的子键通知、时间序列查询中的多个聚合器,以及各种操作的显著性能改进。