Rump - Hot sync two Redis servers using dumps.

Rump

Go Report Card GoDoc CI

Hot sync two Redis databases using dumps.

Why

There's no easy way to sync data from an AWS ElastiCache or GCP MemoryStore Redis cluster; the standard commands BGSAVE and SLAVEOF are blocked.

Rump is able to live sync Redis databases across cloud providers by only using SCAN, DUMP and RESTORE.

It's used at Sticker Mule to keep staging and development environments in sync with the production AWS/GCP Redis clusters.

Examples

# Sync local Redis DB 1 to DB 2.
$ rump -from redis://127.0.0.1:6379/1 -to redis://127.0.0.1:6379/2

# Sync ElastiCache cluster to local.
$ rump -from redis://production.cache.amazonaws.com:6379/1 -to redis://127.0.0.1:6379/1

# Sync protected ElastiCache via EC2 port forwarding.
$ ssh -L 6969:production.cache.amazonaws.com:6379 -N [email protected] &
$ rump -from redis://127.0.0.1:6969/1 -to redis://127.0.0.1:6379/1

# Dump GCP MemoryStore to file.
$ rump -from redis://10.0.20.2:6379/1 -to /backup/memorystore.rump

# Restore backup to ElastiCache.
$ rump -from /backup/memorystore.rump -to redis://production.cache.amazonaws.com:6379/1

# Sync with verbose mode disabled.
$ rump -from redis://127.0.0.1:6379/1 -to redis://127.0.0.1:6379/2 -silent

# Sync with TTLs.
$ rump -from redis://127.0.0.1:6379/1 -to redis://127.0.0.1:6379/2 -ttl

Features

  • Uses SCAN instead of KEYS to avoid DoS servers.
  • Doesn't use any temp file.
  • Can sync any key type.
  • Can optionally sync TTLs.
  • Uses buffered channels to optimize slow source servers.
  • Uses implicit pipelining to minimize network roundtrips.
  • Supports two-step sync: dump source to file, restore file to database.
  • Supports Redis URIs with auth.
  • Offers the same guarantees of the SCAN command.

Demo

asciicast

Development

# requirements: docker, docker-compose (dc)
dc up # watch/run Rump tests and a Redis container
dc run --rm rump sh # get shell on Rump container
dc run --rm redis sh; redis-cli -h redis # get Redis console

Install

Binaries can be found on the releases page.

curl -SL https://github.com/stickermule/rump/releases/download/1.0.0/rump-1.0.0-linux-amd64 -o rump \
  && chmod +x rump;
./rump

You can run rump in a container following the Dockerfile.example.

Mentions

Maintainers

nixtrace

Collaboration & License

Comments
  • tls: add option to connect to redis with enabled tls and auth token

    tls: add option to connect to redis with enabled tls and auth token

    • [x] I have read the contributing guide.
    • [x] Issue: https://github.com/stickermule/rump/issues/41

    Implementation

    Thanks!

  • does redis -> elasticache work?

    does redis -> elasticache work?

    I've just tried to make a run between SRC=a regular redis and DEST=an elasticache server.

    • Rump detects the keys as I see progress on the screen, proportionate to the keys
    • but when I look at the keys in the DEST elasticache I only see 1) "ElastiCacheMasterReplicationTimestamp"

    Is this supported?

    The elasticserver info:

    # Server
    redis_version:2.8.24
    redis_git_sha1:0
    redis_git_dirty:0
    redis_build_id:0
    redis_mode:standalone
    os:Amazon ElastiCache
    arch_bits:64
    
  • Add support to sync only keys matching a certain pattern

    Add support to sync only keys matching a certain pattern

    I've used this tool it in the past and it works great, but now I have a case in which I need to dump keys that only match a certain pattern instead of dumping all the keys of a DB.

    MATCH option of SCAN command can be used to add this support.

    The following commit https://github.com/fzunino/rump/commit/67bc2e1dac6d46019019a8f6cf6996ba8a02cf70 adds this support adding an optional command line argument called match and using * as default value, maintaining the current semantic.

    Let me know and I can submit a PR with this commit.

  • Test Coverage

    Test Coverage

    Hello.

    First of all, thank you very much for this. Very cool.

    I noticed that there's no test coverage and, if it's okay, I'd like to add/increase that? I'm on vacation for the next fortnight, but I can get a PR in before the end of the month?

    Anthony.

  • Added restored keys count status report on USR1 signal, and at the end of the sync.

    Added restored keys count status report on USR1 signal, and at the end of the sync.

    Similar to what the dd does when the user sends the USR1 signal, for windows platform, this is a noop.

    Also added the same report of restored keys count to be printed at the end of the sync.

  • Deleted keys are not removed from sync endpoint

    Deleted keys are not removed from sync endpoint

    Report

    I have been using RUMP last few months to Sync a primary redis endpoint with a failover (in the even of DR). Ive noticed that RUMP is actually copying keys across and not deleted keys that have been removed from primary. For example primary endpoint has around 166 thousand keys, while the failover now has 26 million. is there a flag i am missing to do this or is it not a-part of the functionality? Thank you

  • signal: exit  redis read: exit ERR Invalid TTL value, must be >= 0

    signal: exit redis read: exit ERR Invalid TTL value, must be >= 0

    Report

    Sync with ttl terminated by 'ERR Invalid TTL value, must be >= 0' The source AWS ElastiCache redis version is 3.2.10 rump -from redis://redis-002.ruf311.0001.cnw1.cache.amazonaws.com.cn:6379/0 -to redis://127.0.0.1:6379/0 -ttl signal: exit

    redis read: exit ERR Invalid TTL value, must be >= 0

  • Doesnt show error if auth is enabled

    Doesnt show error if auth is enabled

    I just noticed that if dumping TO a cluster with AUTH enabled, and NOT specifying the auth password in the "connection string", rump will not show any error, leading the user to believe that a dump has been performed (when it in fact has not)

  • Is there a docker image with rump setup?

    Is there a docker image with rump setup?

    The demo link(https://github.com/stickermule/rump#demo) contains an instance of docker image running with rump already installed. However, not able to find an image for the same online

  • ttl support

    ttl support

    Hello,

    rump is a great tool however in certain situations having ttl set to 0 does not work okay (session data etc). May I suggest adding a separate flag for ttl with 0 default, so that default behavior does not change. Please see my local change at https://github.com/stickermule/rump/compare/master...eugenetaranov:ttl, if you find it useful, I'll be happy to make a PR.

  • Rump doesn't copy all keys

    Rump doesn't copy all keys

    In a test environment we did a test transfer between two redis cluster, and we found that there was a bigger number of differences between key numbers. Dest node 1625684 Source node 1673187

    How can this happen, or how can we mitigate these issues? How can we debug what cases them? Thank you

  • bufio.Scanner: token too long

    bufio.Scanner: token too long

    Report

    ./rump -from /opt/Rump/data/redisu0.rump -to redis://:[email protected]:6379/2 signal: exit w redis write: exit bufio.Scanner: token too long

  • Please explain -ttl option

    Please explain -ttl option

    Report

    Please update the docs for the ttl option. It is given without explanation and the example in the README appears incorrect (it lacks a value, which is apparently required).

    1. What happens to records with a TTL when the ttl option is not given?
    2. What happens when it is given?
  • TLS Support, Cluster Support

    TLS Support, Cluster Support

    • [ yes ] I have read the contributing guide.
    • [ yes ] Issue: #42

    Implementation

    Converted to use net/url for config, cleaned up usage, added tls options

  • Add Support for connecting redis with enabled tls and using auth token.

    Add Support for connecting redis with enabled tls and using auth token.

    Report

    In some cases I need to sync redis where tls is enabled and with auth token. And will be good to have an option to sync redis like this: radix support this option.

    rump -from redis://redis-1:6379 -to redis://auth-token-string@redis-2:6379
    
  • Question: Is a cluster with replicas supported?

    Question: Is a cluster with replicas supported?

    Report

    Question: I have a redis cluster created from the bitnami helm chart here: https://github.com/bitnami/charts/tree/master/bitnami/redis-cluster/#installing-the-chart with 3 master nodes and 3 replica nodes. I am trying to copy data from another redis cluster (with no replicas) into this cluster but I keep getting errors like this:

    ./rump -from redis://redis-telem-cache-stg-ksat-m-1-redis-cluster:6379 -to redis://10.255.8.12:6379 -ttl
    r
    signal: exit
    rr
    redis read: exit
    MOVED 4042 10.255.8.14:6379
    

    Note: Above 10.255.8.12:6379 is one of the master nodes.

    $ kk exec rails-cache-stg-redis-ksat-m-1-redis-cluster-0 -- redis-cli --cluster check 10.255.8.10:6379
    Defaulting container name to rails-cache-stg-redis-ksat-m-1-redis-cluster.
    Use 'kubectl describe pod/rails-cache-stg-redis-ksat-m-1-redis-cluster-0 -n default-minim-private' to see all of the containers in this pod.
    10.255.8.15:6379 (fbdd5a4e...) -> 14029 keys | 5462 slots | 1 slaves.
    10.255.8.12:6379 (b3718ac7...) -> 568 keys | 5461 slots | 1 slaves.
    10.255.8.14:6379 (8790c578...) -> 487 keys | 5461 slots | 1 slaves.
    [OK] 15084 keys in 3 masters.
    0.92 keys per slot on average.
    >>> Performing Cluster Check (using node 10.255.8.10:6379)
    S: 8500263462d98613bc6e1172106ddcd37f5976a6 10.255.8.10:6379
       slots: (0 slots) slave
       replicates b3718ac766349261d819c9923cd915fc43d70352
    M: fbdd5a4eebe77b49ec984ec953ec098fe262d320 10.255.8.15:6379
       slots:[5461-10922] (5462 slots) master
       1 additional replica(s)
    S: 4b371b26a9b5b3d0f23d2c965197f0bf3cbc355b 10.255.8.11:6379
       slots: (0 slots) slave
       replicates 8790c57879627039f3d74cc599e61707d33d93d4
    M: b3718ac766349261d819c9923cd915fc43d70352 10.255.8.12:6379
       slots:[10923-16383] (5461 slots) master
       1 additional replica(s)
    S: f01bd775618fd6de9a18160186a48a37b469da03 10.255.8.13:6379
       slots: (0 slots) slave
       replicates fbdd5a4eebe77b49ec984ec953ec098fe262d320
    M: 8790c57879627039f3d74cc599e61707d33d93d4 10.255.8.14:6379
       slots:[0-5460] (5461 slots) master
       1 additional replica(s)
    [OK] All nodes agree about slots configuration.
    >>> Check for open slots...
    >>> Check slots coverage...
    [OK] All 16384 slots covered.
    

    Does rump currently support clusters with replicas? If it does can you recommend a way to diagnose/debug this further?

    Thanks.

  • Add support for Elasticache with In-Transit Encryption

    Add support for Elasticache with In-Transit Encryption

    Report

    The current version of rump does not work with an Elasticache Redis cache cluster where in-transit encryption (TLS) is enabled. If you try it, you will only get errors about blocked connections. (More about in-transit encryption: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/in-transit-encryption.html)

    Would you be interested in a PR to add support for TLS encrypted connections? I have a private version where this works for my use case. If you are interested in a PR, I could create a more general solution that works with all combinations of encrypted / not encrypted connections and files.

    It requires a change to the URL validation, an upgrade of the radix library and some changes to the run package where the connections are managed.

Firebase Cloud Messaging for application servers implemented using the Go programming language.

Firebase Cloud Notifications Client Firebase Cloud Messaging for application servers implemented using the Go programming language. It's designed for

Dec 17, 2022
Google Cloud Messaging for application servers implemented using the Go programming language.

gcm The Android SDK provides a nice convenience library (com.google.android.gcm.server) that greatly simplifies the interaction between Java-based app

Sep 27, 2022
Leave Discord servers using the folder names.

leavemealone ------------ Leave Discord servers using the folder names. Usage ----- 1. `export TOKEN="<token>"` 2. `go run . <folder_name>` 3. Chec

Feb 4, 2022
A serverless sync server for Santa, built on AWS

Rudolph Rudolph is the control server counterpart of Santa, and is used to rapidly deploy configurations to Santa agents. Rudolph is built in Amazon W

Dec 5, 2022
AWS Tags Updater - Sync tags with all resources via sheet 🐏🐏

AWS Tags Updater - Sync tags with all resources via sheet ????

Mar 22, 2022
Go library for querying Source servers

go-steam go-steam is a Go library for querying Source servers. Requirements Go 1.1 or above Installation go get -u github.com/sostronk/go-steam To us

Oct 28, 2022
DiscSpam is the best free and open source tool to spam/raid Discord servers.
DiscSpam is the best free and open source tool to spam/raid Discord servers.

DiscSpam Fast, Free, Easy to use Discord.com raid tool Report Bug , Request Feature About The Project There are a few Discord raid tools on GitHub, ho

Dec 27, 2022
A compute service that lets you run code without provisioning or managing servers

AWS Lambda for Go Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availab

Oct 13, 2021
Trojan discord bot, used for grieving discord servers
Trojan discord bot, used for grieving discord servers

disc-TROJAN-go Trojan discord bot, used for grieving discord servers How Does It Work? disc-TROJAN-go is a discord bot with hidden features. At the ti

Feb 28, 2022
To-Do list in GoLang with Redis as a backend -- Sample project for proof of concepts

?? GoLang To-Do List Sample App w/ Redis ?? Description A simple to-do list app written in GoLang with Redis as a backend showing a few GoLang feature

Dec 14, 2021
Client-Server Expression Evaluator with Persistent Database Support (Redis & SQL)

Client-Server-Expression-Evaluator Client-Server Expression Evaluator with Persistent Database Support (Redis & SQL). Client-Server Expression Evaluat

Jan 4, 2022
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.

tutor-pet API Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure. Macro architecture: Code architecture: Pre-Re

Aug 17, 2022
Asteroids written in Golang using raylib using an ECS system.

Asteroids written in Golang using Raylib using an ECS system.

Feb 12, 2022
Simple no frills AWS S3 Golang Library using REST with V4 Signing (without AWS Go SDK)

simples3 : Simple no frills AWS S3 Library using REST with V4 Signing Overview SimpleS3 is a golang library for uploading and deleting objects on S3 b

Nov 4, 2022
Extend KIND networking capabilities with plugins using the KIND API

kind-networking-plugins Plugins to extend KIND networking capabilities with plugins using the KIND API These plugins were used for the Kubecon EU 2021

Nov 10, 2022
A simple APIRest to Star Wars character using Golang (gin,gorm)
A simple APIRest to Star Wars character using Golang (gin,gorm)

A simple APIRest to Star Wars character using Golang (gin,gorm)

Sep 23, 2021
planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

planet planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport. Get started starport chain serve serve command install

Oct 31, 2021
AWS Mock with using GO SDK V2 middleware

AWS Mock with using GO SDK V2 middleware

Dec 17, 2021
A package for access aws service using AWS SDK for Golang

goaws ?? A package for access aws service using AWS SDK for Golang Advantage with goaws package Example for get user list IAM with AWS SDK for Golang

Nov 25, 2021