背景

就像上一篇所说,我使用了docker-componse启动了redis cluster集群。经过了一天的测试,本来测试已经完毕了,但是今天修改了点代码,再次测试的时候发现redis cluster起不来了。报错CLUSTERDOWN Hash slot not served。从这个错误提示,可以看出是slot分配原因造成的。上网找,真的蛋疼,你复制我,我复制你,最后还是得自己解决。

查看详细

banfushen@banfushen:~/redis-cluster$ redis-cli -p 16379
127.0.0.1:16379>
127.0.0.1:16379>
127.0.0.1:16379> CLUSTER info
cluster_state:fail
cluster_slots_assigned:0
cluster_slots_ok:0
cluster_slots_pfail:0
cluster_slots_fail:0
...
127.0.0.1:16379> CLUSTER SLOTS
Empty slot

直接修复

猜测就是slot分配的问题,进入具体container,重新分配slot

banfushen@banfushen:~/redis-cluster$ docker exec -it redis-node-0 /bin/bash
root@a77b8222eba2:/#
## 先查看命令
root@a77b8222eba2:/# redis-cli --cluster help
Cluster Manager Commands:create         host1:port1 ... hostN:portN--cluster-replicas <arg>check          host:port--cluster-search-multiple-ownersinfo           host:portfix            host:port--cluster-search-multiple-owners--cluster-fix-with-unreachable-mastersreshard        host:port--cluster-from <arg>--cluster-to <arg>--cluster-slots <arg>--cluster-yes--cluster-timeout <arg>--cluster-pipeline <arg>--cluster-replacerebalance      host:port--cluster-weight <node1=w1...nodeN=wN>--cluster-use-empty-masters--cluster-timeout <arg>--cluster-simulate--cluster-pipeline <arg>--cluster-threshold <arg>--cluster-replaceadd-node       new_host:new_port existing_host:existing_port--cluster-slave--cluster-master-id <arg>del-node       host:port node_idcall           host:port command arg arg .. arg--cluster-only-masters--cluster-only-replicasset-timeout    host:port millisecondsimport         host:port--cluster-from <arg>--cluster-from-user <arg>--cluster-from-pass <arg>--cluster-from-askpass--cluster-copy--cluster-replacebackup         host:port backup_directoryhelpFor check, fix, reshard, del-node, set-timeout you can specify the host and port of any working node in the cluster.Cluster Manager Options:--cluster-yes  Automatic yes to cluster commands prompts## 直接修复
root@a77b8222eba2:/# redis-cli --cluster fix --cluster-search-multiple-owners 127.0.0.1:6379
...
>>> Covering slot 694 with 192.168.88.3:6379
>>> Check for multiple slot owners...
[OK] No multiple owners found.
root@f3f2043dba55:/#
root@f3f2043dba55:/#
root@f3f2043dba55:/#
root@f3f2043dba55:/# redis-cli -p 6379
127.0.0.1:6379> 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:6
cluster_current_epoch:33
cluster_my_epoch:30
cluster_stats_messages_ping_sent:489
cluster_stats_messages_pong_sent:523
cluster_stats_messages_meet_sent:6
cluster_stats_messages_sent:1018
cluster_stats_messages_ping_received:523
cluster_stats_messages_pong_received:495
cluster_stats_messages_received:1018
127.0.0.1:6379> exit
root@f3f2043dba55:/# exit

docker 启动 redis cluster,使用出现CLUSTERDOWN Hash slot not served(redis cluster重新分配slot)相关推荐

  1. springboot搭建redis时提示RedisCommandExecutionException: CLUSTERDOWN Hash slot not served解决办法

    问题描述 今天在springboot上搭建redis时,发现了一个报错:Error in execution; nested exception is io.lettuce.core.RedisCom ...

  2. redis集群扩容和缩容_redis集群cluster搭建,扩容缩容

    1.    概要说明 1.1.    概述 本文旨在说明平台部署环境搭建的过程和详细步骤说明,为后面系统部署提供清晰的参考依照. 以下搭建部署的环境,为一个小型的分布式集群环境.满足负载均衡和单点故障 ...

  3. 阿里云下Redis集群报Waiting for the cluster to join...和CLUSTERDOWN Hash slot not served的坑(网上搜了好多没看到什么能基本解决的)

    1 修改etc下面的redis.conf 改成bind 0.0.0.0 如果改成阿里云下的Ip redis服务将开启不了 2.在阿里云下配置12个redis集群端口安全组 3.输入redis-cli ...

  4. Redis集群Hash槽分配异常 CLUSTERDOWN Hash slot not served的解决方式

    在搭建Redis5.x版本的集群环境出现各节点无法互相发现与Hash槽分配异常 CLUSTERDOWN Hash slot not served的情况 在Linux同一台服务器下搭建伪集群-- 127 ...

  5. Docker 启动Redis

    docker run \-d \-p 6379:6379 \--name redis \-v /home/cgt/redis/data:/data \-v /home/cgt/redis/redis. ...

  6. docker启动redis、并加载配置文件

    docker以配置文件的方式启动Redis,看似简单,其实暗藏杀机.填坑无数,let us look look. ◆◆Step:准备 redis.conf redis官网:https://redis. ...

  7. docker启动redis端口映射错误问题解决

    docker启动redis端口映射错误问题解决 参考文章: (1)docker启动redis端口映射错误问题解决 (2)https://www.cnblogs.com/wangxiayun/p/102 ...

  8. docker启动redis

    1. 下载redis镜像 先到docker官网搜索redis镜像版本 查看所有可用的redis镜像版本 想要使用哪个版本,点击复制对应的dockerpull命令即可 不指明redis镜像版本时,doc ...

  9. docker启动redis简单方法

    1.拉取redis镜像 docker pull redis 2.在本地某个位置创建以下内容 建议将以下内容放在一起,方便以后管理和查看 # 以/docker/redis为例 mkdir -p /doc ...

  10. docker 启动redis镜像

    docker 启动redis 镜像 1.启动单节点 1.拉取redis 镜像 docker pull redis:6.2 本次使用的版本号是6.2 可以直接 docker run redis:6.2 ...

最新文章

  1. Openssl生成证书流程
  2. 中国大学MOOC 计算机组成原理第3章 测试
  3. 上师大计算机学院分数线,分数低还想上师范大学?这4所师范院校,二本的分数就够了...
  4. 关于开源分布式事务中间件Fescar,我们总结了开发者关心的13个问题
  5. php unset数组,php unset 数组不管用
  6. 黑马博客——详细步骤(十二)项目功能的实现之文章评论和退出功能
  7. Python基础函数学习笔记(二)
  8. 每日算法系列【LeetCode 1004】最大连续1的个数 III
  9. php 智能输入提示插件,PHP结合jQuery.autocomplete插件实现输入自动完成提示的功能_PHP...
  10. x7 z8750 linux,x7-z8750 vs m3-7y30
  11. 龙格库塔解一阶微分方程c语言,四阶龙格库塔法解微分方程
  12. 语音视频自动生成字幕功能介绍
  13. mongodb4.4 windows环境安装
  14. JavaScript-- 基础知识面试题
  15. zabbix——分布式监控系统
  16. 一些vue功能和css样式
  17. Guava - Maps.difference
  18. 神奇的 Excel 插件:Azure DevOps 插件
  19. 网络拓扑abor.js库---力导向
  20. ubuntu下载谷歌云盘大文件

热门文章

  1. error: Microsoft Visual C++ 14.0 is required. Get it with “Build Tools for Visual Studio“: https://
  2. python 手机摄像头文字识别软件_手机上有哪些好用的文字识别工具?
  3. Ubuntu18.04更改图片尺寸和格式
  4. 10个Excel最经典的小技巧,关键时能救急!
  5. 世界各个国家或地区国际域名缩写(Countries and Regions)
  6. 模型评估与选择(后篇)-代价曲线
  7. PS(Photoshop)去水印的方法
  8. 健康,home? [java的内存浅析]
  9. 计算机的中mb b单位的关系,b、B、KB、MB、GB 的关系?
  10. paypal如何支付欧元_paypal海外支付流程是什么?paypal中国可以用吗?