application-druid.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. #dubbo配置
  2. spring:
  3. datasource:
  4. type: com.alibaba.druid.pool.DruidDataSource
  5. driverClassName: com.mysql.jdbc.Driver
  6. #url: jdbc:mysql://10.213.24.45:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
  7. url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
  8. username: root
  9. password: password
  10. # 初始化大小,最小,最大
  11. initialSize: 1
  12. minIdle: 3
  13. maxActive: 20
  14. # 配置获取连接等待超时的时间
  15. maxWait: 60000
  16. # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  17. timeBetweenEvictionRunsMillis: 60000
  18. # 配置一个连接在池中最小生存的时间,单位是毫秒
  19. minEvictableIdleTimeMillis: 30000
  20. validationQuery: select 'x'
  21. testWhileIdle: true
  22. testOnBorrow: false
  23. testOnReturn: false
  24. # 打开PSCache,并且指定每个连接上PSCache的大小
  25. poolPreparedStatements: true
  26. maxPoolPreparedStatementPerConnectionSize: 20
  27. # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
  28. filters: stat,wall,slf4j
  29. # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
  30. connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
  31. # 合并多个DruidDataSource的监控数据
  32. #useGlobalDataSourceStat: true