yum install centos-release-scl-rh -y
#配置yum仓库
yum install rh-ruby23* -y
#安装其他工具,不安装后面可能会报错
scl enable rh-ruby23 bash
ruby -v
#查看版本
gem install redis-dump -V
redis-dump -u 192.168.0.32 > test.json
&
redis-dump -u 127.0.0.1:6379 -a '9ijn8uhb&*(TGB' > test.json
< test.json redis-load -u 192.168.0.31
ERROR (Yajl::ParseError): lexical error: invalid bytes in UTF8 string.
lue":{"maxInactiveInterval":"0000\u0005sr\u0000\u0011jav
(right here) ------^
#如上报错可加参数 -n,不检查 utf-8格式
< test.json redis-load -n -u 192.168.0.31
&&
redis-load 还原数据 **
[root@git-server ~]# < test.json redis-load -u 127.0.0.1:6379 -a 'zykjdr#558996'
[root@git-server log]# redis-cli -h 127.0.0.1 -p 6379 -a 'zykjdr#558996'
127.0.0.1:6379> get key01
"name01"
127.0.0.1:6379> get key02
"name02"
127.0.0.1:6379>