项目上线后 ,系统每运行一个小时左右就宕机了。提示获取数据库链接超时。
2021-01-06 21:25:56.991 DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Creating new transaction with name [com.minstone.instance.api.api.WorkApiImpl.getWorkFlowCountByType]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
[2800] namenullstart create connection by thread:poolingCount=0notEmptyWaitThreadCount1url = jdbc:oracle:thin:@//172.18.201.50:1521/lzmis
[1651] 开始创建数据库连接 url =jdbc:oracle:thin:@//172.18.201.50:1521/lzmisdatasource id = 77 getProxyFilters().size() = 0
2021-01-06 21:25:57.001 WARN com.alibaba.druid.pool.DruidDataSource - get connection timeout retry : 1
2021-01-06 21:25:57.011 ERROR com.alibaba.dubbo.rpc.filter.ExceptionFilter - [DUBBO] Got unchecked and undeclared exception which called by 172.18.18.30. service: com.minstone.instance.api.service.IWorkApi, method: getWorkFlowCountByType, exception: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 10, active 1, maxActive 1000, creating 1, createElapseMillis 20, dubbo version: 2.5.8, current host: 192.168.122.1
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 10, active 1, maxActive 1000, creating 1, createElapseMillis 20
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:245)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:430)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
后面修改druid源码,获取链接用了几十秒,都卡住了。
最后发现是服务器dns配置导致的,修改服务器dns ,问题解决了