Redis-port =========== 解析 Redis rdb 文件,同步 Redis 主机和从机之间的数据 将解码的有效负载转换为人类可读格式 (hex-e …)
Redis-port =========== 解析 Redis rdb 文件,同步 Redis 主机和从机之间的数据 将解码的有效负载转换为人类可读格式 (hex-e …)
parse redis rdb file, sync data between redis master and slave
redis-port decode [--ncpu=N] [--parallel=M] \
[--input=INPUT] \
[--output=OUTPUT]redis-port restore [--ncpu=N] [--parallel=M] \
[--input=INPUT] [--faketime=FAKETIME] [--extra] [--filterdb=DB] \
--target=TARGET [--auth=AUTH] [--redis|--codis]redis-port dump [--ncpu=N] [--parallel=M] \
--from=MASTER [--password=PASSWORD] [--extra] \
[--output=OUTPUT]redis-port sync [--ncpu=N] [--parallel=M] \
--from=MASTER [--password=PASSWORD] [--psync] [--filterdb=DB] \
--target=TARGET [--auth=AUTH] [--redis|--codis] [--sockfile=FILE [--filesize=SIZE]]set runtime.GOMAXPROCS to N
set number of parallel routines
use INPUT as input file, or if it is not given, redis-port reads from stdin (means '/dev/stdin')
use OUTPUT as output file, or if it is not given, redis-port writes to stdout (means '/dev/stdout')
specify the master redis
specify the slave redis (or target redis)
specify the redis auth password
specify the auth password for target
dump or restore following redis backlog commands
target is normal redis instance, default value is false.
target is codis proxy, default value is true.
filter specifed db number, default value is '*'
$ 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}
... ...$ ./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……暂无开放 Issues,或尚未同步最近议题。