application-dev.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # 数据源配置
  2. spring:
  3. datasource:
  4. type: com.alibaba.druid.pool.DruidDataSource
  5. driverClassName: com.mysql.cj.jdbc.Driver
  6. druid:
  7. # 主库数据源
  8. master:
  9. url: jdbc:mysql://localhost:3306/ai_master?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  10. username: root
  11. password: password
  12. hikari:
  13. pool-name: master-Pool
  14. # 从库数据源
  15. slave:
  16. # 从数据源开关/默认关闭
  17. url: jdbc:mysql://localhost:3306/tk-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  18. username: root
  19. password: password
  20. hikari:
  21. pool-name: slave-Pool
  22. # 初始连接数
  23. initialSize: 5
  24. # 最小连接池数量
  25. minIdle: 10
  26. # 最大连接池数量
  27. maxActive: 20
  28. # 配置获取连接等待超时的时间
  29. maxWait: 60000
  30. # 配置连接超时时间
  31. connectTimeout: 30000
  32. # 配置网络超时时间
  33. socketTimeout: 60000
  34. # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  35. timeBetweenEvictionRunsMillis: 60000
  36. # 配置一个连接在池中最小生存的时间,单位是毫秒
  37. minEvictableIdleTimeMillis: 300000
  38. # 配置一个连接在池中最大生存的时间,单位是毫秒
  39. maxEvictableIdleTimeMillis: 900000
  40. # 配置检测连接是否有效
  41. validationQuery: SELECT 1 FROM DUAL
  42. testWhileIdle: true
  43. testOnBorrow: false
  44. testOnReturn: false
  45. webStatFilter:
  46. enabled: true
  47. statViewServlet:
  48. enabled: true
  49. # 设置白名单,不填则允许所有访问
  50. allow:
  51. url-pattern: /druid/*
  52. # 控制台管理用户名和密码
  53. login-username: takai
  54. login-password: 123456
  55. filter:
  56. stat:
  57. enabled: true
  58. # 慢SQL记录
  59. log-slow-sql: true
  60. slow-sql-millis: 1000
  61. merge-sql: true
  62. wall:
  63. config:
  64. multi-statement-allow: true
  65. jpa:
  66. hibernate:
  67. ddl-auto: update
  68. show-sql: true
  69. properties:
  70. hibernate:
  71. dialect: org.hibernate.dialect.MySQL8Dialect
  72. format_sql: true