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,估计能通过检查.

    通过知识/经验的分享,节省开发者的时间.
  • 相关阅读:
    MySQL基础之排序检索数据
    网络编程之并发网络编程
    网络编程之粘包问题
    MySQL基础之检索数据
    MySQL基础之使用MySQL
    MySQL基础之MySQL简介
    MySQL基础之了解MySQL
    网络编程之socket编程
    网络编程之网络通信原理
    别找了,最全的搜集关键词方法在这里
  • 原文地址:https://www.cnblogs.com/ysloong/p/14314705.html
Copyright © 2011-2022 走看看