|
@@ -37,49 +37,27 @@ spring:
|
|
|
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
|
|
|
datasource:
|
|
|
type: com.alibaba.druid.pool.DruidDataSource
|
|
|
- # driverClassName: com.mysql.jdbc.Driver
|
|
|
- #druid连接池配置
|
|
|
+ #外网
|
|
|
+ url: jdbc:postgresql://10.81.3.151:5432/wisdom
|
|
|
+ username: gdprod
|
|
|
+ password: gd123
|
|
|
+ driver-class-name: org.postgresql.Driver
|
|
|
+ oracle-schema=:
|
|
|
+ # type: com.alibaba.druid.pool.DruidDataSource
|
|
|
+ # url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
|
|
|
+ # username: root
|
|
|
+ # password: root
|
|
|
+ # driver-class-name: com.mysql.jdbc.Driver
|
|
|
druid:
|
|
|
- #主库数据源
|
|
|
- master:
|
|
|
- url: jdbc:postgresql://10.81.3.151:5432/wisdom
|
|
|
- username: gdprod
|
|
|
- password: gd123
|
|
|
- driver-class-name: org.postgresql.Driver
|
|
|
- #备数据源 #关闭
|
|
|
- slave:
|
|
|
-# enabled: false
|
|
|
-# url: jdbc:mysql://localhost:3306/mysql?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=UTC
|
|
|
-# username: root
|
|
|
-# password: 123456
|
|
|
- #两票数据源
|
|
|
- ticket:
|
|
|
-# #url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
|
|
|
-# #url: jdbc:sqlserver://123.60.213.70:1434;DatabaseName=fdeam
|
|
|
-# url: jdbc:sqlserver://192.168.2.200:1434;DatabaseName=fdeamnew
|
|
|
-# username: sa
|
|
|
-# password: ibs
|
|
|
-# #password: Gd!123456
|
|
|
-# # password: Gyee@321#!
|
|
|
-# # password: ibs
|
|
|
-# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
|
|
- #配置初始化连接数大小
|
|
|
- initial-size: 10
|
|
|
- # 最大连接数
|
|
|
- max-active: 50
|
|
|
- #最小连接数
|
|
|
- min-idle: 10
|
|
|
- #获取连接等待超时时间
|
|
|
- max-wait: 5000
|
|
|
- pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
|
|
|
- max-pool-prepared-statement-per-connection-size: 20
|
|
|
- validation-query: SELECT 1 FROM DUAL
|
|
|
- validation-query-timeout: 20000
|
|
|
- test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
|
|
|
- test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
|
|
|
- test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
|
|
|
- time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
|
|
- min-evictable-idle-time-millis: 300000 #一个连接在池中最小生存的时间,单位是毫秒
|
|
|
+ max-active: 20
|
|
|
+ initial-size: 1
|
|
|
+ min-idle: 3
|
|
|
+ max-wait: 60000
|
|
|
+ time-between-eviction-runs-millis: 60000
|
|
|
+ min-evictable-idle-time-millis: 300000
|
|
|
+ test-while-idle: true
|
|
|
+ test-on-borrow: false
|
|
|
+ test-on-return: false
|
|
|
#StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
|
|
|
stat-view-servlet:
|
|
|
enabled: true
|