数据库连接失败导致单个服务挂掉问题记录

        背景:

        ①测试环境单个服务挂掉,昨天还是好的,今天就挂了。

        ②测试环境使用数据库为开发环境数据库。

        排查问题:

        先是重启服务,无效。然后查看日志:

nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: 
Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: 
HikariPool-1 - Connection is not available, request timed out after 30000ms. 
### The error may exist in com/supconit/dm/mappers/LogicTableMapper.java (best guess) 
### The error may involve com.supconit.dm.mappers.LogicTableMapper.selectPage_mpCount 
### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: 
Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: 
HikariPool-1 - Connection is not available, request timed out after 30000ms.

        发现是连接不上数据库了,然后去服务器用测试环境ping开发环境,发现ping不通,由此得出问题是测试环境访问不到开发环境数据库。

        解决方法:

        使用测试环境数据库,将开发环境数据库数据迁移到测试环境。

        最后:

        至于为什么测试环境ping不通开发环境,不清楚什么原因导致网段不通,明明是同一个内网。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值