Bboysoul's Blog

首页 公告 RSS

Utilizing RedisShake for Redis Data Migration

January 2, 2024 本文有 243 个字 需要花费 2 分钟阅读

Introduction

RedisShake serves as a potent instrument, specifically engineered for the manipulation and migration of Redis data. If you’re on the hunt for a reliable methodology for the transference of your Redis data, RedisShake undoubtedly merits your consideration.

Project Repository

The source code and associated documentation for RedisShake can be found at the following address:

RedisShake Github

Installation

The installation of RedisShake is a straightforward procedure. The following commands allow for the download and decompression of RedisShake:

wget https://github.com/tair-opensource/RedisShake/releases/download/v4.0.2/redis-shake-linux-amd64.tar.gz
tar -zxvf redis-shake-linux-amd64.tar.gz

Synchronization Modes

RedisShake offers three distinct synchronization modes:

  • sync_reader: This mode necessitates server support for PSync.
  • rdb_reader: If you’re restoring from a backed-up RDB file, this mode should be your choice.
  • scan_reader: For one-time synchronization, this mode can be chosen as it doesn’t require server support for PSync.

Configuration File

Prior to initiating synchronization, a configuration file, such as shake.toml, must be created. Below is an illustration of a configuration file:

[scan_reader]
cluster = false            # Cluster mode status
address = "10.10.100.11:6379" # Source Redis server address
password = "pass"          # Source Redis server password
tls = false                # TLS status

[redis_writer]
cluster = false            # Cluster mode status
address = "10.10.100.12:6379" # Target Redis server address
password = "pass"          # Target Redis server password
tls = true                 # TLS status

Synchronization Initiation

Upon the successful creation of the configuration file, synchronization can be initiated with the following command:

./redis-shake shake.toml

Feel free to follow my blog at www.bboy.app

Have Fun


Tags:

本站总访问量 本站总访客数