From 99a1c800436b973b5d8fab907b87fb29ca1a97e0 Mon Sep 17 00:00:00 2001 From: suxb201 Date: Wed, 21 Sep 2022 16:45:18 +0800 Subject: [PATCH] move Chinese documentation to wiki --- README.md | 7 ++- README_zh.md | 108 -------------------------------------------- docs/quick_start.md | 78 -------------------------------- 3 files changed, 3 insertions(+), 190 deletions(-) delete mode 100644 README_zh.md delete mode 100644 docs/quick_start.md diff --git a/README.md b/README.md index 1e674a4..5c7a963 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,16 @@ [![CI](https://github.com/alibaba/RedisShake/actions/workflows/ci.yml/badge.svg?branch=v3)](https://github.com/alibaba/RedisShake/actions/workflows/ci.yml) -- [中文文档](./README_zh.md) -- [快速开始](./docs/quick_start.md) +- [中文文档](https://github.com/alibaba/RedisShake/wiki) redis-shake is a tool for Redis data migration and data filtering. ## Feature -* ⚡ High performance +* 🚄 High performance * ✅ Tested on Redis 5.0, Redis 6.0 and Redis 7.0 -* 🤗 Support custom filtering rules using lua +* 🤗 Support custom filtering rules * 💪 Support large instance migration * 💖 Support `restore` mode and `sync` mode * ☁️ Support Aliyun Redis and ElastiCache diff --git a/README_zh.md b/README_zh.md deleted file mode 100644 index 80c15f8..0000000 --- a/README_zh.md +++ /dev/null @@ -1,108 +0,0 @@ -# redis-shake - -[![CI](https://github.com/alibaba/RedisShake/actions/workflows/ci.yml/badge.svg?branch=v3)](https://github.com/alibaba/RedisShake/actions/workflows/ci.yml) - -redis-shake 是一个用来做 Redis 数据迁移的工具,并提供一定程度的数据清洗能力。 - -## 特性 - -* ⚡ 高效地数据迁移 -* 🌲 支持 Redis 原生数据结构 -* 🌐 支持源端为单机实例,目的端为单机或集群实例 -* ✅ 测试在 Redis 5.0、Redis 6.0 和 Redis 7.0 -* 🤗 支持使用 lua 自定义过滤规则 -* 💪 支持大实例迁移 - -![image.png](https://s2.loli.net/2022/06/30/vU346lVBrNofKzu.png) - -# 文档 - -## 安装 - -### 从 Release 下载安装 - -Release: [https://github.com/alibaba/RedisShake/releases](https://github.com/alibaba/RedisShake/releases) - -### 从源码编译 - -下载源码后,运行 `sh build.sh` 命令编译。 - -```shell -sh build.sh -``` - -## 运行 - -1. 编辑 redis-shake.toml,修改其中的 source 与 target 配置项 -2. 启动 redis-shake: - -```shell -./bin/redis-shake redis-shake.toml -``` - -3. 观察数据同步情况 - -## 配置 - -redis-shake 配置文件参考 `redis-shake.toml`。 为避免歧义强制要求配置文件中的每一项配置均需要赋值,否则会报错。 - -## 数据过滤 - -redis-shake 支持使用 lua 脚本自定义过滤规则,可以实现对数据进行过滤。 搭配 lua 脚本时,redis-shake 启动命令: - -```shell -./bin/redis-shake redis-shake.toml filter/xxx.lua -``` - -lua 的书写参照 `filter/*.lua` 文件,目前提供以下过滤模板供参考: - -1. `filter/print.lua`:打印收到的所有命令 -2. `filter/swap_db.lua`:交换 db0 和 db1 的数据 - -### 自定义过滤规则 - -参照 `filter/print.lua` 新建一个 lua 脚本,并在 lua 脚本中实现 filter 函数,该函数的参数为: - -- id:命令序列号 -- is_base:是否是从 dump.rdb 文件中读取的命令 -- group:命令组,不同命令所归属的 Group 见 [redis/src/commands](https://github.com/redis/redis/tree/unstable/src/commands) 下的描述文件 -- cmd_name:命令名称 -- keys:命令的 keys -- slots:keys 的 slots -- db_id:数据库 id -- timestamp_ms:命令的时间戳,单位为毫秒。目前版本不支持。 - -返回值为: - -- code - - 0:表示不过滤该命令 - - 1:表示过滤该命令 - - 2:表示不应该出现该命令,并让 redis-shake 报错退出 -- db_id:重定向的 db_id - -# 贡献 - -## lua 脚本 - -欢迎分享更有创意的 lua 脚本。 - -1. 在 `filters/` 下添加相关脚本。 -2. 在 `README.md` 中添加相关描述。 -3. 提交一份 pull request。 - -## Redis Module 支持 - -1. 在 `internal/rdb/types` 下添加相关类型。 -2. 在 `scripts/commands` 下添加相关命令,并使用脚本生成 `table.go` 文件,移动至 `internal/commands` 目录。 -3. 在 `test/cases` 下添加相关测试用例。 -4. 提交一份 pull request。 - -# 感谢 - -redis-shake 旧版是阿里云基于豌豆荚开源的 redis-port 进行二次开发的一个支持 Redis 异构集群实时同步的工具。 -redis-shake v3 在 redis-shake 旧版的基础上重新组织代码结构,使其更具可维护性的版本。 - -redis-shake v3 参考借鉴了以下项目: - -- https://github.com/HDT3213/rdb -- https://github.com/sripathikrishnan/redis-rdb-tools \ No newline at end of file diff --git a/docs/quick_start.md b/docs/quick_start.md deleted file mode 100644 index 44289fc..0000000 --- a/docs/quick_start.md +++ /dev/null @@ -1,78 +0,0 @@ -# 快速开始 - -## 实例信息 - -### 实例 A - -- 地址:r-aaaaa.redis.zhangbei.rds.aliyuncs.com -- 端口:6379 -- 密码:r-aaaaa:xxxxx - -### 实例 B - -- 地址:r-bbbbb.redis.zhangbei.rds.aliyuncs.com -- 端口:6379 -- 密码:r-bbbbb:xxxxx - -### 实例 C 集群实例 - -- 地址: - - 192.168.0.1:6379 - - 192.168.0.2:6379 - - 192.168.0.3:6379 - - 192.168.0.4:6379 -- 密码:r-ccccc:xxxxx - -## 工作目录 - -``` -. -├── redis-shake # 二进制程序 -└── redis-shake.toml # 配置文件 -``` - -## 开始 - -## A -> B 同步 - -修改 `redis-shake.toml`,改为如下配置: - -```toml -[source] -type = "sync" -address = "r-aaaaa.redis.zhangbei.rds.aliyuncs.com:6379" -password = "r-aaaaa:xxxxx" - -[target] -type = "standalone" -address = "r-bbbbb.redis.zhangbei.rds.aliyuncs.com:6379" -password = "r-bbbbb:xxxxx" -``` - -启动 redis-shake: - -```bash -./redis-shake redis-shake.toml -``` - -## A -> C 同步 - -修改 `redis-shake.toml`,改为如下配置: - -```toml -[source] -type = "sync" -address = "r-aaaaa.redis.zhangbei.rds.aliyuncs.com:6379" -password = "r-aaaaa:xxxxx" - -[target] -type = "cluster" -address = "192.168.0.1:6379" # 这里写集群中的任意一个节点的地址即可 -password = "r-ccccc:xxxxx" -``` - -启动 redis-shake: - -```bash -./redis-shake redis-shake.toml -``` \ No newline at end of file