码迷,mamicode.com
首页 > 编程语言 > 详细

RedisHealthIndicator : Health check failed Spring boot 启动报错,但不影响正常使用

时间:2021-01-25 10:51:55      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:tom   健康   pid   actor   can   pen   分析   jedis   nfa   

错误日志

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

 

RedisHealthIndicator : Health check failed Spring boot 启动报错,但不影响正常使用

标签:tom   健康   pid   actor   can   pen   分析   jedis   nfa   

原文地址:https://www.cnblogs.com/ysloong/p/14314705.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!