Closed vieyahn2017 closed 1 year ago
实现
SpringBoot 1.5.9
druid-spring-boot-starter 1.1.10
的时候的样例
spring:
# application:
# name: idf
datasource:
druid:
da:
url: jdbc:postgresql://8.6.5.8:20345/da
username: user
password: p7qWMt+9dZvnLK1gSXnS28LVUewwwwwwwwwwwwwwwwwwwwwwF7xzGHTFrDw==
connectionProperties: config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIweeeeeeeeeeeeeeeeeeeeeeeee/hmrSoOsubNjc4pxtN25K7Wmn84Q1JD/VAEIPK8CAwEAAQ==
driver_class_name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
ds:
url: jdbc:postgresql://8.6.5.8:20345/db
username: users
password: t1qj41szv60Q2fqtDNSMEhlrrrrrrrrrrrrrrrrrM2wsdKo22WLJ8HRY3lw==
connectionProperties: config.decrypt=true;config.decrypt.key=MFwwDQYJKrrrrrrrrrrrrrrrrrrrrrrrrrAjtiM6WJ/+/m5dAcXFMz4Nx2m4EGPruJHjt6f8gMswkkCAwEAAQ==
driver_class_name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
db:
url: jdbc:postgresql://8.6.5.8:20345/db
username: user
password: Lo5KeFf+YRjpz/6rrrrrrrrrrrrrrrrrrrrrrrrrroTKmewU9Gj8Q+QgtChw==
connectionProperties: config.decrypt=true;config.decrypt.key=MFwwDrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrtrrrrrrrb/BrnGyCJ3LLrSNn7wDf0UCAwEAAQ==
driver_class_name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: config,stat,wall
maxActive: 30
initialSize: 1
maxWait: 60000
minIdle: 3
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 100
升级到SpringBoot 2.0.4
druid-spring-boot-starter 1.1.10
的时候的样例
不兼容之前的通用设置了
spring:
# application:
# name: idf
datasource:
druid:
da:
url: jdbc:postgresql://8.6.5.8:20345/da
username: user
password: p7qWMt+9dZvnLK1gSXnS28LVUewwwwwwwwwwwwwwwwwwwwwwF7xzGHTFrDw==
connectionProperties: config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIweeeeeeeeeeeeeeeeeeeeeeeee/hmrSoOsubNjc4pxtN25K7Wmn84Q1JD/VAEIPK8CAwEAAQ==
driver_class_name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: config,stat,wall
maxActive: 30
initialSize: 1
maxWait: 60000
minIdle: 3
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 100
ds:
url: jdbc:postgresql://8.6.5.8:20345/db
username: users
password: t1qj41szv60Q2fqtDNSMEhlrrrrrrrrrrrrrrrrrM2wsdKo22WLJ8HRY3lw==
connectionProperties: config.decrypt=true;config.decrypt.key=MFwwDQYJKrrrrrrrrrrrrrrrrrrrrrrrrrAjtiM6WJ/+/m5dAcXFMz4Nx2m4EGPruJHjt6f8gMswkkCAwEAAQ==
driver_class_name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: config,stat,wall
maxActive: 30
initialSize: 1
maxWait: 60000
minIdle: 3
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 100
db:
url: jdbc:postgresql://8.6.5.8:20345/db
username: user
password: Lo5KeFf+YRjpz/6rrrrrrrrrrrrrrrrrrrrrrrrrroTKmewU9Gj8Q+QgtChw==
connectionProperties: config.decrypt=true;config.decrypt.key=MFwwDrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrtrrrrrrrb/BrnGyCJ3LLrSNn7wDf0UCAwEAAQ==
driver_class_name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: config,stat,wall
maxActive: 30
initialSize: 1
maxWait: 60000
minIdle: 3
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 100
2019.2.25这个问题,排查了好久
https://blog.csdn.net/liuxiao723846/article/details/80463842 spring-boot整合mybatis和druid连接池(多数据源+动态数据源)