application-prod.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # 数据源配置
  2. spring:
  3. datasource:
  4. type: com.alibaba.druid.pool.DruidDataSource
  5. driver-class-name: com.mysql.cj.jdbc.Driver
  6. druid:
  7. master:
  8. url: jdbc:mysql://127.0.0.1:3306/znyun_meiye?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
  9. username: root
  10. password: password
  11. # 从库数据源
  12. slave:
  13. # 从数据源开关/默认关闭
  14. enabled: false
  15. url:
  16. username:
  17. password:
  18. # 初始连接数
  19. initialSize: 5
  20. # 最小连接池数量
  21. minIdle: 10
  22. # 最大连接池数量
  23. maxActive: 20
  24. # 配置获取连接等待超时的时间
  25. maxWait: 60000
  26. # 配置连接超时时间
  27. connectTimeout: 30000
  28. # 配置网络超时时间
  29. socketTimeout: 60000
  30. # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  31. timeBetweenEvictionRunsMillis: 60000
  32. # 配置一个连接在池中最小生存的时间,单位是毫秒
  33. minEvictableIdleTimeMillis: 300000
  34. # 配置一个连接在池中最大生存的时间,单位是毫秒
  35. maxEvictableIdleTimeMillis: 900000
  36. # 配置检测连接是否有效
  37. validationQuery: SELECT 1 FROM DUAL
  38. testWhileIdle: true
  39. testOnBorrow: false
  40. testOnReturn: false
  41. webStatFilter:
  42. enabled: true
  43. statViewServlet:
  44. enabled: true
  45. # 设置白名单,不填则允许所有访问
  46. allow:
  47. url-pattern: /druid/*
  48. # 控制台管理用户名和密码
  49. login-username:
  50. login-password:
  51. filter:
  52. stat:
  53. enabled: true
  54. # 慢SQL记录
  55. log-slow-sql: true
  56. slow-sql-millis: 1000
  57. merge-sql: true
  58. wall:
  59. config:
  60. multi-statement-allow: true
  61. redis:
  62. # 地址
  63. host: localhost
  64. # 端口,默认为6379
  65. port: 6379
  66. # 数据库索引
  67. database: 0
  68. # 密码
  69. password:
  70. # 连接超时时间
  71. timeout: 10s
  72. lettuce:
  73. pool:
  74. # 连接池中的最小空闲连接
  75. min-idle: 0
  76. # 连接池中的最大空闲连接
  77. max-idle: 8
  78. # 连接池的最大数据库连接数
  79. max-active: 8
  80. # #连接池最大阻塞等待时间(使用负值表示没有限制)
  81. max-wait: -1ms
  82. # Swagger配置
  83. swagger:
  84. # 是否开启swagger
  85. enabled: false
  86. # 请求前缀
  87. pathMapping:
  88. server:
  89. servlet:
  90. context-path: /prod-api
  91. # mybatis 配置
  92. mybatis-plus:
  93. # 配置sql打印日志
  94. configuration:
  95. log-impl: #org.apache.ibatis.logging.stdout.StdOutImpl