最近使用 MeterSphere 做接口测试时,平台页面偶尔会提示 SQL error happened,please check logs 错误!
MeterSphere 日志

查看日志可以看到 Connection is not available,错误信息,拿不到连接原因!


23-4-28 16:5:13,875 WARN cheduling.quartz.localatasourceobstore:3411 - Thi scheduler nstance (6269C845735d1681961808073) is stll activovered by another instance in the cluster. This may cause inconsistent behavior.
2023-04-28 16:05:50,465 ERRORorg.quartz.core.Errorlogger:2407 - An error occurred while scanning for the next triggers to fire.org.quartzJobPersistenceException: Failed to obtain DB comnction from data source "springlontxataource.apischeduler': java.sql.SL1ransientloption: DatebookHikaricp - Connection is not available, request timed out after 30000ms
at org.quartz.impl.jdbcjobstore.JobstoreCMT .getlonMlanagedtxConnection(JobstoreCMt.java:168)
at org .quartz .impl .jdbcjobstore.Jobstoresupport.executeInionManagedTXLock(JobstoreSupport., java: 3854)

解决方案:

进入 MeterSphere 安装目录

修改 metersphere.properties 文件,增加连接池配置

#  maximum-pool-size可以根据自己需求调大些
spring.datasource.hikari.maximum-pool-size=50 
spring.datasource.hikari.minimum-idle=10 
spring.datasource.hikari.idle-timeout=600000 

最后执行 msctl reload


↙↙↙阅读原文可查看相关链接,并与作者交流