Categorygithub.com/learnhard-cn/redis_tool
modulepackage
0.0.0-20240427084809-e9e55562b1c4
Repository: https://github.com/learnhard-cn/redis_tool.git
Documentation: pkg.go.dev

# README

redis_tool

一个简单的redis数据迁移工具

使用方法

功能说明:
        支持redis全类型数据迁移工具
使用方法:
        redis_tool -src source -dst destination -p pattern

参数说明:
        -src            : 原始库redis的地址
        -dst            : 目标库redis的地址
        -p|-pattern: redis的key的匹配规则
        -delete: 是否删除redis的数据,默认不删除,请谨慎使用!
        -maxCount: 单次SCAN提取的记录数,防止数据量过多导致redis连接超时

支持的URI格式

  • 非加密的连接格式: redis://[user:pass@]sshhost:port/db
  • SSH隧道连接格式: redissh://[user:pass@]sshhost:port/db

安装方法

源码安装方法:

go install github.com/learnhard-cn/redis_tool@latest

实现功能

  • 支持SSH隧道连接方式(通过sshhost查找$HOME/.ssh/config配置): URI格式 redissh://[user:pass@]sshhost:port/db
  • 支持在B主机执行 redis_tool 拷贝 A 主机redis数据到 C主机(包括SSH隧道连接方式)

# Functions

No description provided by the author
No description provided by the author
"redis://<user>:<pass>@localhost:6379/<db>" "redissh://<user>:<pass>@sshhost:6379/<db>".
支持Set类型数据导入.
No description provided by the author
No description provided by the author

# Structs

No description provided by the author