redis-shake4迁移数据(蛮好用)

news/2024/10/6 20:28:42

redis-shake下载地址:https://github.com/tair-opensource/RedisShake/releases

测试环境redis需要从公有云迁移到私有云,就用redis-share测试一下。

下载后解压(就两个文件,执行文件和配置文件):

 

[root@gcv-x-test-sharedb-oracle redis]# cat shake.toml
##我只需要复制db0得数据,然后目标库存到db42
function = """
shake.log(DB)
if DB == 1
thenreturn
endlocal db1 = 0
local db2 = 42if DB == db1 thenDB = db2
elseif DB == db2 thenDB = db1
end
shake.call(DB, ARGV)"""

##需要PSync 协议,但是一般云厂商都是禁用了SYNC和PSYNC命令
#[sync_reader]
#cluster = false            # set to true if source is a redis cluster
#address = "10.27.137.74:6379" # when cluster is true, set address to one of the cluster node
#username = ""              # keep empty if not using ACL
#password = "xxxxxx"              # keep empty if no authentication is required
#tls = false
#sync_rdb = true # set to false if you don't want to sync rdb
#sync_aof = true # set to false if you don't want to sync aof

##我只能用这个模式scan
[scan_reader]
cluster = false            # set to true if source is a redis cluster
address = "10.27.137.74:6379" # when cluster is true, set address to one of the cluster node
username = ""              # keep empty if not using ACL
password = "xxxxx"              # keep empty if no authentication is required
ksn = false                # set to true to enabled Redis keyspace notifications (KSN) subscription
tls = false# [rdb_reader]
# filepath = "/tmp/dump.rdb"[redis_writer]
cluster = false            # set to true if target is a redis cluster
address = "10.251.93.8:6379" # when cluster is true, set address to one of the cluster node
username = ""              # keep empty if not using ACL
password = "5xxx"              # keep empty if no authentication is required
tls = false[advanced]
dir = "data"
ncpu = 2        # runtime.GOMAXPROCS, 0 means use runtime.NumCPU() cpu cores
pprof_port = 0  # pprof port, 0 means disable
status_port = 0 # status port, 0 means disable# log
log_file = "shake.log"
log_level = "info"     # debug, info or warn
log_interval = 5       # in seconds# redis-shake gets key and value from rdb file, and uses RESTORE command to
# create the key in target redis. Redis RESTORE will return a "Target key name
# is busy" error when key already exists. You can use this configuration item
# to change the default behavior of restore:
# panic:   redis-shake will stop when meet "Target key name is busy" error.
# rewrite: redis-shake will replace the key with new value.
# ignore:  redis-shake will skip restore the key when meet "Target key name is busy" error.
rdb_restore_command_behavior = "panic" # panic, rewrite or skip# redis-shake uses pipeline to improve sending performance.
# This item limits the maximum number of commands in a pipeline.
pipeline_count_limit = 1024# Client query buffers accumulate new commands. They are limited to a fixed
# amount by default. This amount is normally 1gb.
target_redis_client_max_querybuf_len = 1024_000_000# In the Redis protocol, bulk requests, that are, elements representing single
# strings, are normally limited to 512 mb.
target_redis_proto_max_bulk_len = 512_000_000# If the source is Elasticache or MemoryDB, you can set this item.
aws_psync = "" # example: aws_psync = "10.0.0.1:6379@nmfu2sl5osync,10.0.0.1:6379@xhma21xfkssync"[module]
# The data format for BF.LOADCHUNK is not compatible in different versions. v2.6.3 <=> 20603
target_mbbloom_version = 20603

 

 

然后执行即可:

 日志:

 

工具蛮好用的,简单易懂实用。

参数和原理可看官网说明,写的蛮清楚得。https://tair-opensource.github.io/RedisShake/zh/guide/introduction.html

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/54579.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

Clickhouse备份与恢复

一、安装clickhouse-backup 1、下载安装包 cd /server/tools/wget https://github.com/Altinity/clickhouse-backup/releases/download/v2.4.33/clickhouse-backup-linux-amd64.tar.gz2、创建存放clickhouse-backup的目录,并解压 mkdir -pv /data/clickhouse-backup tar xvf c…

记一个小杂症

【问题描述】ZPA047_EDH 黑名单中间表查询报表,点击运行就回到初始界面 打断点又能进来, 【原因】 事务码类型 应该为报表事物 本人常年接收SAP运维和远程项目,ECC,S/4HANA,CRM,WDA. 远程人天可谈,终身售后,有活请联系V信:18925782767(问问题免费,欢迎交流!) !!…

.NET 开源报表神器 Seal-Report

前言 Seal-Report 是一款.NET 开源报表工具,拥有 1.4K Star。它提供了一个完整的框架,使用 C# 编写,最新的版本采用的是 .NET 8.0 。 它能够高效地从各种数据库或 NoSQL 数据源生成日常报表,并支持执行复杂的报表任务。 其简单易用的安装过程和直观的设计界面,我们能够在几…

从买车、提车,到用车(一整套流程记录,18页PPT)

背景最近有些公司的同事准备买车,捞出了以前写的PPT分享给了他,也考虑在博客放一下2年前写的PPT,希望对车子没有概念的网友们童鞋有个简单的但是必要的流程了解。 以下是18页PPT内容,如果转载请注明出处:https://www.cnblogs.com/xiefengdaxia123

MDST150-16-ASEMI机床专用整流模块MDST150-16

MDST150-16-ASEMI机床专用整流模块MDST150-16编辑:ll MDST150-16-ASEMI机床专用整流模块MDST150-16 型号:MDST150-16 品牌:ASEMI 封装:MDST 批号:2024+ 分类:整流模块 特性:整流模块、整流桥 平均正向整流电流(Id):150A 最大反向击穿电压(VRM):1600V 恢复时间:>…

最强图片预览工具 JPEGView 关闭自动全屏模式

窗口右键 → 设定/管理 → 编缉用户设置:最强图片预览工具JPEGView 关闭自动全屏模式 搜索ShowFullScreen 并设置为false: ; ----------------------------------------------- ; - WINDOW BEHAVIOR OPTIONS ; -----------------------------------------------; Start in fu…

线性规划单纯形法精解

单纯形法(Simplex Method)是解决线性规划问题的一种高效且广泛使用的算法。由乔治丹齐克(George Dantzig)在20世纪40年代提出,这一方法通过系统地检查可行解空间的极点,从而找到最优解。由于其计算效率高,单纯形法迅速成为线性规划问题中最重要和最常用的算法之一。它的…

LOTO示波器统计曲线和故障分析pass/fail测试

LOTO示波器统计曲线和故障分析pass/fail测试 虚拟示波器可以应用在工业自动化检测中,除了常规的检测波形和测量值参数以外,由多个行业客户定制和验证的统计曲线和故障分析(pass/fail)功能也为工业自动化检测带来极大的便利。(一)故障分析(pass/fail)的基础:统计曲线功…