前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Jedis cluster模式连接出现No more cluster attempts left

Jedis cluster模式连接出现No more cluster attempts left

作者头像
DH镔
发布2023-10-21 11:50:24
1.5K0
发布2023-10-21 11:50:24
举报

# Jedis cluster模式连接出现No more cluster attempts left

同事在测试环境jedis cluster模式出现redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException: No more cluster attempts left.报错,找到我帮忙定位下问题

通过堆栈信息找到对应的源码位置redis.clients.jedis.JedisClusterCommand#runWithRetries

代码语言:javascript
复制
  private T runWithRetries(final int slot, int attempts, boolean tryRandomNode, JedisRedirectionException redirect) {
    if (attempts <= 0) {
      throw new JedisClusterMaxAttemptsException("No more cluster attempts left.");
    }
    ...
  }

从源码中分析得到,在测试attempts次之后就会抛出No more cluster attempts left的异常,根据源码下文有两种异常会导致重试

  • JedisConnectionException:连接redis出现异常
  • JedisRedirectionException:redis重定向会抛出的异常,比如MOVE

在对应的位置打上断点,运行出现问题的接口,出现以下报错

问题就很明显了,ERR Client sent AUTH, but no password is set,意思是项目配置设置了密码,但是这个redis节点没有设置密码,是运维的同学漏配置了

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • # Jedis cluster模式连接出现No more cluster attempts left
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档