Bootstrap

使用redis-dump导出导入redis数据

Centos默认支持ruby到2.0.0,可gem 安装redis需要最低是2.2.2
解决办法是 先安装rvm,再把ruby版本提升至2.3.3
安装Ruby环境
yum install ruby rubygems ruby-devel -y
更改gem源
gem sources -a https://gems.ruby-china.com/
gem sources --remove http://rubygems.org/
gem sources -l
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3

gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

curl -L get.rvm.io | bash -s stable

source /usr/local/rvm/scripts/rvm

rvm list known

rvm install 2.3.3

rvm use 2.3.3
rvm use 2.3.3 --default

rvm remove 2.0.0
安装redis-dump
gem install redis-dump -V

导出到文件172.17.127.125.json,-u:后面为密码
redis-dump -u :[email protected]:6379 > 172.17.127.125.json
导入到内网172.16.0.67,选择db为20,-u:后面为密码
cat 172.17.127.125.json | redis-load -d 200 -u :[email protected]:6379

;