1、查看错误信息:

1.1 错误信息(1)

  1. 127.0.0.1:7000> get name
  2. (error) CLUSTERDOWN The cluster is down
  3. 127.0.0.1:7000> cluster info
  4. cluster_state:fail
  5. cluster_slots_assigned:16380
  6. cluster_slots_ok:16380
  7. cluster_slots_pfail:0
  8. cluster_slots_fail:0
  9. cluster_known_nodes:6
  10. cluster_size:3
  11. cluster_current_epoch:8
  12. cluster_my_epoch:1
  13. cluster_stats_messages_sent:1007
  14. cluster_stats_messages_received:1005

1.2 错误信息(2)

  1. 127.0.0.1:7000> cluster slots
  2. 1) 1) (integer) 0
  3. 2) (integer) 5460
  4. 3) 1) "127.0.0.1"
  5. 2) (integer) 7000
  6. 3) "09d1ad8d8aa8acd0ca2b95206c58901e47318ec9"
  7. 4) 1) "127.0.0.1"
  8. 2) (integer) 7004
  9. 3) "3b6910a3cf76025564d9f744f64ffa3a3b35fbc8"
  10. 2) 1) (integer) 10923
  11. 2) (integer) 11991
  12. 3) 1) "127.0.0.1"
  13. 2) (integer) 7002
  14. 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
  15. 4) 1) "127.0.0.1"
  16. 2) (integer) 7003
  17. 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
  18. 3) 1) (integer) 11993
  19. 2) (integer) 12381
  20. 3) 1) "127.0.0.1"
  21. 2) (integer) 7002
  22. 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
  23. 4) 1) "127.0.0.1"
  24. 2) (integer) 7003
  25. 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
  26. 4) 1) (integer) 12383
  27. 2) (integer) 14040
  28. 3) 1) "127.0.0.1"
  29. 2) (integer) 7002
  30. 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
  31. 4) 1) "127.0.0.1"
  32. 2) (integer) 7003
  33. 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
  34. 5) 1) (integer) 14042
  35. 2) (integer) 14385
  36. 3) 1) "127.0.0.1"
  37. 2) (integer) 7002
  38. 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
  39. 4) 1) "127.0.0.1"
  40. 2) (integer) 7003
  41. 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
  42. 6) 1) (integer) 14387
  43. 2) (integer) 16383
  44. 3) 1) "127.0.0.1"
  45. 2) (integer) 7002
  46. 3) "9b7110678b6eef4ae80c330eb0cfb51ffbc216ea"
  47. 4) 1) "127.0.0.1"
  48. 2) (integer) 7003
  49. 3) "7d0da6cebfa834177a189b9f71b048e8aeb29c49"
  50. 7) 1) (integer) 5461
  51. 2) (integer) 10922
  52. 3) 1) "127.0.0.1"
  53. 2) (integer) 7001
  54. 3) "caa158fcb538991c73438ca9801ab6ab2510e85a"
  55. 4) 1) "127.0.0.1"
  56. 2) (integer) 7005
  57. 3) "0fbf5cbddefe6ad2324a225d25447ff80b033b27"

2.分析错误信息
 2.1 从错误信息(1)中cluster_slots_assigned:16380看出少了4个slot,因为集群就是要满足所有的16364个槽点全部分配才会成功。
2.2 统计错误信息(2)

  1. 1) 0-5460     7000、7004
  2. 2)10923-11991     7002、7003
  3. 3)11993-12381     7002、7003
  4. 4)12383-14040     7002、7003
  5. 5)14042-14385     7002、7003
  6. 6)14387-16383     7002、7003
  7. 7) 5461-10922     7001、7005

找到缺少的slot分别为11992、12382、14041、14386

3.解决方法:
 3.1将一个或多个槽(slot)指派(assign)给当前节点

cluster addslots 11992 12382 14041 14386
3.2 显示结果:

  1. 127.0.0.1:7000> cluster addslots 11992 12382 14041 14386
  2. OK
  3. 127.0.0.1:7000> cluster info
  4. cluster_state:ok
  5. cluster_slots_assigned:16384
  6. cluster_slots_ok:16384
  7. cluster_slots_pfail:0
  8. cluster_slots_fail:0
  9. cluster_known_nodes:6
  10. cluster_size:3
  11. cluster_current_epoch:8
  12. cluster_my_epoch:1
  13. cluster_stats_messages_sent:42312

4、解决方法2:

  写shell脚本用cluster addslots命令吧1~16384所有槽点都添加一遍即可。对于已经存在的会说此槽点正在忙,所以不用担心重复添加。之后查看集群状态即为正常。

脚本如下:

  1. > /home/sw/2
  2. for ((i=1;i<=16384;i++));
  3. do
  4. echo "redis-cli -h 192.168.5.115 -p 7004 cluster addslots "${i} >> /home/sw/2
  5. 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解决方案的更多相关文章

  1. 近千节点的Redis Cluster高可用集群案例:优酷蓝鲸优化实战(摘自高可用架构)

    (原创)2016-07-26 吴建超 高可用架构导读:Redis Cluster 作者建议的最大集群规模 1,000 节点,目前优酷在蓝鲸项目中管理了超过 700 台节点,积累了 Redis Clus ...

  2. redis cluster突然少了一个node的问题

    今天进入redis执行cluster info发现  cluster_state:fail  并且  cluster_known_nodes:5   少了一个7006的node 然后我重启了7006的 ...

  3. 全面剖析Redis Cluster原理和应用 (转)

    1.Redis Cluster总览 1.1 设计原则和初衷 在官方文档Cluster Spec中,作者详细介绍了Redis集群为什么要设计成现在的样子.最核心的目标有三个: 性能:这是Redis赖以生 ...

  4. 全面剖析Redis Cluster原理和应用 (good)

    redis redis cluster注意的问题 : 1.‘cluster-require-full-coverage’参数的设置.该参数是redis配置文件中cluster模式的一个参数,从字面上基 ...

  5. Redis Cluster部署、管理和测试

    背景: Redis 3.0之后支持了Cluster,大大增强了Redis水平扩展的能力.Redis Cluster是Redis官方的集群实现方案,在此之前已经有第三方Redis集群解决方案,如Twen ...

  6. 全面剖析Redis Cluster原理和应用

    全面剖析Redis Cluster原理和应用 1.Redis Cluster总览 1.1 设计原则和初衷 在官方文档Cluster Spec中,作者详细介绍了Redis集群为什么要设计成现在的样子.最 ...

  7. Redis Cluster集群知识学习总结

    Redis集群解决方案有两个: 1)  Twemproxy: 这是Twitter推出的解决方案,简单的说就是上层加个代理负责分发,属于client端集群方案,目前很多应用者都在采用的解决方案.Twem ...

  8. Redis cluster集群:原理及搭建

    Redis cluster集群:原理及搭建 2018年03月19日 16:00:55 阅读数:6120 1.为什么使用redis? redis是一种典型的no-sql 即非关系数据库 像python的 ...

  9. 【Redis】Redis cluster集群搭建

    Redis集群基本介绍 Redis 集群是一个可以在多个 Redis 节点之间进行数据共享的设施installation. Redis 集群不支持那些需要同时处理多个键的 Redis 命令, 因为执行 ...

随机推荐

  1. fedora gtk+ 2.0环境安装配置

    1.安装gtk yum install gtk2 gtk2-devel gtk2-devel-docs 2.测试是否安装成功 pkg-config --cflags --libs gtk+-2.0 执 ...

  2. win10 设置开机启动VMware虚拟机并打开指定镜像

    1.设置win10开机启动应用 把应用程序的‘快捷方式’放到“系统启动文件夹”里即可. 2.开机启动VMware虚拟机并打开指定镜像 a.右键VMware Workstation快捷方式,看属性 b. ...

  3. UI 小白设计常用的Website

    网址 设计师导航网址(其实这个用好了,enough) 设计导航1 设计导航2 icon 阿里巴巴Iconfont flaticons icomoon Noun Project 图片(有时候就是灵魂) ...

  4. pom.xml 文件详解

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  5. Microsoft SQL Server Migration Assistant for MySQL(从MySQL迁移表数据到MSSQL2008R2)_3

    环境: 英文版(Windows7 64 bit + MySQL8.0.18 64 bit + MSSQL2008R2 64 bit)                           Microso ...

  6. python批量发邮件

    如果有一天,老板过来给你一个很大的邮箱列表,要你给每个人发邮件,你该如何去做,最简单的就是写一个 python 程序 # coding:utf-8import smtplibfrom email.mi ...

  7. Zookeeper——分布式一致性协议及Zookeeper Leader选举原理

    文章目录 一.引言 二.从ACID到CAP/BASE 三.分布式一致性协议 1. 2PC和3PC 2PC 发起事务请求 事务提交/回滚 3PC canCommit preCommit doCommit ...

  8. ZooKeeper使用入门

    ZooKeeper简介 ZooKeeper是一个分布式的,开源的分布式应用程序协调服务,是Hadoop的子项目之一.它是一个为分布式应用提供一致性服务的软件,提供的功能包括:配置维护.域名服务.分布式 ...

  9. JavaScript中的事件委托(转至大佬)

    转至:https://www.cnblogs.com/liugang-vip/p/5616484.html 起因: 1.这是前端面试的经典题型,要去找工作的小伙伴看看还是有帮助的: 2.其实我一直都没 ...

  10. 设计模式系列之组合模式(Composite Pattern)——树形结构的处理

    说明:设计模式系列文章是读刘伟所著<设计模式的艺术之道(软件开发人员内功修炼之道)>一书的阅读笔记.个人感觉这本书讲的不错,有兴趣推荐读一读.详细内容也可以看看此书作者的博客https:/ ...