Redis-full-check is used to compare whether two redis have the same data. We also offer a data synchronization tool called [redis-shake](https://github.com/aliyun/redis-shake) to syncing data from one redis to another redis.<br>
Thanks to the Douyu's WSD team for the support. <br>
* [中文文档](https://yq.aliyun.com/articles/690463)
* [Download redis-full-check.tar.gz](https://github.com/alibaba/RedisFullCheck/releases)
* [第一次使用,如何进行配置](https://github.com/alibaba/RedisFullCheck/wiki/%E7%AC%AC%E4%B8%80%E6%AC%A1%E4%BD%BF%E7%94%A8%EF%BC%8C%E5%A6%82%E4%BD%95%E8%BF%9B%E8%A1%8C%E9%85%8D%E7%BD%AE%EF%BC%9F)
# redis-full-check
---
Redis-full-check is developed and maintained by NoSQL Team in Alibaba-Cloud Database department.<br>
Redis-full-check performs full data verification by comparing the data of the source database and the destination database. The entire check process consists of multiple comparisons, in every comparison, redis-full-check fetches data from two dabatases and then compared, the inconsistent data is put into sqlite3 db for the next comparison. By this iteratively comparing method, the difference continues to converge. The following figure shows the dataflow. In every comparison which is the yellow box, redis-full-check fetches all keys firstly. After that, it runs comparison and stores the difference result(key and field) into the sqlite3 db which is the position that keys and fields can be fetched in next round instead of the source database.<br>
![dataflow.png](https://github.com/aliyun/redis-full-check/blob/master/resources/dataflow.png)<br>
Redis-full-check fetches keys from source and then checks these keys exist on the target. So if one key exists on the target but lack on the source, redis-full-check can't find it. If you want to know whether the data in the source and destination databases are exactly the same, you need to set up a bidirectional link: <br>
* source->RedisFullCheck->target
* target->RedisFullCheck->source
# supports
standalone, cluster, proxy(aliyun-cluster, tencent-cluster). Redis version from 2.x to 7.x (Don't support Redis Modules).
# Code branch rules
Version rules: a.b.c.<br>
* a: major version
* b: minor version. even number means stable version.
* 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:<br>
Add tag when releasing: "release-v{version}-{date}". for example: "release-v1.0.2-20180628"
# Paramters
```
Usage:
redis-full-check [OPTIONS]
Application Options:
-s, --source=SOURCE Set host:port of source redis.
-p, --sourcepassword=Password Set source redis password (format: password or username:password)
--sourceauthtype=AUTH-TYPE useless for opensource redis, valid value:auth/adminauth (default: auth)
-t, --target=TARGET Set host:port of target redis.
-a, --targetpassword=Password Set target redis password (format: password or username:password)
--targetauthtype=AUTH-TYPE useless for opensource redis, valid value:auth/adminauth (default: auth)
-d, --db=Sqlite3-DB-FILE sqlite3 db file for store result. If exist, it will be removed and a new file is created. (default: result.db)
--comparetimes=COUNT Total compare count, at least 1. In the first round, all keys will be compared. The subsequent rounds of the comparison
will be done on the previous results. (default: 3)
-m, --comparemode= compare mode, 1: compare full value, 2: only compare value length, 3: only compare keys outline, 4: compare full value,
but only compare value length when meets big key (default: 2)
--id= used in metric, run id (default: unknown)
--jobid= used in metric, job id (default: unknown)
--taskid= used in metric, task id (default: unknown)
-q, --qps= max qps limit (default: 15000)
--interval=Second The time interval for each round of comparison(Second) (default: 5)
--batchcount=COUNT the count of key/field per batch compare, valid value [1, 10000] (default: 256)
--parallel=COUNT concurrent goroutine number for comparison, valid value [1, 100] (default: 5)
--log=FILE log file, if not specified, log is put to console
--result=FILE store all diff result, format is 'db diff-type key field'
--metric=FILE metrics file
--bigkeythreshold=COUNT
-f, --filterlist=FILTER if the filter list isn't empty, all elements in list will be synced. The input should be split by '|'. The end of the
string is followed by a * to indicate a prefix match, otherwise it is a full match. e.g.: 'abc*|efg|m*' matches 'abc',
'abc1', 'efg', 'm', 'mxyz', but 'efgh', 'p' aren't'
-v, --version
Help Options:
-h, --help Show this help message
```
# Usage
---
Run `./bin/redis-full-check.darwin64` or `redis-full-check.linux64` which is built in OSX and Linux respectively, however, the binaries aren't always the newest version.<br>
Or you can build redis-full-check yourself according to the following steps:<br>
* git clone https://github.com/alibaba/RedisFullCheck.git
* cd RedisFullCheck/
* ./build.sh
* ./bin/redis-full-check -s $(source_redis_ip_port) -p $(source_password) -t $(target_redis_ip_port) -a $(target_password) # these parameters should be given by users
Here comes the sqlite3 example to display the conflict result:<br>
```
$ sqlite3 result.db.3 # result.db.x shows the x-round comparison conflict result. len == -1 means inconsistent key type.
sqlite> select * from key;
id key type conflict_type db source_len target_len
---------- --------------- ---------- ------------- ---------- ---------- ----------
1 keydiff1_string string value 1 6 6
2 keydiff_hash hash value 0 2 1
3 keydiff_string string value 0 6 6
4 key_string_diff string value 0 6 6
5 keylack_string string lack_target 0 6 0
sqlite>
sqlite> select * from field;
id field conflict_type key_id
---------- ---------- ------------- ----------
1 k1 lack_source 2
2 k2 value 2
3 k3 lack_target 2
```
# Shake series tool
---
We also provide some tools for synchronization in Shake series.<br>
* [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.
# License
- On `20230427` and later, we distribute this library under the new [Apache2.0](https://www.apache.org/licenses/LICENSE-2.0) protocol, `1.4.10` is the first version to support the Apache2.0 protocol.
- Prior to 20230427, it was distributed under the [GPLV3.0](https://www
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
redis-full-check 用于比较两个 redis 是否有相同的数据。我们还提供了数据同步工具redis-shake来将数据从一个 redis 同步到另一个 redis。感谢斗鱼数据服务团队的支持。中文下载 redis-full-check.tar.gz第一次使用,如何进行配置redis-full-checkRedis-full-check 由阿里云数据库部门 NoSQL 团队开发和维护。Redis-full-check 通过比较源数据库和目标数据库的数据来执行全量数据验证。整个检查过程包括多次比较,在每次比较中,redis-full-check 从两个数据库中获取数据,然后进行比较,不一致的数据将放入 sqlite3 db 中以供下一次比较。通过这种迭代比较方法,差异不断收敛。下图显示了数据流。在每次比较(黄色框)中,redis-full-check 首先获取所有键。之后,它运行比较并将差异结果(键和字段)存储到 sqlite3 db 中,这是下一轮可以获取键和字段的位置,而不是源数据库。Redis -full-check 从源数据库获取键,然后检查这些键
资源推荐
资源详情
资源评论
收起资源包目录
redis-full-check 用于比较两个 redis 是否有相同的数据。支持 redis 2.x 到 7.x 版本(不支持 Redis Modules)。.zip (35个子文件)
ChangeLog 3KB
标签.txt 61B
resources
dataflow.png 153KB
src
full_check
metric
metric.go 1KB
counter.go 1KB
stat.go 1KB
configure
conf.go 5KB
go.mod 646B
go.sum 3KB
client
address.go 2KB
db.go 2KB
client.go 12KB
common
trieTree_test.go 2KB
log.go 868B
mix.go 1KB
common.go 1KB
speed.go 523B
trieTree.go 907B
keytype.go 3KB
helper.go 887B
cluster.go 2KB
command.go 4KB
checker
value_outline_verifier.go 2KB
key_outline_verifier.go 2KB
full_value_verifier.go 21KB
base.go 3KB
full_check
scan.go 6KB
full_check.go 16KB
full_check_test.go 7KB
main.go 6KB
LICENSE 11KB
资源内容.txt 1KB
.gitignore 222B
README.md 8KB
build.sh 2KB
共 35 条
- 1
资源评论
赵闪闪168
- 粉丝: 1655
- 资源: 5391
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- gshhg-bin-2.3.7.zip
- 上市公司绿色创新持续性水平(OIP)测算数据集1991-2022.xlsx
- 施工人员检测15-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
- 海康威视Hikvision MVA V4.3.3.0 海康硬盘录像机播放工具
- 施工人员检测14-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
- 第01章 Linux系统概述
- JavaSwing+mysql图书管理系统完整源码+数据库(高分项目)
- 史上最简单最容易让web初学者理解的基础知识(仅针对个人)
- delphi IDE 插件DelphiIDEPlugin-SearchProject,用于从项目组中查找项目
- 施工人员检测12-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功