redis cluster info显示cluster_state:fail解决方案
1、查看错误信息:
1.1 错误信息(1)
- 127.0.0.1:7000> get name
- (error) CLUSTERDOWN The cluster is down
- 127.0.0.1:7000> cluster info
- cluster_state:fail
- cluster_slots_assigned:16380
- cluster_slots_ok:16380
- cluster_slots_pfail:0
- cluster_slots_fail:0
- cluster_known_nodes:6
- cluster_size:3
- cluster_current_epoch:8
- cluster_my_epoch:1
- cluster_stats_messages_sent:1007
- cluster_stats_messages_received:1005
1.2 错误信息(2)
- 127.0.0.1:7000> cluster slots
- 1) 1) (integer) 0
- 2) (integer) 5460
- 3) 1) "127.0.0.1"
- 2) (integer) 7000
- 3) "09d1ad8d8aa8acd0ca2b95206c58901e47318ec9"
- 4) 1) "127.0.0.1"
- 2) (integer) 7004
- 3) "3b6910a3cf76025564d9f744f64ffa3a3b35fbc8"
- 2) 1) (integer) 10923
- 2) (integer) 11991
- 3) 1) "127.0.0.1"
- 2) (integer) 7002
- 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
- 4) 1) "127.0.0.1"
- 2) (integer) 7003
- 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
- 3) 1) (integer) 11993
- 2) (integer) 12381
- 3) 1) "127.0.0.1"
- 2) (integer) 7002
- 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
- 4) 1) "127.0.0.1"
- 2) (integer) 7003
- 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
- 4) 1) (integer) 12383
- 2) (integer) 14040
- 3) 1) "127.0.0.1"
- 2) (integer) 7002
- 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
- 4) 1) "127.0.0.1"
- 2) (integer) 7003
- 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
- 5) 1) (integer) 14042
- 2) (integer) 14385
- 3) 1) "127.0.0.1"
- 2) (integer) 7002
- 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
- 4) 1) "127.0.0.1"
- 2) (integer) 7003
- 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
- 6) 1) (integer) 14387
- 2) (integer) 16383
- 3) 1) "127.0.0.1"
- 2) (integer) 7002
- 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
- 4) 1) "127.0.0.1"
- 2) (integer) 7003
- 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
- 7) 1) (integer) 5461
- 2) (integer) 10922
- 3) 1) "127.0.0.1"
- 2) (integer) 7001
- 3) "caa158fcb538991c73438ca9801ab6ab2510e85a"
- 4) 1) "127.0.0.1"
- 2) (integer) 7005
- 3) "0fbf5cbddefe6ad2324a225d25447ff80b033b27"
2.分析错误信息
2.1 从错误信息(1)中cluster_slots_assigned:16380看出少了4个slot,因为集群就是要满足所有的16364个槽点全部分配才会成功。
2.2 统计错误信息(2)
- 1) 0-5460 7000、7004
- 2)10923-11991 7002、7003
- 3)11993-12381 7002、7003
- 4)12383-14040 7002、7003
- 5)14042-14385 7002、7003
- 6)14387-16383 7002、7003
- 7) 5461-10922 7001、7005
找到缺少的slot分别为11992、12382、14041、14386
3.解决方法:
3.1将一个或多个槽(slot)指派(assign)给当前节点
cluster addslots 11992 12382 14041 14386
3.2 显示结果:
- 127.0.0.1:7000> cluster addslots 11992 12382 14041 14386
- OK
- 127.0.0.1:7000> cluster info
- cluster_state:ok
- cluster_slots_assigned:16384
- cluster_slots_ok:16384
- cluster_slots_pfail:0
- cluster_slots_fail:0
- cluster_known_nodes:6
- cluster_size:3
- cluster_current_epoch:8
- cluster_my_epoch:1
- cluster_stats_messages_sent:42312
4、解决方法2:
写shell脚本用cluster addslots命令吧1~16384所有槽点都添加一遍即可。对于已经存在的会说此槽点正在忙,所以不用担心重复添加。之后查看集群状态即为正常。
脚本如下:
- > /home/sw/2
- for ((i=1;i<=16384;i++));
- do
- echo "redis-cli -h 192.168.5.115 -p 7004 cluster addslots "${i} >> /home/sw/2
- done
#redis-cli -h 192.168.5.115 -p 7004 cluster addslots 1..16384
之后运行2脚本并且把日志打印到/home/sw/3:sh 2 |tee /home/sw/3 即可。
参考:https://blog.csdn.net/zsx18273117003/article/details/83414440
redis cluster info显示cluster_state:fail解决方案的更多相关文章
- 近千节点的Redis Cluster高可用集群案例:优酷蓝鲸优化实战(摘自高可用架构)
(原创)2016-07-26 吴建超 高可用架构导读:Redis Cluster 作者建议的最大集群规模 1,000 节点,目前优酷在蓝鲸项目中管理了超过 700 台节点,积累了 Redis Clus ...
- redis cluster突然少了一个node的问题
今天进入redis执行cluster info发现 cluster_state:fail 并且 cluster_known_nodes:5 少了一个7006的node 然后我重启了7006的 ...
- 全面剖析Redis Cluster原理和应用 (转)
1.Redis Cluster总览 1.1 设计原则和初衷 在官方文档Cluster Spec中,作者详细介绍了Redis集群为什么要设计成现在的样子.最核心的目标有三个: 性能:这是Redis赖以生 ...
- 全面剖析Redis Cluster原理和应用 (good)
redis redis cluster注意的问题 : 1.‘cluster-require-full-coverage’参数的设置.该参数是redis配置文件中cluster模式的一个参数,从字面上基 ...
- Redis Cluster部署、管理和测试
背景: Redis 3.0之后支持了Cluster,大大增强了Redis水平扩展的能力.Redis Cluster是Redis官方的集群实现方案,在此之前已经有第三方Redis集群解决方案,如Twen ...
- 全面剖析Redis Cluster原理和应用
全面剖析Redis Cluster原理和应用 1.Redis Cluster总览 1.1 设计原则和初衷 在官方文档Cluster Spec中,作者详细介绍了Redis集群为什么要设计成现在的样子.最 ...
- Redis Cluster集群知识学习总结
Redis集群解决方案有两个: 1) Twemproxy: 这是Twitter推出的解决方案,简单的说就是上层加个代理负责分发,属于client端集群方案,目前很多应用者都在采用的解决方案.Twem ...
- Redis cluster集群:原理及搭建
Redis cluster集群:原理及搭建 2018年03月19日 16:00:55 阅读数:6120 1.为什么使用redis? redis是一种典型的no-sql 即非关系数据库 像python的 ...
- 【Redis】Redis cluster集群搭建
Redis集群基本介绍 Redis 集群是一个可以在多个 Redis 节点之间进行数据共享的设施installation. Redis 集群不支持那些需要同时处理多个键的 Redis 命令, 因为执行 ...
随机推荐
- ServiceStack.Redis 5.8 版本去掉每小时 6000 次访问限制
ServiceStack.Redis这个官方 Redis 访问组件从4.0版本后开始商业化了,在使用的时候会有很多限制: 1.类型限制 类型限制是20,这个组件自带序列化功能,使得我们可以直接把对象保 ...
- WDCP配置ThinkPHP5伪静态隐藏index.php,出现“”解决重定向次数过”问题
站点域名的配置:xxx.com.conf server { listen 80; root /www/web/xxx_com/public_html; server_name xxx.com; ind ...
- wdcp如何添加反向代理功能
1.winscp进入目录 /www/wdlinux/httpd-x.x.x/conf/右键编辑 httpd.conf 这个文件 依次把下面文件名字前面的 # 号去掉 LoadModule proxy_ ...
- .NET Core加解密实战系列之——RSA非对称加密算法
目录 简介 功能依赖 生成RSA秘钥 PKCS1格式 PKCS8格式 私钥操作 PKCS1与PKCS8格式互转 PKCS1与PKCS8私钥中提取公钥 PEM操作 PEM格式密钥读取 PEM格式密钥写入 ...
- mysql where与 having的区别
where是针对磁盘的数据文件,having是针对存在内存的结果集的筛选. 例如: select name ,(xxx - xxx) as a from table where a > 10; ...
- iOSdelegate、Notification、block区别
1.delegate与block一般用于1对1的通信交互.delegate需先定义好协议方法,代理对象实现协议方法且需要建立代理关系才可以通信. 2.block使用简洁,如果通信事件较多,建议使用de ...
- webdriver中的等待
强制等待:sleep() 设置固定休眠时间,单位为秒. 由python的time包提供, 导入 time 包后就可以使用. 缺点:不智能,使用太多的sleep会影响脚本运行速度. 隐式等待:impli ...
- 使用matplotlib进行可视化
转自:https://blog.csdn.net/qq_30614345/article/details/99049790 https://blog.csdn.net/qq_30614345/arti ...
- Zookeeper——Watcher原理详解
文章目录 引言 正文 一.如何注册监听 二.如何触发监听事件 三.事件类型有哪些 四.Watcher可以被无限次触发么?为什么要这么设计? 五.Watcher实现原理 1. 客服端发送请求 a. 初始 ...
- 定时任务Cron
Linux系统中的定时任务cron,一个很实际很有效很简单的一个工作,在日常的生产环境中,会被广泛使用的一个组件.通过设置时间.执行的脚本等内容,能够让系统自动的执行相关任务,很是方便. cron定时 ...