• Stars
    star
    216
  • Rank 183,179 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Backup & Restore your Redis server - FAST

Build status go report card

Redis-dump-go

Dump Redis keys to a file. Similar in spirit to https://www.npmjs.com/package/redis-dump and https://github.com/delano/redis-dump but:

  • Will dump keys across several processes & connections
  • Uses SCAN rather than KEYS * for much reduced memory footprint with large databases
  • Easy to deploy & containerize - single binary.
  • Generates a RESP file rather than a JSON or a list of commands. This is faster to ingest, and recommended by Redis for mass-inserts.

Warning: like similar tools, Redis-dump-go does NOT provide Point-in-Time backups. Please use Redis backups methods when possible.

Features

  • Dumps all databases present on the Redis server
  • Keys TTL are preserved by default
  • Configurable Output (Redis commands, RESP)
  • Redis password-authentication

Installation

Download the appropriate version for your operating system on Ε§he release page, or use the Docker image:

$ docker run ghcr.io/yannh/redis-dump-go:latest -h
Usage of /redis-dump-go:
[...]

Bandwidth costs: Redis-dump-go is hosted on on Github Container Registry which is currently in Beta. During that period, bandwidth is free. After that period, a Github Account might be required / bandwidth costs might be applicable.

Run

$ ./bin/redis-dump-go -h
Usage of ./bin/redis-dump-go:
  -batchSize int
        HSET/RPUSH/SADD/ZADD only add 'batchSize' items at a time (default 1000)
  -db uint
        only dump this database (default: all databases)
  -filter string
        Key filter to use (default "*")
  -host string
        Server host (default "127.0.0.1")
  -n int
        Parallel workers (default 10)
  -noscan
        Use KEYS * instead of SCAN - for Redis <=2.8
  -output string
        Output type - can be resp or commands (default "resp")
  -port int
        Server port (default 6379)
  -s    Silent mode (disable logging of progress / stats)
  -ttl
        Preserve Keys TTL (default true)

$ ./bin/redis-dump-go > dump.resp
Database 0: 9 element dumped
Database 1: 1 element dumped

For password-protected Redis servers, set the shell variable REDISDUMPGO_AUTH:

$ export REDISDUMPGO_AUTH=myRedisPassword
$ redis-dump-go

Build

Given a correctly configured Go environment:

$ go get github.com/yannh/redis-dump-go
$ cd ${GOPATH}/src/github.com/yannh/redis-dump-go
$ go test ./...
$ go install

Importing the data

redis-cli --pipe < redis-backup.txt

Release Notes & Gotchas

  • By default, no cleanup is performed before inserting data. When importing the resulting file, hashes, sets and queues will be merged with data already present in the Redis.

More Repositories

1

kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Go
1,231
star
2

terraform-provider-statuspage

A Terraform provider for Statuspage.io
Go
42
star
3

openbsd_immutable_router

Packer/Ansible configuration for the automatic generation of an immutable OpenBSD image for a full router/firewall server
Vim Script
41
star
4

k8s-happy-ip

Kubernetes operator to manage virtual interfaces on nodes
Go
11
star
5

statuspage-go-sdk

Go SDK for Statuspage.io
Go
8
star
6

freebsd_immutable_nas

Packer/Ansible configuration for the automatic generation of an immutable FreeBSD image for a ZFS-based NAS appliance
Shell
6
star
7

fastly-inspect

A modern, free-software clone of Fastly-debug.com, that works both in the Browser and as a CLI.
HTML
6
star
8

you-should-test-your-kubernetes-manifests

Learn to test Kubernetes manifests by example
Shell
5
star
9

csv2bib

Convert a bibliography stored in CSV files to BIBTex
Python
5
star
10

jenkins-on-aws

An opinionated way to deploying Jenkins on AWS using Packer, Puppet, Cloudformation and Docker.
Puppet
3
star
11

r10k-go

Fast & resilient Puppet module deployments
Go
3
star
12

fastly-pages

Host a static website directly on ☁ Fastly compute ☁
Rust
2
star
13

puppet-fluent_bit

A Puppet module for the Fluent-bit log shipper.
Puppet
1
star
14

restreflect

REST. Reflect. Enjoy a simple HTTP Echo server.
Rust
1
star
15

arpicee

The Remote Procedure Framework - running GH Actions, Lambdas, AWS SSM from Slack or the CLI
Go
1
star
16

tfplan-to-aws-config

(Ab)using Terraform plans to record custom resources to AWS Config
Go
1
star
17

aws-firehose-s3-producer

Stream files uploaded to AWS S3 to AWS Kinesis Firehose
JavaScript
1
star