|
@@ -6,7 +6,7 @@ spring:
|
|
|
druid:
|
|
|
# 主库数据源
|
|
|
master:
|
|
|
- url: jdbc:mysql://10.161.12.47:3306/hazard?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
|
|
+ url: jdbc:mysql://10.161.12.47:3306/hazard?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&connectTimeout=30000&socketTimeout=60000
|
|
|
username: root
|
|
|
password: UTA1hcycRtgD0c7Y
|
|
|
# 从库数据源
|
|
@@ -25,15 +25,15 @@ spring:
|
|
|
# 配置获取连接等待超时的时间
|
|
|
maxWait: 60000
|
|
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
|
|
- timeBetweenEvictionRunsMillis: 60000
|
|
|
+ timeBetweenEvictionRunsMillis: 30000
|
|
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
|
|
- minEvictableIdleTimeMillis: 300000
|
|
|
+ minEvictableIdleTimeMillis: 180000
|
|
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
|
|
- maxEvictableIdleTimeMillis: 900000
|
|
|
+ maxEvictableIdleTimeMillis: 360000
|
|
|
# 配置检测连接是否有效
|
|
|
validationQuery: SELECT 1 FROM DUAL
|
|
|
testWhileIdle: true
|
|
|
- testOnBorrow: false
|
|
|
+ testOnBorrow: true
|
|
|
testOnReturn: false
|
|
|
webStatFilter:
|
|
|
enabled: true
|