All Projects → TraceNature → Rediscompare

TraceNature / Rediscompare

Licence: mit
rediscompare is a tool for chech two redis db data consistency. 是用来对比、校验redis 多个数据库数据一致性的命令行工具,支持单实例到单实例、单实例到原生集群、多实例多库到单实例等场景。

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Rediscompare

Universityrecruitment Ssurvey
用严肃的数据来回答“什么样的企业会到什么样的大学招聘”?
Stars: ✭ 30 (-84.54%)
Mutual labels:  redis, data
Dailyreport
日报管理系统V1版本,适合小团队的每日汇报记录
Stars: ✭ 191 (-1.55%)
Mutual labels:  redis
Springboot Learning
《Spring Boot基础教程》,2.x版本持续连载中!点击下方链接直达教程目录!
Stars: ✭ 13,916 (+7073.2%)
Mutual labels:  redis
Vue Smooth Picker
🏄🏼 A SmoothPicker for Vue 2 (like native datetime picker of iOS)
Stars: ✭ 188 (-3.09%)
Mutual labels:  data
Nestedtext
Human Readable and Writable Data Interchange Format
Stars: ✭ 187 (-3.61%)
Mutual labels:  data
Nest
Generate nested namespaced keys for key-value databases.
Stars: ✭ 188 (-3.09%)
Mutual labels:  redis
Grbac
权限管理服务平台, 利用shiro权限管理设计思想, 支持单用户多角色,比RBAC的资源管理更细粒度化
Stars: ✭ 186 (-4.12%)
Mutual labels:  redis
Free Ai Resources
🚀 FREE AI Resources - 🎓 Courses, 👷 Jobs, 📝 Blogs, 🔬 AI Research, and many more - for everyone!
Stars: ✭ 192 (-1.03%)
Mutual labels:  data
Redis4cats
🔖 Redis client built on top of Cats Effect, Fs2 and Lettuce
Stars: ✭ 189 (-2.58%)
Mutual labels:  redis
Blog Service
blog service @nestjs
Stars: ✭ 188 (-3.09%)
Mutual labels:  redis
California Coronavirus Data
The Los Angeles Times' independent tally of coronavirus cases in California.
Stars: ✭ 188 (-3.09%)
Mutual labels:  data
Volbx
Graphical tool for data manipulation written in C++/Qt
Stars: ✭ 187 (-3.61%)
Mutual labels:  data
Back End Interview
后端面试题汇总(Python、Redis、MySQL、PostgreSQL、Kafka、数据结构、算法、编程、网络)
Stars: ✭ 188 (-3.09%)
Mutual labels:  redis
Mirador
Tool for visual exploration of complex data.
Stars: ✭ 186 (-4.12%)
Mutual labels:  data
Zi5book
book.zi5.me全站kindle电子书籍爬取,按照作者书籍名分类,每本书有mobi和equb两种格式,采用分布式进行全站爬取
Stars: ✭ 191 (-1.55%)
Mutual labels:  redis
Lua Resty Redis Connector
Connection utilities for lua-resty-redis
Stars: ✭ 186 (-4.12%)
Mutual labels:  redis
Webmap
A Python tool used to automate the execution of the following tools : Nmap , Nikto and Dirsearch but also to automate the report generation during a Web Penetration Testing
Stars: ✭ 188 (-3.09%)
Mutual labels:  report
Opendata
CRAN OpenData Task View
Stars: ✭ 188 (-3.09%)
Mutual labels:  data
Zend Diagnostics
Universal set of diagnostic tests for PHP applications.
Stars: ✭ 192 (-1.03%)
Mutual labels:  redis
Redis Roaring
Roaring Bitmaps for Redis
Stars: ✭ 191 (-1.55%)
Mutual labels:  redis

rediscompare

简体中文

rediscompare is a command line tool used to compare redis database data consistency

showuse

Verification mechanism

rediscompare scans the data in the source database and compares it with the target database through the scan command, and checks it from dimensions such as value length, value, and ttl. Finally, a result file is generated, which contains the key of the data inconsistency and the reason for the inconsistency.

In actual scenarios, some keys may be inconsistent in the first comparison due to transmission delay issues. Rediscompare supports multiple comparisons in a cycle, which is based on the inconsistent keys in the last comparison and generates a result file. The number of cycles can be passed "--comparetimes" "Parameter specification

Scenario

rediscompare provides a comparison plan for the following scenarios according to the different types of targets and sources

  • compare parameters To compare diff of parameters between two redis insance

  • single2single Comparison of redis single instance to single instance. Used to compare the data consistency of a single instance single database

  • single2cluster Used to compare the data consistency between a db in a single instance and the redis native cluster

  • cluster2cluster Used to compare the data consistency between redis native cluster and native cluster

  • multisingle2single Used to compare the data consistency between a collection of multiple databases in multiple single instances and a database in a single instance

  • multisingle2cluster Used to compare the data consistency between multiple databases collections in multiple single instances and a single instance database

quick start

build execute file

git clone https://github.com/TraceNature/rediscompare.git
cd rediscompare
go mod tidy
go mod vendor
go build -o rediscompare

Usage example

rediscompare supports command line mode and interactive mode, interactive mode supports command prompt. The comparison command supports direct command input and yaml customization. Let's introduce the basic usage of each scene according to the scene.

Use the -i parameter to enter the interactive mode "rediscompare -i"

compare subcommand

  • parameters

      rediscompare compare parameters --saddr 10.0.0.1:6379 --spassword "redistest0102" --taddr 10.0.0.2:6379 --tpassword "testredis0102"
    
  • single2single

    • 命令模式 Command mode

       rediscompare compare single2single  --saddr "10.0.0.1:6379"    --spassword  "redistest0102"  --taddr "10.0.0.2:6379"   --tpassword  "redistest0102" --comparetimes 3
      
  • single2cluster

    • Command mode

      rediscompare compare single2cluster  --saddr  "10.0.0.1:6379"    --spassword  "redistest0102"  --taddr "10.0.1.1:16379,10.0.1.1:16380,10.0.1.2:16379,10.0.1.2:16380,10.0.1.3:16379,10.0.1.3:16380"   --tpassword  "testredis0102" --comparetimes 3
      
  • cluster2cluster

    • Command mode

      rediscompare  compare cluster2cluster  --saddr  "10.0.0.1:36379,10.0.0.2:36379,10.0.0.3:36379"    --spassword  "testredis0102"  --taddr "10.0.1.1:16379,10.0.1.1:16380,10.0.1.2:16379,10.0.1.2:16380,10.0.1.3:16379,10.0.1.3:16380"   --tpassword  "testredis0102" --comparetimes 3
      
  • multisingle2single

    • Execute yaml file

      # multisingle2single yaml file
      saddr:
       - addr: "10.0.0.1:6379"
         password: "redistest0102"
         dbs:
           - 0
           - 2
           - 3
       - addr: "10.0.0.2:6379"
         password: "redistest0102"
         dbs:
           - 1
           - 5
           - 9
      taddr: "10.0.0.3:6379"
      tpassword: "redistest0102"
      batchsize: 30
      threads: 2
      ttldiff: 10000
      comparetimes: 3
      report:  true
      scenario: "multisingle2single"
      
      rediscompare compare exec  path/miltisingle2single.yml
      
  • multisingle2cluster

    • Execute yaml file

      # multisingle2cluster yaml file
      saddr:
        - addr: "10.0.0.1:6379"
          password: "redistest0102"
          dbs:
            - 0
            - 2
            - 3
        - addr: "10.0.0.2:6379"
          password: "redistest0102"
          dbs:
            - 1
            - 5
            - 9
      taddr: "10.0.1.1:16379,10.0.1.1:16380,10.0.1.2:16379,10.0.1.2:16380,10.0.1.3:16379,10.0.1.3:16380"
      tpassword: "testredis0102"
      batchsize: 30
      threads: 2
      ttldiff: 10000
      comparetimes: 3
      report:  true
      scenario: "multisingle2cluster"
      
      rediscompare compare exec  path/miltisingle2cluster.yml
      

The two scenarios of multisingle2single and multisingle2cluster are difficult to express due to the complex mapping relationship of the databases. Currently, only yaml file execution is supported; single2single, single2cluster, cluster2cluster support command line and yaml file mode.

yaml example

For yaml example files, please refer to the .yml file in the execyamlexample directory

result subcommand

The result subcommand is used to format a .result or .rep file. The file is the comparison result, json plaintext. The result command converts the file into a two-dimensional table to increase readability

rediscompare result parse compare_xxxxxxxx.rep
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].