zoukankan      html  css  js  c++  java
  • RedisHealthIndicator : Health check failed Spring boot 启动报错,但不影响正常使用

    错误日志

    2021-01-22 17:54:51.568 [,] INFO  --- [main] o.s.b.c.e.t.TomcatEmbeddedServletContainer-201 : Tomcat started on port(s): 8503 (http)
    2021-01-22 17:54:51.574 [,] INFO  --- [main] com.posp.ui.WebUiApplication-57 : Started WebUiApplication in 14.305 seconds (JVM running for 14.728)
    2021-01-22 17:54:51.688 [,] WARN  --- [RMI TCP Connection(4)-127.0.0.1] o.s.b.a.health.RedisHealthIndicator-46 : Health check failed
    org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
    	at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:204)
    	

    原因: 项目配置了Spring 健康检查.

    spring boot启动之后,spring boot Actuator会对其进行健康检查,对redis检查并没有通过

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    解决方案:

    bootstrap.yml文件 中将自动健康检查关闭
    
    management:
      health:
        redis:
          enabled: false

    分析:估计是版本问题. 本地装一个redis,估计能通过检查.

    通过知识/经验的分享,节省开发者的时间.
  • 相关阅读:
    ios 统一设计,iOS6也玩扁平化
    iOS百度地图
    iOS 下载
    oracle 表连接
    ORACLE的执行计划
    oracle11g dataguard 完全手册(转)
    pl/sql 中F8执行单行sql
    Oracle AWR 报告详解
    Oracle执行计划详解
    oracle常用函数以及调用入参为record的存储过程的方法,
  • 原文地址:https://www.cnblogs.com/ysloong/p/14314705.html
Copyright © 2011-2022 走看看