Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

redis-port

> 编程语言
Open source

redis-port =========== parse redis rdb file, sync data between redis master and slave DECODE dumped payload to human readable format (hex-e…

637 stars0 likes1 views
WebsiteGitHub

About

redis-port =========== parse redis rdb file, sync data between redis master and slave DECODE dumped payload to human readable format (hex-e…

redis-port

parse redis rdb file, sync data between redis master and slave

  • DECODE dumped payload to human readable format (hex-encoding)
bash
redis-port decode    [--ncpu=N] [--parallel=M] \
    [--input=INPUT] \
    [--output=OUTPUT]
  • RESTORE rdb file to target redis
bash
redis-port restore   [--ncpu=N] [--parallel=M] \
    [--input=INPUT]  [--faketime=FAKETIME] [--extra] [--filterdb=DB] \
     --target=TARGET [--auth=AUTH] [--redis|--codis]
  • DUMP rdb file from master redis
bash
redis-port dump      [--ncpu=N] [--parallel=M] \
     --from=MASTER   [--password=PASSWORD] [--extra] \
    [--output=OUTPUT]
  • SYNC data from master to slave
bash
redis-port sync      [--ncpu=N] [--parallel=M] \
     --from=MASTER   [--password=PASSWORD] [--psync] [--filterdb=DB] \
     --target=TARGET [--auth=AUTH] [--redis|--codis] [--sockfile=FILE [--filesize=SIZE]]

Options

  • -n N, --ncpu=N

set runtime.GOMAXPROCS to N

  • -p M, --parallel=M

set number of parallel routines

  • -i INPUT, --input=INPUT

use INPUT as input file, or if it is not given, redis-port reads from stdin (means '/dev/stdin')

  • -o OUTPUT, --output=OUTPUT

use OUTPUT as output file, or if it is not given, redis-port writes to stdout (means '/dev/stdout')

  • -m MASTER, --master=MASTER

specify the master redis

  • -t TARGET, --target=TARGET

specify the slave redis (or target redis)

  • -P PASSWORD, --password=PASSWORD

specify the redis auth password

  • -A AUTH, --auth=AUTH

specify the auth password for target

  • -e, --extra

dump or restore following redis backlog commands

  • --redis

target is normal redis instance, default value is false.

  • --codis

target is codis proxy, default value is true.

  • --filterdb=DB

filter specifed db number, default value is '*'

Examples

  • DECODE
bash
$ cat dump.rdb | ./redis-port decode 2>/dev/null
 {"db":0,"type":"string","key":"a","value":"hello"}
 {"db":1,"type":"string","key":"a","value":"9"}
 {"db":0,"type":"hash","key":"c","field":"hello","value":"world"}
 {"db":0,"type":"expire","key":"c","expireat":1487663341422}
 {"db":0,"type":"list","key":"b","index":0,"value":"hello"}
 {"db":0,"type":"list","key":"b","index":1,"value":"world"}
 {"db":0,"type":"zset","key":"d","member":"hello","score":1}
 {"db":0,"type":"zset","key":"d","member":"world","score":1.8}
  ... ...
  • RESTORE
bash
$ ./redis-port restore -i dump.rdb -t 127.0.0.1:6379 -n 8
  2014/10/28 15:08:26 [ncpu=8] restore from 'dump.rdb' to '127.0.0.1:6379'
  2014/10/28 15:08:27 total = 280149161 -     14267777 [  5%]
  2014/10/28 15:08:28 total = 280149161 -     27325530 [  9%]
  2014/10/28 15:08:29 total = 280149161 -     40670677 [ 14%]
  ... ...                                                    
  2014/10/28 15:08:47 total = 280149161 -    278070563 [ 99%]
  2014/10/28 15:08:47 total = 280149161 -    280149161 [100%]
  2014/10/28 15:08:47 done
  • DUMP
…
  • SYNC
…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言