alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.93k stars 8.57k forks source link

DataSource health check failed #4048

Open 18670032796 opened 3 years ago

18670032796 commented 3 years ago

2020-11-18 16:22:12.382 WARN 16016 MsgId=[] [http-nio-9091-exec-21] o.s.b.a.jdbc.DataSourceHealthIndicator : DataSource health check failed

org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60000, active 50, maxActive 50, creating 0 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:324) at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.getProduct(DataSourceHealthIndicator.java:122)

archlevel commented 3 years ago

这个一般都是依赖包导致的,可以先查看包依赖关系;找到报错文件对应的包;然后剔除掉;

archlevel commented 3 years ago

+- cn.hutool:hutool-all:jar:5.6.0:compile [INFO] | +- org.redisson:redisson-spring-boot-starter:jar:3.15.1:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-actuator:jar:2.3.2.RELEASE:compile [INFO] | | | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.3.2.RELEASE:compile [INFO] | | | | - org.springframework.boot:spring-boot-actuator:jar:2.3.2.RELEASE:compile

org.springframework.boot:spring-boot-actuator:jar:2.3.2.RELEASE 这边版本的datasource的healthcheck的实现就会导致check失败

archlevel commented 3 years ago

[INFO] | +- org.redisson:redisson-spring-boot-starter:jar:3.15.1:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-actuator:jar:2.3.2.RELEASE:compile [INFO] | | | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.3.2.RELEASE:compile [INFO] | | | | - org.springframework.boot:spring-boot-actuator:jar:2.3.2.RELEASE:compile

org.springframework.boot:spring-boot-actuator:jar:2.3.2.RELEASE 这个版本的health check就会导致失败; 可以直接

org.redisson redisson-spring-boot-starter org.springframework.boot spring-boot-starter-actuator
wkaiwen commented 3 years ago

image

请指教,我理解的意思是将 spring-boot-starter-actuator 去除,我现在集成redison 报这个错,加上redisson-spring-boot-starter依赖去除actuator还是报同样的错