- 异常时连不上redis, 但是telnet redis的端口都是通的
- 另一个服务连接的时同一套redis是正常的
- 查看redis的状态也是正常的
- 仔细观察异常
at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:72)
at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:56)
at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:234)
at io.lettuce.core.RedisClient.connect(RedisClient.java:207)
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:115)
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider$$Lambda$985/1982099830.get(Unknown Source)
at java.util.Optional.orElseGet(Optional.java:267)
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:115)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1198)
异常中StandaloneConnectionProvider发现时单机的连接怀疑应用jar的配置问题
打开果然里面配置了单机redis,而apollo上配置的时sentinel模式,随后删除本地
配置重新打包发布redis连接正常。