plz
jxct1oxe1#
spring:datasource:name: testdburl: jdbc:mysql://172.16.5.23:3306/vp_common_config?useUnicode=true&characterEncoding=utf-8username: rootpassword: 'mQO7NpV1ohNjA37/xSIsNCIlVY4woR+zuAyeD3dBPpwcUX75gsZbvJftqhtpESDvItn6MUlJwrAAsi5+65fySQ=='
type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.jdbc.DrivermaxActive: 20initialSize: 1maxWait: 28800minIdle: 1timeBetweenEvictionRunsMillis: 60000minEvictableIdleTimeMillis: 3000validationQuery: select 'x'testWhileIdle: truetestOnBorrow: truetestOnReturn: falsepoolPreparedStatements: truemaxOpenPreparedStatements: 20
filters: config,stat,wall,log4jconnectionProperties: "config.decrypt=true;druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000"useGlobalDataSourceStat: true
data:mongodb:host: 172.16.45.3port: 27017
redis:database: 0host: 172.16.45.3
port: 6379 timeout: 30000 pool: max-idle: 8 min-idle: 0 max-active: 8 max-wait: -1
x33g5p2x2#
我使用springboot1.4.1,发现spring.datasource. filters无法被自动配置, 打开监控页面的数据源查看,发现filters一项为空。 如果我改成javaconfig方式,@bean一个DruidDataSource并且setFilters才成功使用stat等插件。另外initialSize、maxActive...这些参数也无法被springboot设置。请问问题出在那里?
8ftvxx2r3#
spring boot 哪个版本 确定连接池那些配置会生效?
3条答案
按热度按时间jxct1oxe1#
application properties
spring:
datasource:
name: testdb
url: jdbc:mysql://172.16.5.23:3306/vp_common_config?useUnicode=true&characterEncoding=utf-8
username: root
password: 'mQO7NpV1ohNjA37/xSIsNCIlVY4woR+zuAyeD3dBPpwcUX75gsZbvJftqhtpESDvItn6MUlJwrAAsi5+65fySQ=='
using druid data source
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
maxActive: 20
initialSize: 1
maxWait: 28800
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 3000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: true
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
encrypt password
filters: config,stat,wall,log4j
connectionProperties: "config.decrypt=true;druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000"
useGlobalDataSourceStat: true
data:
mongodb:
host: 172.16.45.3
port: 27017
redis:
database: 0
host: 172.16.45.3
password: 'traffic.prod'
x33g5p2x2#
我使用springboot1.4.1,发现spring.datasource. filters无法被自动配置, 打开监控页面的数据源查看,发现filters一项为空。 如果我改成javaconfig方式,@bean一个DruidDataSource并且setFilters才成功使用stat等插件。另外initialSize、maxActive...这些参数也无法被springboot设置。请问问题出在那里?
8ftvxx2r3#
spring boot 哪个版本 确定连接池那些配置会生效?