application-prd.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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://127.0.0.1:3306/chat_deepseek?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  10. username: root
  11. password: Lx304307910
  12. # 从库数据源
  13. slave:
  14. # 从数据源开关/默认关闭
  15. url: jdbc:mysql://127.0.0.1:3306/chat_zhipu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  16. username: root
  17. password: Lx304307910
  18. # 初始连接数
  19. initialSize: 5
  20. # 最小连接池数量
  21. minIdle: 10
  22. # 最大连接池数量
  23. maxActive: 200
  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: takai
  50. login-password: 123456
  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. jpa:
  62. hibernate:
  63. ddl-auto: update
  64. show-sql: true
  65. properties:
  66. hibernate:
  67. dialect: org.hibernate.dialect.MySQL8Dialect
  68. format_sql: true
  69. # 日志配置
  70. logging:
  71. level:
  72. com.takai: info
  73. org.springframework: warn