1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- server:
- port: 16063
- book:
- debug: true
- redis:
- host: 121.41.100.198
- port: 6379
- database: 0
- password: wrfg6OTNaXTqd96H7TK7bYIV
- timeout: 1000 # 数据库连接超时时间,2.0 中该参数的类型为Duration,这里在配置的时候需要指明单位
- # 最大空闲连接数
- maxIdle: 500
- # 最小空闲连接数
- minIdle: 50
- # 等待可用连接的最大时间,负数为不限制
- maxWait: -1
- # 最大活跃连接数,负数为不限制
- maxActive: -1
- # 最大连接数
- spring:
- datasource:
- type: com.alibaba.druid.pool.DruidDataSource
- driver-class-name: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://121.41.100.198:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
- username: root
- password: root
- #下面为连接池补充设置
- druid:
- initial-size: 5 # 初始化
- max-active: 5 # 最大
- min-idle: 5 # 最小
- max-wait: 6000 # 超时时间
- time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
- min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
- # 检测链接是否有效的query
- validation-query: SELECT 1 FROM DUAL
- test-while-idle: true # 检测到链接空闲时,验证是否有效
- test-on-borrow: false # 申请链接时,不检测
- test-on-return: false # 返回链接时,不检测
- pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
- # 如果上面开启了游标,这里要设置一下大小,例如 50
- max-pool-prepared-statement-per-connection-size: -1
- # 统计、监控配置
- filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
- # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
- connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
- use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
- stat-view-servlet:
- enabled: true
- login-username: tianyun
- login-password: tianyunperfect
- allow: # 默认运行所有
- deny: # 默认即可
- reset-enable: true
- mybatis:
- type-aliases-package: com.book.server.entity
- mapper-locations: classpath:mapper/*Mapper.xml
- # 设置debug模式下打印mysql
- logging:
- level:
- com:
- book:
- server:
- mapper: debug
|