mkdir -p /home/redis/sync
cd /home/redis/sync
到这里下载最新版的
https://github.com/alibaba/RedisShake/releases/
wget xxx.tar.gz
tar xzf redis-shake-v2.0.3.tar.gz
cd redis-shake-v2.0.3
mkdir ./log
修改
log.file = ./log/redis-shake.log
同步的配置参考
# this is the configuration of redis-shake.
# if you have any problem, please visit https://github.com/alibaba/RedisShake/wiki/FAQ
# current configuration version, do not modify.
# 当前配置文件的版本号,请不要修改该值。
conf.version = 1
# ------------------------------------------------------
# id
id = redis-shake
# log file,日志文件,不配置将打印到stdout (e.g. /var/log/redis-shake.log )
log.file = ./log/redis-shake.log
# log level: "none", "error", "warn", "info", "debug". default is "info".
log.level = info
# pid path,进程文件存储地址(e.g. /var/run/),不配置将默认输出到执行下面,
# 注意这个是目录,真正的pid是`{pid_path}/{id}.pid`
pid_path =
# pprof port.
system_profile = 9310
# restful port, set -1 means disable, in `restore` mode RedisShake will exit once finish restoring RDB only if this value
# is -1, otherwise, it'll wait forever.
# restful port,查看metric端口, -1表示不启用,如果是`restore`模式,只有设置为-1才会在完成RDB恢复后退出,否则会一直block。
http_profile = 9320
# parallel routines number used in RDB file syncing. default is 64.
# 启动多少个并发线程同步一个RDB文件。
parallel = 32
source.type= standalone
source.address= 172.31.61.62:6600
source.password_raw=
target.type= standalone
target.address= 127.0.0.1:6600
target.password_raw=
启动二进制:./redis-shake.linux -conf=redis-shake.conf -type=xxx # xxx为sync, restore, dump, decode, rump其中之一,全量+增量同步请选择sync。 mac下请使用redis-shake.darwin,windows请用redis-shake.windows.
所以最终启动命令是
./redis-shake.linux -conf=redis-shake.conf -type=sync
自启动命令
/home/ngzb/redis/sync/redis-shake-v2.0.3/redis-shake.linux -conf=/home/ngzb/redis/sync/redis-shake-v2.0.3/redis-shake.conf -type=sync
nohup /home/ngzb/redis/sync/redis-shake-v2.0.3/redis-shake.linux -conf=/home/ngzb/redis/sync/redis-shake-v2.0.3/redis-shake.conf -type=sync > /home/ngzb/redis/sync/redis-shake-v2.0.3/log/start.log &