redis-trib.rb
什么是redis-trib.rb?
准备运行环境
yum install -y ruby
wget http://rubygems.org/downloads/redis-3.3.0.gem
gem install -l redis-3.3.0.gem
gem list --check redis gem
cp ${REDIS_HOME}/src/redis-trib.rb /usr/local/bin
Redis-trib.rb命令
# redis-trib.rb help
Usage: redis-trib <command> <options> <arguments ...>
create host1:port1 ... hostN:portN
--replicas <arg>
check host:port
info host:port
fix host:port
--timeout <arg>
reshard host:port
--from <arg>
--to <arg>
--slots <arg>
--yes
--timeout <arg>
--pipeline <arg>
rebalance host:port
--weight <arg>
--auto-weights
--use-empty-masters
--timeout <arg>
--simulate
--pipeline <arg>
--threshold <arg>
add-node new_host:new_port existing_host:existing_port
--slave
--master-id <arg>
del-node host:port node_id
set-timeout host:port milliseconds
call host:port command arg arg .. arg
import host:port
--from <arg>
--copy
--replace
help (show this help)
For check, fix, reshard, del-node, set-timeout you can specify the host and port of any working node in the cluster.创建集群
检查集群状态
查看集群信息
修复集群
迁移数据与槽
平衡集群节点槽数量
删除节点
添加新节点
设置节点的超时时间
在集群所有节点上执行命令
将外部redis数据导入集群
最后更新于