一次登录接口502问题排查过程

概述

突然发现测试环境登录失败,api/login/captcha接口报错502
在这里插入图片描述
第一反应是去查看日志:

com.aaa.cachecloud.redis.clients.jedis.exceptions.JedisClusterMaxRedirectionsException: Too many Cluster redirections? key=59cdc8a2-a589-4381-aee9-f09c8d5650c8
at com.aaa.cachecloud.redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:101)
	at com.aaa.cachecloud.redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:138)
	at com.aaa.cachecloud.redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:159)
	at com.aaa.cachecloud.redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:138)
	at com.aaa.cachecloud.redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:159)
	at com.aaa.cachecloud.redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:138)
	at com.aaa.cachecloud.redis.clients.jedis.JedisClusterCommand.run(JedisClusterCommand.java:34)
	at com.aaa.cachecloud.redis.clients.jedis.JedisCluster.exists(JedisCluster.java:130)
	at com.aaa.cachecloud.builder.RedisClusterBuilder.exists(RedisClusterBuilder.java:273)
	at com.xy.cloudiview.common.util.RedisTool.delKey(RedisTool.java:41)
	at com.xy.cloudiview.web.controller.LoginController.checkCaptcha(LoginController.java:126)

也没有细看日志报错。以为登录失败和Redis,即cachecloud有关。

另外,作为背景知识,cachecloud有一个appId的概念,不同的应用,使用不同的appId。公司基于开源cachecloud二次开发的Redis组件,使用下来,没有appId隔离的概念,也没有鉴权这一说法。即,如果我的应用使用别的应用的appId,不影响我在别的应用下存储与读取数据;在连接cachecloud server时,不需要用户名/密码。

所以如果配置错误的cachecloud appId,会发生请求转发与重试?故而错误日志里面有:多次runWithRetries方法,最后爆出JedisClusterMaxRedirectionsException异常。

检查cachecloud appId配置。最后还是有问题。

咨询研发同学。给出的答复是:网络等各种原因导致更新slot信息失败,可能慢查询比较多, 阻塞。

没能给出满意的答复,也解决不了我的问题。

另外,在排查的过程中,发现后面并没有记录日志,且上面日志的报错接口是api/login/checkCaptcha,并不是api/login/captcha

因此,和cachecloud appId无关。。

继续排查,
在这里插入图片描述
怀疑和nginx有关。

Jenkins的构建配置:

export JAVA_HOME=/usr/local/java
jar_name=cloud-iview-web.jar
echo '### 创建目录, ###'
Remote_Directory=/www/iview.ppdaiapi.com
Cur_Date=$(date "+%Y%m%d%H%M%S")
mkdir -p ${Remote_Directory}/release/${Cur_Date}
cd ${Remote_Directory}/release/${Cur_Date}
mv ../../${jar_name} ${Remote_Directory}/release/${Cur_Date}
cd ../../
rm -rf  current
ln -s ${Remote_Directory}/release/${Cur_Date} current
cd ${Remote_Directory}/release/${Cur_Date}/
# kill -9 $(ps -ef|grep ${jar_name} | gawk '$0 !~/grep/ {print $2}' |tr -s '\n' ' ')
kill -9 `lsof -nP -iTCP:8060 |grep LISTEN|awk '{print $2;}'`
sleep 5
echo '### 启动jar包 ###'
nohup ${JAVA_HOME}/bin/java -jar ${jar_name} --server.port=8060 --spring.profiles.active=test > output 2>&1 &
#只保留5个版本记录
cd ${Remote_Directory}/release/
filenum=5
filecount=$(ls |grep 20|wc -l)
if [ ${filecount} -gt ${filenum} ];then
    ls | sed -n "1,$[${filecount} - ${filenum}]p" | xargs rm -rf
    echo “删除历史版本成功”
fi

删除Apollo配置之后,并不能生效,因为应用已经启动,是通过命令行的方式启动,

必须再重新构建一次应用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

johnny233

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值