如何解决Spring 执行器在启动过程中运行健康检查时出错:RedisReactiveHealthIndicator : Redis 健康检查失败
在 spring boot 升级到 2.2.11.RELEASE 后,我们看到以下错误。我认为第一次运行状况检查如果失败并出现以下错误,但是当我调用运行状况端点时,我看到运行状况检查成功。
2020-12-28 05:42:08.840 WARN 1 --- [oundedElastic-8] o.s.b.a.r.RedisReactiveHealthindicator:Redis 健康检查失败 org.springframework.data.redis.RedisConnectionFailureException:无法连接到Redis;嵌套异常是 io.lettuce.core.RedisConnectionException:无法连接到 xc-dev-redis.xylem-cloud.com:6379 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.translateException(LettuceConnectionFactory.java:1511) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1419) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1205) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1188) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedReactiveConnection(LettuceConnectionFactory.java:962) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:439) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:99) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 reactor.core.publisher.Monosupplier.subscribe(Monosupplier.java:56) ~[reactor-core-3.3.11.RELEASE.jar!/:3.3.11.RELEASE] 在 reactor.core.publisher.Mono.subscribe(Mono.java:4213) ~[reactor-core-3.3.11.RELEASE.jar!/:3.3.11.RELEASE] 在 reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.run(MonoSubscribeOn.java:124) ~[reactor-core-3.3.11.RELEASE.jar!/:3.3.11.RELEASE] 在 reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) ~[reactor-core-3.3.11.RELEASE.jar!/:3.3.11.RELEASE] 在 reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) ~[reactor-core-3.3.11.RELEASE.jar!/:3.3.11.RELEASE] 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_272] 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_272] 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_272] 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_272] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_272] 在 java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_272] 引起:io.lettuce.core.RedisConnectionException:无法连接到 xc-dev-redis.xylem-cloud.com:6379 在 io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:78) ~[lettuce-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE] 在 io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:56) ~[lettuce-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE] 在 io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:230) ~[lettuce-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE] 在 io.lettuce.core.RedisClient.connect(RedisClient.java:207) ~[lettuce-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE] 在 org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:115) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 java.util.Optional.orElseGet(Optional.java:267) ~[na:1.8.0_272] 在 org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:115) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] 在 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1417) ~[spring-data-redis-2.2.11.RELEASE.jar!/:2.2.11.RELEASE] ... 省略了 16 个常用帧 引起:java.lang.InterruptedException:null 在 java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:347) ~[na:1.8.0_272] 在 java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908) ~[na:1.8.0_272] 在 io.lettuce.core.DefaultConnectionFuture.get(DefaultConnectionFuture.java:68) ~[lettuce-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE] 在 io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:227) ~[lettuce-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE] ...省略了21个常用帧
这是来自健康端点的响应:
{
"status": "UP","components": {
"clientconfigserver": {
"status": "UNKNowN","details": {
"error": "no property sources located"
}
},"discoveryComposite": {
"description": "discovery Client not initialized","status": "UNKNowN","components": {
"discoveryClient": {
"description": "discovery Client not initialized","status": "UNKNowN"
}
}
},"diskSpace": {
"status": "UP","details": {
"total": 536858308608,"free": 463599861760,"threshold": 10485760
}
},"hystrix": {
"status": "UP"
},"kubernetes": {
"status": "UP","details": {
"inside": true,"namespace": "dev","podName": "xc-api-gateway-647d8c4f5f-sfqx4","podIp": "10.16.64.36","serviceAccount": "default","nodeName": "ip-10-16-64-163.ec2.internal","hostIp": "10.16.64.163","labels": {
"app": "xc-api-gateway","draft": "draft-app","pod-template-hash": "647d8c4f5f"
}
}
},"ping": {
"status": "UP"
},"reactivediscoveryClients": {
"description": "discovery Client not initialized","components": {
"Kubernetes Reactive discovery Client": {
"description": "discovery Client not initialized","status": "UNKNowN"
},"Simple Reactive discovery Client": {
"description": "discovery Client not initialized","redis": {
"status": "UP","details": {
"version": "5.0.5"
}
},"refreshScope": {
"status": "UP"
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。