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 命令, 因为执行 ...
随机推荐
- hiredis window 源码编译
编译工具 cmake mingw730_32 版本 hiredis:0.15 cmake: cmake-3.12.4-win64-x64 mingw: 7.3.0 make配置 注意:D:\Qt\Qt ...
- JS 姓氏,区域,消息组成的随机内容定时随机展示
var surname_g = "\u8D75\u94B1\u5B59\u674E\u5468\u5434\u90D1\u738B\u51AF\u9648\u891A\u536B\u848B ...
- wdcp如何添加反向代理功能
1.winscp进入目录 /www/wdlinux/httpd-x.x.x/conf/右键编辑 httpd.conf 这个文件 依次把下面文件名字前面的 # 号去掉 LoadModule proxy_ ...
- Java 技术网站总结(不停更新)
Spring Spring 中文手册 Spring 教程 Spring For All Spring 学习笔记 Spring Boot Break易站 Spring Cloud 中文文档 Spring ...
- [AGC034F]RNG and XOR
题目 点这里看题目. 分析 第一步可以将\(A\)数组转化成概率\(P(j)\):每一步操作异或\(j\)的概率. 接着发现,\(x\)从\(0\)变成\(i\)的期望等于\(x\)从\( ...
- Tensorflow从0到1(2)之基础知识
张量 张量是tensorflow中的基本数据结构 # 全零张量 zero_tsr = tf.zeros([row_dim, col_dim]) # 全1张量 ones_tsr = tf.ones([r ...
- node实现文件属性批量修改(时间属性)
前言 在默认情况下,一个文件的创建时间和修改时间是系统自己设定的,我们不能修改该的.但我们有时为了某种特殊需要,为了不让别人一眼看出文件已经给修改了,我们又需要修改文件的创建时间和修改时间.那么如何修 ...
- 多语言工作者の十日冲刺<8/10>
这个作业属于哪个课程 软件工程 (福州大学至诚学院 - 计算机工程系) 这个作业要求在哪里 团队作业第五次--Alpha冲刺 这个作业的目标 团队进行Alpha冲刺--第八天(05.07) 作业正文 ...
- 数据库事务(2)---ACID与并发问题
事务 事务(Transaction),一般是指要做的或所做的事情.在计算机术语中是指访问并可能更新数据库中各种数据项的一个程序执行单元(unit).在计算机术语中,事务通常就是指数据库事务. 概念 一 ...
- 下订单更新订单表然后减少库存表中的数据,出现库存超卖,使用数据库和redis坚决库存超卖的问题
上面的代码更新库存的数据,存在多线程的问题,第一种方法使用synchronized关键字修饰的语句块代码,但是性能较低,并且还是存在问题的 在分布式的场景下,当前库存系统部署在多个tomcat上,即使 ...