application-pro.yml 2.5 KB

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