linux - redis-trib.rb 命令详解
2023-09-14 08:57:36 时间
参考网站
http://www.cnblogs.com/ivictor/p/9768010.html
简介
redis-trib.rb是官方提供的Redis Cluster的管理工具,无需额外下载,默认位于源码包的src目录下,但因该工具是用ruby开发的,所以需要准备相关的依赖环境
准备redis-trib.rb的运行环境
wget https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz
tar xvf ruby-2.5.1.tar.gz
cd ruby-2.5.1/
./configure -prefix=/usr/local/ruby
make
make install
cd /usr/local/ruby/
cp bin/ruby /usr/local/bin
cp bin/gem /usr/local/bin
安装rubygem redis依赖
wget http://rubygems.org/downloads/redis-3.3.0.gem
gem install -l redis-3.3.0.gem
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.
支持的操作如下:
1. create:创建集群
2. check:检查集群
3. info:查看集群信息
4. fix:修复集群
5. reshard:在线迁移slot
6. rebalance:平衡集群节点slot数量
7. add-node:添加新节点
8. del-node:删除节点
9. set-timeout:设置节点的超时时间
10. call:在集群所有节点上执行命令
11. import:将外部redis数据导入集群
相关文章
- linux下redis的安装和集群搭建
- [Linux] linux awk命令详解
- [Linux] linux文件系统学习
- Linux系统安装NoSQL(MongoDB和Redis)步骤及问题解决办法
- Linux 查找redis进程命令:ps -ef | grep redis
- Redis缓存穿透、缓存雪崩、redis并发问题 并发竞争key的解决方案 (阿里)
- L81.linux命令每日一练 -- 第11章 Linux系统管理命令 -- ethtool和mii-tool
- L79.linux命令每日一练 -- 第11章 Linux系统管理命令 -- sar和chkconfig
- L76.linux命令每日一练 -- 第11章 Linux系统管理命令 -- free和iftop
- L67.linux命令每日一练 -- 第十章 Linux网络管理命令 -- netstat和ss
- L65.linux命令每日一练 -- 第十章 Linux网络管理命令 -- ifdown和route
- L62.linux命令每日一练 -- 第九章 Linux进程管理命令 -- strace和ltrace
- L59.linux命令每日一练 -- 第九章 Linux进程管理命令 -- killall和pkill
- L57.linux命令每日一练 -- 第九章 Linux进程管理命令 -- ps和pstree
- L56.linux命令每日一练 -- 第八章 Linux磁盘与文件系统管理命令 -- swapoff和sync
- L51.linux命令每日一练 -- 第八章 Linux磁盘与文件系统管理命令 -- mkfs和dumpe2fs
- L50.linux命令每日一练 -- 第八章 Linux磁盘与文件系统管理命令 -- tune2fs和parted
- L45.linux命令每日一练 -- 第七章 Linux用户管理及用户信息查询命令 -- sudo和id
- L33.linux命令每日一练 -- 第五章 Linux信息显示与搜索文件命令 -- du和date
- L32.linux命令每日一练 -- 第五章 Linux信息显示与搜索文件命令 -- dmesg和stat
- L31.linux命令每日一练 -- 第五章 Linux信息显示与搜索文件命令 -- uname和hostname
- redis-5.0.5安装(linux centos)
- Redis-3.2.0集群配置(redis cluster)
- 【redis】Redis缓存失效、雪崩、穿透、击穿、并发等案例分析难题解决方案