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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...