### Install redis-rdb-cli from Binary Release Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Instructions to download, extract, and verify the installation of redis-rdb-cli from its binary release. This involves using `wget` to download the zip, `unzip` to extract, and then navigating to the `bin` directory to run the `rct` command for help. ```shell $ wget https://github.com/leonchen83/redis-rdb-cli/releases/download/${version}/redis-rdb-cli-release.zip $ unzip redis-rdb-cli-release.zip $ cd ./redis-rdb-cli/bin $ ./rct -h ``` -------------------------------- ### Run redis-rdb-cli using Docker Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Demonstrates how to run redis-rdb-cli within a Docker container, providing examples for both the JVM-based and native image versions. This allows for quick setup without local dependencies. ```shell # run with jvm $ docker run -it --rm redisrdbcli/redis-rdb-cli:latest $ rct -V ``` ```shell # run without jvm $ docker run -it --rm redisrdbcli/redis-rdb-cli:latest-native $ rct -V ``` -------------------------------- ### Running redis-rdb-cli with a Custom SinkService Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This command-line example illustrates how to invoke the `redis-rdb-cli` tool (`ret`) and specify your custom `SinkService` by name, connecting to a Redis instance and using a configuration file. ```shell $ ret -s redis://127.0.0.1:6379 -c config.conf -n your-sink-service ``` -------------------------------- ### Executing redis-rdb-cli with a Custom FormatterService Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This command-line example demonstrates how to use the `redis-rdb-cli` tool (`rct`) to apply a custom `FormatterService` (named "test") to a Redis instance, outputting to a CSV file and specifying data types and encoding. ```shell $ rct -f test -s redis://127.0.0.1:6379 -o ./out.csv -t string -d 0 -e json ``` -------------------------------- ### Examples of Data Filtering with rct, rmt, and rst Commands Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Demonstrates various filtering capabilities across `rct`, `rdt`, `rmt`, and `rst` commands. `rct`, `rdt`, and `rmt` support filtering by type, database, and key RegEx (Java style), while `rst` only supports filtering by database. ```shell $ rct -f dump -s /path/to/dump.rdb -o /path/to/dump.aof -d 0 $ rct -f dump -s /path/to/dump.rdb -o /path/to/dump.aof -t string hash $ rmt -s /path/to/dump.rdb -m redis://192.168.1.105:6379 -r -d 0 1 -t list $ rst -s redis://127.0.0.1:6379 -m redis://127.0.0.1:6380 -d 0 ``` -------------------------------- ### Enable and Manage Grafana Dashboard for Memory Analysis Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Instructions to enable and manage the Grafana dashboard for `rct -f mem` memory analysis. Requires Docker and Docker Compose. This snippet provides commands to start and stop the dashboard services. ```shell $ cd /path/to/redis-rdb-cli/dashboard # start $ docker-compose up -d # stop $ docker-compose down ``` -------------------------------- ### Monitor Redis Server with rmonitor and Grafana Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Steps to set up and use `rmonitor` for Redis server monitoring, integrating with InfluxDB and Grafana. This involves modifying the configuration file, starting Docker containers for the dashboard, and running `rmonitor` for standalone, cluster, or sentinel Redis instances. ```shell # step1 # open file `/path/to/redis-rdb-cli/conf/redis-rdb-cli.conf` # change property `metric_gateway from `none` to `influxdb` # # step2 $ cd /path/to/redis-rdb-cli/dashboard $ docker-compose up -d # # step3 $ rmonitor -s redis://127.0.0.1:6379 -n standalone $ rmonitor -s redis://127.0.0.1:30001 -n cluster $ rmonitor -s redis-sentinel://sntnl-usr:sntnl-pwd@127.0.0.1:26379?master=mymaster&authUser=usr&authPassword=pwd -n sentinel # # step4 # open url `http://localhost:3000/d/monitor/monitor`, login grafana use `admin`, `admin` and check monitor result. ``` -------------------------------- ### Migrate RDB File to Remote Redis Instance Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Shows how to migrate data from a local RDB file directly to a remote Redis server using the `rmt` command. This is a convenient way to restore or transfer data to a new Redis setup. ```shell $ rmt -s /path/to/dump.rdb -m redis://192.168.1.105:6379 -r ``` -------------------------------- ### Merge Multiple RDB Files into One Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Merges several RDB files into a single RDB file. This example merges `dump1.rdb` and `dump2.rdb` into `dump.rdb`, specifically filtering for hash type keys during the merge. ```shell $ rdt -m ./dump1.rdb ./dump2.rdb -o ./dump.rdb -t hash ``` -------------------------------- ### Filter RDB File by DB and Type Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Filters an existing RDB file based on database ID and data type. This example filters database 0 for string type keys, saving the result to a new RDB file. ```shell $ rdt -b /path/to/dump.rdb -o /path/to/filtered-dump.rdb -d 0 -t string ``` -------------------------------- ### Compile and Run redis-rdb-cli from Source Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Steps to clone the redis-rdb-cli repository, compile it using Maven, and then run the compiled tool to display help information. This process builds the application from its source code. ```shell $ git clone https://github.com/leonchen83/redis-rdb-cli.git $ cd redis-rdb-cli $ mvn clean install -Dmaven.test.skip=true $ cd target/redis-rdb-cli-release/redis-rdb-cli/bin $ ./rct -h ``` -------------------------------- ### Packaging and Deploying a Custom FormatterService JAR Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md These shell commands detail the process of building your custom `FormatterService` project with Maven and then copying the generated JAR file to the `redis-rdb-cli` library directory, making it accessible for the tool. ```shell $ mvn clean install $ cp ./target/your-service-1.0.0-jar-with-dependencies.jar /path/to/redis-rdb-cli/lib ``` -------------------------------- ### Packaging and Deploying a Custom SinkService JAR Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md These shell commands demonstrate how to build your custom `SinkService` project using Maven and then deploy the resulting JAR file to the `redis-rdb-cli` library directory, making it available for execution. ```shell $ mvn clean install $ cp ./target/your-sink-service-1.0.0-jar-with-dependencies.jar /path/to/redis-rdb-cli/lib ``` -------------------------------- ### Configure and Use Redis 6 SSL Connections Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Steps to generate necessary keystore files using OpenSSL for Redis 6 SSL, configure the `redis-rdb-cli.conf` with keystore paths and passwords, and then use `rediss://` URI scheme in commands to enable SSL connections for migration. ```shell $ cd /path/to/redis-6.0-rc1 $ ./utils/gen-test-certs.sh $ cd tests/tls $ openssl pkcs12 -export -CAfile ca.crt -in redis.crt -inkey redis.key -out redis.p12 ``` ```shell rst -s rediss://127.0.0.1:6379 -m rediss://127.0.0.1:30001 -r -d 0 ``` -------------------------------- ### Configure Windows Environment Variables for redis-rdb-cli Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Guidance on adding the redis-rdb-cli binary directory to the Windows `Path` environment variable, enabling direct execution of `rct` from any command prompt. ```text Add /path/to/redis-rdb-cli/bin to Path environment variable ``` -------------------------------- ### Build Native Image of redis-rdb-cli with GraalVM in Docker Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Instructions to build a native executable of redis-rdb-cli using GraalVM within a Docker environment. This process creates a standalone binary for improved performance and reduced footprint. ```shell $ docker build -m 8g -f DockerfileNative -t redisrdbcli:redis-rdb-cli . $ docker run -it redisrdbcli:redis-rdb-cli bash $ bash-5.1# rct -V ``` -------------------------------- ### Runtime Requirements for redis-rdb-cli Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Specifies the minimum Java Development Kit (JDK) version required to run the redis-rdb-cli tool. ```text jdk 1.8+ ``` -------------------------------- ### Redis RDB CLI Configuration Parameters Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Details configurable parameters within the `redis-rdb-cli.conf` file, which allow customization of tool behavior, including metric gateway settings and SSL keystore configurations. ```APIDOC metric_gateway: Configures the destination for metrics. Change from `none` to `influxdb` to enable monitoring via InfluxDB. metric_instance: A unique identifier for the instance when deploying the tool in a multi-instance environment. source_keystore_path: Path to the PKCS12 keystore file for the source Redis SSL connection. source_keystore_pass: Password for the source Redis keystore. target_keystore_path: Path to the PKCS12 keystore file for the target Redis SSL connection. target_keystore_pass: Password for the target Redis keystore. ``` -------------------------------- ### Synchronize Single Redis to Redis Cluster Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Explains how to migrate data from a standalone Redis instance to a Redis Cluster using `rst`. The `-d 0` option specifies the database index to sync. ```shell $ rst -s redis://127.0.0.1:6379 -m redis://127.0.0.1:30001 -r -d 0 ``` -------------------------------- ### Compile Requirements for redis-rdb-cli Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Lists the necessary software versions for compiling redis-rdb-cli from source, including JDK and Maven. ```text jdk 1.8+ maven-3.3.1+ ``` -------------------------------- ### Implementing a Custom FormatterService in Java Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This Java code defines `YourFormatterService`, extending `AbstractFormatterService`. It demonstrates overriding the `format` method for a custom format name and the `applyString` method to process Redis string events, encoding keys and values to an output stream. ```java public class YourFormatterService extends AbstractFormatterService { @Override public String format() { return "test"; } @Override public Event applyString(Replicator replicator, RedisInputStream in, int version, byte[] key, int type, ContextKeyValuePair context) throws IOException { byte[] val = new DefaultRdbValueVisitor(replicator).applyString(in, version); getEscaper().encode(key, getOutputStream()); getEscaper().encode(val, getOutputStream()); getOutputStream().write('\n'); return context; } } ``` -------------------------------- ### Registering Custom FormatterService using Java SPI Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This snippet outlines the file structure and content required to register a custom `FormatterService` using Java's Service Provider Interface (SPI). This mechanism allows the `redis-rdb-cli` tool to discover and load your custom formatter at runtime. ```text # create com.moilioncircle.redis.rdb.cli.api.format.FormatterService file in src/main/resources/META-INF/services/ |-src |____main | |____resources | | |____META-INF | | | |____services | | | | |____com.moilioncircle.redis.rdb.cli.api.format.FormatterService # add following content in com.moilioncircle.redis.rdb.cli.api.format.FormatterService your.package.YourFormatterService ``` -------------------------------- ### Java Implementation of Redis SinkService Interface Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This Java code provides a basic implementation of the `SinkService` interface, which is crucial for defining custom data handling logic. It includes methods for identifying the service, initializing it with an external configuration, and processing Redis events received from the replicator. ```Java public class YourSinkService implements SinkService { @Override public String sink() { return "your-sink-service"; } @Override public void init(File config) throws IOException { // parse your external sink config } @Override public void onEvent(Replicator replicator, Event event) { // your sink business } } ``` -------------------------------- ### Maven Project Configuration for Redis Sink Service Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This `pom.xml` file sets up a Maven project for developing a custom Redis sink service. It declares essential dependencies like `redis-rdb-cli-api` and `redis-replicator` with `provided` scope, and configures the `maven-assembly-plugin` to package the service as a single JAR with dependencies. ```XML 4.0.0 com.your.company your-sink-service 1.0.0 UTF-8 1.8 1.8 com.moilioncircle redis-rdb-cli-api 1.8.0 provided com.moilioncircle redis-replicator [3.6.4, ) provided org.slf4j slf4j-api 1.7.25 provided maven-assembly-plugin 3.1.0 jar-with-dependencies make-assembly package single org.apache.maven.plugins maven-compiler-plugin 3.8.1 ${maven.compiler.source} ${maven.compiler.target} ${project.build.sourceEncoding} ``` -------------------------------- ### Registering a Custom SinkService for redis-rdb-cli Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This snippet shows the configuration entry required to register a custom `SinkService` implementation within the `redis-rdb-cli` framework, enabling the tool to discover and use your service. ```text your.package.YourSinkService ``` -------------------------------- ### Redis RDB CLI Data Migration Principle Diagram Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This diagram illustrates the core principle of Redis data migration using `redis-rdb-cli`. It shows the process of dumping RDB data, converting it into a Redis dump format, and then restoring it to the target Redis instance in multiple streams. ```text +---------------+ +-------------------+ restore +---------------+ | | | redis dump format |---------------->| | | | |-------------------| restore | | | | convert | redis dump format |---------------->| | | Dump rdb |------------>|-------------------| restore | Targe Redis | | | | redis dump format |---------------->| | | | |-------------------| restore | | | | | redis dump format |---------------->| | +---------------+ +-------------------+ +---------------+ ``` -------------------------------- ### Debugging Custom SinkService in Java Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This Java `main` method provides a programmatic approach to debug a custom `SinkService`. It sets up a `RedisReplicator`, registers the `SinkService` with an `AsyncEventListener`, and opens the replication stream, allowing for direct testing and debugging. ```java public static void main(String[] args) throws Exception { Replicator replicator = new RedisReplicator("redis://127.0.0.1:6379"); Runtime.getRuntime().addShutdownHook(new Thread(() -> { Replicators.closeQuietly(replicator); })); replicator.addExceptionListener((rep, tx, e) -> { throw new RuntimeException(tx.getMessage(), tx); }); SinkService sink = new YourSinkService(); sink.init(new File("/path/to/your-sink.conf")); replicator.addEventListener(new AsyncEventListener(sink, replicator, 4, Executors.defaultThreadFactory())); replicator.open(); } ``` -------------------------------- ### Perform Redis Mass Insertion from RDB Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Demonstrates how to convert an RDB file to AOF format and then use `redis-cli --pipe` for efficient mass insertion into a Redis instance. This is useful for populating a Redis server with data from an RDB backup. ```shell $ rct -f dump -s /path/to/dump.rdb -o /path/to/dump.aof -r $ cat /path/to/dump.aof | /redis/src/redis-cli -p 6379 --pipe ``` -------------------------------- ### Use Redis 6 ACL with redis-rdb-cli Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Demonstrates how to connect to Redis 6 instances using Access Control Lists (ACL) by providing username and password in the URI. The specified user must have `+@all` permission to handle commands. ```shell $ rst -s redis://user:pass@127.0.0.1:6379 -m redis://user:pass@127.0.0.1:6380 -r -d 0 ``` -------------------------------- ### Backup Remote Redis RDB File Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Shows how to create a backup of a remote Redis instance's RDB file to a local path using the `rdt` command. This is essential for disaster recovery and data archiving. ```shell $ rdt -b redis://192.168.1.105:6379 -o /path/to/dump.rdb ``` -------------------------------- ### Redis RDB CLI Single Redis to Single Redis Migration Threading Diagram Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This diagram illustrates the multi-threaded migration model from a single source Redis instance to a single target Redis instance. Multiple 'Endpoint' connections are used, each handled by a dedicated thread, to transfer data concurrently. ```text single redis ----> single redis +--------------+ +----------+ thread 1 +--------------+ | | +----| Endpoint |-------------------| | | | | +----------+ | | | | | | | | | | +----------+ thread 2 | | | | |----| Endpoint |-------------------| | | | | +----------+ | | | Source Redis |----| | Target Redis | | | | +----------+ thread 3 | | | | |----| Endpoint |-------------------| | | | | +----------+ | | | | | | | | | | +----------+ thread 4 | | | | +----| Endpoint |-------------------| | +--------------+ +----------+ +--------------+ ``` -------------------------------- ### Java SPI Registration for Custom Redis Sink Service Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This snippet illustrates the required file structure for registering a custom `SinkService` using Java's Service Provider Interface (SPI). A file named `com.moilioncircle.redis.rdb.cli.api.sink.SinkService` must be created within the `src/main/resources/META-INF/services/` directory, containing the fully qualified class name of the custom sink service implementation. ```text # create com.moilioncircle.redis.rdb.cli.api.sink.SinkService file in src/main/resources/META-INF/services/ |-src |____main | |____resources | | |____META-INF | | | |____services | | | | |____com.moilioncircle.redis.rdb.cli.api.sink.SinkService ``` -------------------------------- ### Behavioral Differences Between rmt and rst Commands Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Explains the fundamental differences in operation between the `rmt` (Redis Migrate Tool) and `rst` (Redis Sync Tool) commands. `rmt` performs a snapshot migration and terminates, while `rst` migrates both snapshot and incremental data, remaining active until manually stopped. ```APIDOC rmt: - When started, the source Redis performs a `BGSAVE` to generate a snapshot RDB file. - `rmt` migrates this snapshot file to the target Redis. - `rmt` terminates after the migration process is complete. rst: - Migrates not only the snapshot RDB file but also incremental data from the source Redis. - `rst` never terminates unless explicitly stopped (e.g., by `CTRL+C`). - `rst` only supports filtering by `db`. ``` -------------------------------- ### Migrate RDB File to Remote Redis Cluster Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Illustrates how to migrate data from a local RDB file to a Redis Cluster, providing two methods: using a cluster configuration file or directly specifying a cluster node. This facilitates populating Redis Clusters. ```shell $ rmt -s /path/to/dump.rdb -c ./nodes-30001.conf -r ``` ```shell $ rmt -s /path/to/dump.rdb -m redis://127.0.0.1:30001 -r ``` -------------------------------- ### Optimize Redis Migration for Big Keys Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Provides steps to handle large keys during Redis migration by increasing the `proto-max-bulk-len` on the target Redis and allocating more JVM memory to the `redis-rdb-cli` tool. This prevents issues with large data transfers. ```shell # set proto-max-bulk-len in target redis $ redis-cli -h ${host} -p 6380 -a ${pwd} config set proto-max-bulk-len 2048mb # set Xms Xmx in redis-rdb-cli node $ export JAVA_TOOL_OPTIONS="-Xms8g -Xmx8g" # execute migration $ rmt -s redis://127.0.0.1:6379 -m redis://127.0.0.1:6380 -r ``` -------------------------------- ### Count Keys in RDB and Output to CSV Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Explains how to count the total number of keys within a Redis RDB file and output the results to a CSV file using `rct`. This provides a quick overview of the dataset size. ```shell $ rct -f count -s /path/to/dump.rdb -o /path/to/dump.csv ``` -------------------------------- ### Compare Two Redis RDB Files Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Shows how to generate diffable representations of two RDB files and then use the standard `diff` command to compare their contents. This is useful for tracking changes between different Redis snapshots. ```shell $ rct -f diff -s /path/to/dump1.rdb -o /path/to/dump1.diff $ rct -f diff -s /path/to/dump2.rdb -o /path/to/dump2.diff $ diff /path/to/dump1.diff /path/to/dump2.diff ``` -------------------------------- ### Synchronize Data Between Two Redis Instances Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Demonstrates how to synchronize data from a source Redis instance to a target Redis instance using the `rst` command. This is useful for replication or migration between standalone Redis servers. ```shell $ rst -s redis://127.0.0.1:6379 -m redis://127.0.0.1:6380 -r ``` -------------------------------- ### Redis RDB CLI Single Redis to Redis Cluster Migration Threading Diagram Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This diagram depicts the multi-threaded migration model from a single source Redis instance to a Redis cluster. Each thread connects to 'Endpoints' which represent multiple master instances within the cluster, enabling parallel data transfer to the distributed target. ```text single redis ----> redis cluster +--------------+ +----------+ thread 1 +--------------+ | | +----| Endpoints|-------------------| | | | | +----------+ | | | | | | | | | | +----------+ thread 2 | | | | |----| Endpoints|-------------------| | | | | +----------+ | | | Source Redis |----| | Redis cluster| | | | +----------+ thread 3 | | | | |----| Endpoints|-------------------| | | | | +----------+ | | | | | | | | | | +----------+ thread 4 | | | | +----| Endpoints|-------------------| | +--------------+ +----------+ +--------------+ ``` -------------------------------- ### Convert RDB to RESP Protocol Format Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Illustrates converting a Redis RDB file into the Redis Serialization Protocol (RESP) format, typically outputting to an AOF file. This allows for programmatic interaction with the RDB data using RESP. ```shell $ rct -f resp -s /path/to/dump.rdb -o /path/to/appendonly.aof ``` -------------------------------- ### Backup Remote RDB and Convert DB Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md This command backs up a remote Redis RDB file from a specified host and port, saves it to a local file, and converts the database to a new destination database ID. The `--goal` parameter specifies the target database ID. ```shell $ rdt -b redis://192.168.1.105:6379 -o /path/to/dump.rdb --goal 3 ``` -------------------------------- ### Perform Downgrade Migration Between Redis Versions Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Explains how to migrate data from a newer Redis version (e.g., Redis 7) to an older one (e.g., Redis 6) by adjusting the RDB version in the configuration file before executing the migration. This is crucial for compatibility. ```shell # Migrate data from redis-7 to redis-6 # About dump_rdb_version please see comment in redis-rdb-cli.conf $ sed -i 's/dump_rdb_version=-1/dump_rdb_version=9/g' /path/to/redis-rdb-cli/conf/redis-rdb-cli.conf $ rmt -s redis://com.redis7:6379 -m redis://com.redis6:6379 -r ``` -------------------------------- ### Rmt Command Threading Configuration Parameters Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md These `properties` parameters configure the `rmt` command's data migration behavior, including batch size, number of threads, flush behavior, and retry attempts. `migrate_threads` is crucial for defining the concurrency. ```properties migrate_batch_size=4096 migrate_threads=4 migrate_flush=yes migrate_retries=1 ``` -------------------------------- ### Find Top Largest Keys by Memory Usage in RDB Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Demonstrates how to analyze an RDB file to identify the top N largest keys by memory consumption, outputting the results to a `.mem` file. This helps in optimizing Redis memory usage by identifying 'big keys'. ```shell $ rct -f mem -s /path/to/dump.rdb -o /path/to/dump.mem -l 50 ``` -------------------------------- ### Convert RDB to JSON Format Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Illustrates converting a Redis RDB file into a human-readable JSON format using `rct`. This is useful for analyzing RDB contents outside of Redis or for integration with other systems. ```shell $ rct -f json -s /path/to/dump.rdb -o /path/to/dump.json ``` -------------------------------- ### Convert RDB to AOF Dump Format Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Shows how to convert a Redis RDB snapshot file into the AOF (Append Only File) dump format using `rct`. The output AOF file can then be used for Redis data restoration or inspection. ```shell $ rct -f dump -s /path/to/dump.rdb -o /path/to/dump.aof ``` -------------------------------- ### Cut AOF-use-RDB-Preamble File to RDB and AOF Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Separates an AOF file that uses an RDB preamble into its constituent RDB and AOF parts. The RDB portion is saved to one file, and the AOF commands are saved to another. ```shell $ rcut -s ./aof-use-rdb-preamble.aof -r ./dump.rdb -a ./appendonly.aof ``` -------------------------------- ### Resolve Infinite Loop During Redis Synchronization Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Provides a solution for preventing infinite loops during Redis synchronization (`rst` command) by configuring the `client-output-buffer-limit` on the source Redis server. This ensures stable data transfer. ```shell # set client-output-buffer-limit in source redis $ redis-cli config set client-output-buffer-limit "slave 0 0 0" $ rst -s redis://127.0.0.1:6379 -m redis://127.0.0.1:6380 -r ``` -------------------------------- ### Split RDB File by Redis Cluster Nodes Configuration Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md Splits a single RDB file into multiple RDB files, one for each node in a Redis cluster, using a provided `nodes.conf` file. The output files are saved to a specified folder, filtering for database 0. ```shell $ rdt -s ./dump.rdb -c ./nodes.conf -o /path/to/folder -d 0 ``` -------------------------------- ### Redis RDB CLI Migration Performance Parameters Source: https://github.com/leonchen83/redis-rdb-cli/blob/master/README.md These `properties` parameters directly influence the performance of data migration. `migrate_batch_size` controls Redis pipeline usage, `migrate_retries` manages socket error handling, and `migrate_flush` dictates when data is flushed to the socket, impacting latency and retry behavior. ```properties migrate_batch_size=4096 migrate_retries=1 migrate_flush=yes ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.