Cannot determine a partition to read for slot-------- springboot 项目连接Redis 集群报错

报错信息摘要提示如下:

io.lettuce.core.cluster.PartitionSelectorException:Cannot determine a partition to read for slot

原因

如提示: slot 没有重新分配到每个node节点,可能跟redis开启集群功能有关系

解决办法

  1. 检查每个节点的slot覆盖情况:
    进入redis安装目录下执行如下命令:

如出现以下结果:

Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
				>>> Performing Cluster Check (using node 10.113.197.5:6379)
				M: 87d66a4ca81b7abfd81b78bbfd2521691f9fbe09 10.113.197.5:6379
				   slots: (0 slots) master
				[OK] All nodes agree about slots configuration.
				>>> Check for open slots...
				>>> Check slots coverage...
				[ERR] Not all 16384 slots are covered by nodes.

说明该节点没有cover 所有slots 资源

  1. 修复node节点对slot资源的覆盖
    进入redis安装目录下执行如下命令:
 ./redis-cli --cluster fix IP:PORT -a password
  •  
  1. 重启项目,发现启动日志正常,没有报错

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值