Spring 执行器在启动过程中运行健康检查时出错:RedisReactiveHealthIndicator : Redis 健康检查失败

时间:2020-12-28 06:30:43

标签: spring-boot spring-boot-actuator spring-data-redis spring-data-redis-reactive spring-actuator

在 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",
            "status": "UNKNOWN",
            "components": {
                "Kubernetes Reactive Discovery Client": {
                    "description": "Discovery Client not initialized",
                    "status": "UNKNOWN"
                },
                "Simple Reactive Discovery Client": {
                    "description": "Discovery Client not initialized",
                    "status": "UNKNOWN"
                }
            }
        },
        "redis": {
            "status": "UP",
            "details": {
                "version": "5.0.5"
            }
        },
        "refreshScope": {
            "status": "UP"
        }
    }
}

0 个答案:

没有答案