From 4ab7fe9ff04f2b759b30a3a358a75ceeb8a771b8 Mon Sep 17 00:00:00 2001 From: suxb201 Date: Fri, 13 Aug 2021 11:29:57 +0800 Subject: [PATCH] improve the document (#353) --- .gitignore | 1 - README.md | 75 +++++++++++++++++++++++-------------------- conf/redis-shake.conf | 33 ++++++++++++++----- 3 files changed, 65 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 0d3ceb7..818cc75 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,5 @@ data .cache/ diagnostic/ -*.pid src/vendor/* !src/vendor/vendor.json diff --git a/README.md b/README.md index 2dbf00e..9604248 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,14 @@ Thanks to the Douyu's WSD team for the support.
* [Release package](https://github.com/alibaba/RedisShake/releases) # Redis-Shake ---- -Redis-shake is developed and maintained by NoSQL Team in Alibaba-Cloud Database department.
-Redis-shake has made some improvements based on [redis-port](https://github.com/CodisLabs/redis-port), including bug fixes, performance improvements and feature enhancements.
+ +Redis-shake is developed and maintained by NoSQL Team in Alibaba-Cloud Database department. + +Redis-shake has made some improvements based on [redis-port](https://github.com/CodisLabs/redis-port), including bug fixes, performance improvements and feature enhancements. # Main Functions ---- -The type can be one of the followings:
+ +The type can be one of the followings: * **decode**: Decode dumped payload to human readable format (hex-encoding). * **restore**: Restore RDB file to target redis. @@ -21,23 +22,26 @@ The type can be one of the followings:
* **sync**: Sync data from source redis to target redis by `sync` or `psync` command. Including full synchronization and incremental synchronization. * **rump**: Sync data from source redis to target redis by `scan` command. Only support full synchronization. Plus, RedisShake also supports fetching data from given keys in the input file when `scan` command is not supported on the source side. This mode is usually used when `sync` and `psync` redis commands aren't supported. -Please check out the `conf/redis-shake.conf` to see the detailed parameters description.
+Please check out the `conf/redis-shake.conf` to see the detailed parameters description. # Support ---- -Redis version from 2.x to 5.0. -Supports `Standalone`, `Cluster`, and some proxies type like `Codis`, `twemproxy`, `Aliyun Cluster Proxy`, `Tencent Cloud Proxy` and so on.
+ +Redis version from 2.x to 6.x. + +Supports `Standalone`, `Cluster` and some proxies type like `Codis`, `twemproxy`, `Aliyun Cluster Proxy`, `Tencent Cloud Proxy` and so on. + For `codis` and `twemproxy`, there maybe some constraints, please checkout this [question](https://github.com/alibaba/RedisShake/wiki/FAQ#q-does-redisshake-supports-codis-and-twemproxy). # Configuration -Redis-shake has several parameters in the configuration(`conf/redis-shake.conf`) that maybe confusing, if this is your first time using, please visit this [tutorial](https://github.com/alibaba/RedisShake/wiki/tutorial-about-how-to-set-up). + +Redis-shake has several parameters in the configuration `conf/redis-shake.conf`, that maybe confusing, if this is your first time using, please visit this [tutorial](https://github.com/alibaba/RedisShake/wiki/tutorial-about-how-to-set-up). # Verification ---- -User can use [RedisFullCheck](https://github.com/alibaba/RedisFullCheck) to verify correctness.
+ +User can use [RedisFullCheck](https://github.com/alibaba/RedisFullCheck) to verify correctness. # Metric ---- + Redis-shake offers metrics through restful api and log file.
* restful api: `curl 127.0.0.1:9320/metric`. @@ -45,14 +49,17 @@ Redis-shake offers metrics through restful api and log file.
* inner routine heap: `curl http://127.0.0.1:9310/debug/pprof/goroutine?debug=2` # Redis Type ---- -Both the source and target type can be standalone, opensource cluster and proxy. Although the architecture patterns of different vendors are different for the proxy architecture, we still support different cloud vendors like alibaba-cloud, tencent-cloud and so on.
-If the target is open source redis cluster, redis-shake uses [redis-go-cluster](https://github.com/chasex/redis-go-cluster) driver to write data. When target type is proxy, redis-shakes write data in round-robin way.
-If the source is redis cluster, redis-shake launches multiple goroutines for parallel pull. User can use `rdb.parallel` to control the RDB syncing concurrency.
-The "move slot" operations must be disabled on the source side.
+ +Both the source and target type can be standalone, opensource cluster and proxy. Although the architecture patterns of different vendors are different for the proxy architecture, we still support different cloud vendors like alibaba-cloud, tencent-cloud and so on. + +If the target is open source redis cluster, redis-shake uses [redis-go-cluster](https://github.com/chasex/redis-go-cluster) driver to write data. When target type is proxy, redis-shakes write data in round-robin way. + +If the source is redis cluster, redis-shake launches multiple goroutines for parallel pull. User can use `rdb.parallel` to control the RDB syncing concurrency. + +The "move slot" operations must be disabled on the source side. # Code branch rules ---- + Version rules: a.b.c. * a: major version @@ -60,40 +67,38 @@ Version rules: a.b.c. * c: bugfix version | branch name | rules | -| - | :- | +| --- | :--- | | master | master branch, do not allowed push code. store the latest stable version. develop branch will merge into this branch once new version created.| | **develop**(main branch) | develop branch. all the bellowing branches fork from this. | | feature-\* | new feature branch. forked from develop branch and then merge back after finish developing, testing, and code review. | | bugfix-\* | bugfix branch. forked from develop branch and then merge back after finish developing, testing, and code review. | | improve-\* | improvement branch. forked from develop branch and then merge back after finish developing, testing, and code review. | -Tag rules:
-Add tag when releasing: "release-v{version}-{date}". for example: "release-v1.0.2-20180628"
+Tag rules: +Add tag when releasing: "release-v{version}-{date}". for example: "release-v1.0.2-20180628" User can use `-version` to print the version. # Usage ---- -You can **directly download** the binary in the [release package](https://github.com/alibaba/RedisShake/releases), and use `start.sh` script to start it directly: `./start.sh redis-shake.conf sync`.
+ +You can **directly download** the binary in the [release package](https://github.com/alibaba/RedisShake/releases), and use `start.sh` script to start it directly: `./start.sh redis-shake.conf sync`. + You can also build redis-shake yourself according to the following steps, the `go` and `govendor` must be installed before compile: -* git clone https://github.com/alibaba/RedisShake.git -* cd RedisShake -* export GOPATH=\`pwd\` -* cd src/vendor -* govendor sync #please note: must install govendor first and then pull all dependencies: `go get -u github.com/kardianos/govendor` -* cd ../../ && ./build.sh -* ./bin/redis-shake -type=$(type_must_be_sync_dump_restore_decode_or_rump) -conf=conf/redis-shake.conf #please note: user must modify collector.conf first to match needs. +* git clone https://github.com/alibaba/RedisShake.git +* cd RedisShake +* sh build.sh +* ./bin/redis-shake -type=$(type_must_be_sync_dump_restore_decode_or_rump) -conf=./conf/redis-shake.conf # please note: user must modify redis-shake.conf first to match needs. # Shake series tool ---- -We also provide some tools for synchronization in Shake series.
+ +We also provide some tools for synchronization in Shake series. * [MongoShake](https://github.com/aliyun/MongoShake): mongodb data synchronization tool. * [RedisShake](https://github.com/aliyun/RedisShake): redis data synchronization tool. * [RedisFullCheck](https://github.com/aliyun/RedisFullCheck): redis data synchronization verification tool. * [NimoShake](https://github.com/alibaba/NimoShake): sync dynamodb to mongodb. -Plus, we have a DingDing(钉钉) group so that users can join and discuss, please scan the code. -![DingDing](resources/dingding_group.png)
+Plus, we have a [DingTalk](https://www.dingtalk.com/) group, so that users can join and discuss. +Group code: 23165540 # Thanks --- diff --git a/conf/redis-shake.conf b/conf/redis-shake.conf index 1494f72..213bcde 100644 --- a/conf/redis-shake.conf +++ b/conf/redis-shake.conf @@ -1,20 +1,34 @@ -# this is the configuration of redis-shake. -# if you have any problem, please visit https://github.com/alibaba/RedisShake/wiki/FAQ +# This file is the configuration of redis-shake. + +# If you have any problem, please visit: https://github.com/alibaba/RedisShake/wiki/FAQ +# 有疑问请先查阅:https://github.com/alibaba/RedisShake/wiki/FAQ # current configuration version, do not modify. # 当前配置文件的版本号,请不要修改该值。 conf.version = 1 -# ------------------------------------------------------ # id id = redis-shake -# log file,日志文件,不配置将打印到stdout (e.g. /var/log/redis-shake.log ) +# The log file name, if left blank, it will be printed to stdout, +# otherwise it will be printed to the specified file. +# 日志文件名,留空则会打印到 stdout,否则打印到指定文件。 +# for example: +# log.file = +# log.file = /var/log/redis-shake.log log.file = -# log level: "none", "error", "warn", "info", "debug". default is "info". + +# log level: "none", "error", "warn", "info", "debug". +# default is "info". +# 日志等级,可选:none error warn info debug +# 默认为:info log.level = info -# pid path,进程文件存储地址(e.g. /var/run/),不配置将默认输出到执行下面, -# 注意这个是目录,真正的pid是`{pid_path}/{id}.pid` + +# 进程文件存储目录,留空则会输出到当前目录, +# 注意这个是目录,真正生成的 pid 是 {pid_path}/{id}.pid +# 例如: +# pid_path = ./ +# pid_path = /var/run/ pid_path = # pprof port. @@ -35,8 +49,11 @@ parallel = 32 # 2. "sentinel": the redis address is read from sentinel. # 3. "cluster": the source redis has several db. # 4. "proxy": the proxy address, currently, only used in "rump" mode. -# 源端redis的类型,支持standalone,sentinel,cluster和proxy四种模式,注意:目前proxy只用于rump模式。 +# used in `dump`, `sync` and `rump`. +# 源端 Redis 的类型,可选:standalone sentinel cluster proxy +# 注意:proxy 只用于 rump 模式。 source.type = standalone + # ip:port # the source address can be the following: # 1. single db address. for "standalone" type.