others-How to parse redis rdb dump file?

1. Purpose

In this post, I would demonstrate how to parse redis dump file using tools like rdr.



2. The solution

2.1 What is rdr ?

RDR(redis data reveal) is a tool to parse redis rdbfile. Comparing to redis-rdb-tools, RDR is implemented by golang, much faster (5GB rdbfile takes about 2mins on my PC).



2.2 How to install rdr?

You can download RDR by following links:

Linux amd64 Download

OSX Download

Windows Download

After downloading maybe need add permisson to execute.

$ chmod a+x ./rdr*

2.3 How to use rdr to analyze redis dump file?

After download ,navigate to the directory contains rdr and your redis dump file:

root@launch-advisor:~/rdr# ./rdr-linux show -p 8080 dump2.rdb
start parsing...
parse dump2.rdb  done
parsing finished, please access http://{$IP}:8080

Then open your browser , navigate to http://xxxx:8080, you would get this:

2.4 rdr other options

root@launch-advisor:~/rdr# ./rdr-linux
NAME:
   rdr - a tool to parse redis rdbfile

USAGE:
   rdr-linux [global options] command [command options] [arguments...]

VERSION:
   v0.0.1

COMMANDS:
     dump     dump statistical information of rdbfile to STDOUT
     show     show statistical information of rdbfile by webpage
     keys     get all keys from rdbfile
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version



3. Summary

In this post, I demonstrated how to use rdr to analyze redis dump files, it’s a great tool. That’s it, thanks for your reading.