application-dev.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. --- # 监控配置
  2. spring:
  3. boot:
  4. admin:
  5. # Spring Boot Admin Client 客户端的相关配置
  6. client:
  7. # 增加客户端开关
  8. enabled: true
  9. # 设置 Spring Boot Admin Server 地址
  10. url: http://localhost:9090/admin
  11. instance:
  12. service-host-type: IP
  13. username: ruoyi
  14. password: 123456
  15. --- # xxl-job 配置
  16. xxl:
  17. job:
  18. # 执行器开关
  19. enabled: true
  20. # 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
  21. admin-addresses: http://localhost:9100/xxl-job-admin
  22. # 执行器通讯TOKEN:非空时启用
  23. access-token: xxl-job
  24. # 执行器配置
  25. executor:
  26. # 执行器AppName:执行器心跳注册分组依据;为空则关闭自动注册
  27. appname: xxl-job-executor
  28. # 执行器端口号 执行器从9101开始往后写
  29. port: 9101
  30. # 执行器注册:默认IP:PORT
  31. address:
  32. # 执行器IP:默认自动获取IP
  33. ip:
  34. # 执行器运行日志文件存储磁盘路径
  35. logpath: ./logs/xxl-job
  36. # 执行器日志文件保存天数:大于3生效
  37. logretentiondays: 30
  38. --- # 数据源配置
  39. spring:
  40. datasource:
  41. type: com.alibaba.druid.pool.DruidDataSource
  42. # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
  43. dynamic:
  44. # 性能分析插件(有性能损耗 不建议生产环境使用)
  45. p6spy: true
  46. # 设置默认的数据源或者数据源组,默认值即为 master
  47. primary: master
  48. # 严格模式 匹配不到数据源则报错
  49. strict: true
  50. datasource:
  51. # 主库数据源
  52. master:
  53. driverClassName: com.mysql.cj.jdbc.Driver
  54. # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
  55. # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
  56. url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
  57. username: root
  58. password: root
  59. # 从库数据源
  60. slave:
  61. lazy: true
  62. driverClassName: com.mysql.cj.jdbc.Driver
  63. url:
  64. username:
  65. password:
  66. # oracle:
  67. # driverClassName: oracle.jdbc.OracleDriver
  68. # url: jdbc:oracle:thin:@//localhost:1521/XE
  69. # username: ROOT
  70. # password: root
  71. # druid:
  72. # validationQuery: SELECT 1 FROM DUAL
  73. # postgres:
  74. # driverClassName: org.postgresql.Driver
  75. # url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
  76. # username: root
  77. # password: root
  78. # sqlserver:
  79. # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
  80. # url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;rewriteBatchedStatements=true
  81. # username: SA
  82. # password: root
  83. druid:
  84. # 初始连接数
  85. initialSize: 5
  86. # 最小连接池数量
  87. minIdle: 10
  88. # 最大连接池数量
  89. maxActive: 20
  90. # 配置获取连接等待超时的时间
  91. maxWait: 60000
  92. # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  93. timeBetweenEvictionRunsMillis: 60000
  94. # 配置一个连接在池中最小生存的时间,单位是毫秒
  95. minEvictableIdleTimeMillis: 300000
  96. # 配置一个连接在池中最大生存的时间,单位是毫秒
  97. maxEvictableIdleTimeMillis: 900000
  98. # 配置检测连接是否有效
  99. validationQuery: SELECT 1
  100. testWhileIdle: true
  101. testOnBorrow: false
  102. testOnReturn: false
  103. # 注意这个值和druid原生不一致,默认启动了stat
  104. filters: stat
  105. --- # druid 配置
  106. spring:
  107. datasource:
  108. druid:
  109. webStatFilter:
  110. enabled: true
  111. statViewServlet:
  112. enabled: true
  113. # 设置白名单,不填则允许所有访问
  114. allow:
  115. url-pattern: /druid/*
  116. # 控制台管理用户名和密码
  117. login-username: ruoyi
  118. login-password: 123456
  119. filter:
  120. stat:
  121. enabled: true
  122. # 慢SQL记录
  123. log-slow-sql: true
  124. slow-sql-millis: 1000
  125. merge-sql: true
  126. wall:
  127. config:
  128. multi-statement-allow: true
  129. --- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
  130. spring:
  131. redis:
  132. # 地址
  133. host: localhost
  134. # 端口,默认为6379
  135. port: 6379
  136. # 数据库索引
  137. database: 0
  138. # 密码
  139. password:
  140. # 连接超时时间
  141. timeout: 10s
  142. # 是否开启ssl
  143. ssl: false
  144. redisson:
  145. # 线程池数量
  146. threads: 4
  147. # Netty线程池数量
  148. nettyThreads: 8
  149. # 传输模式
  150. transportMode: "NIO"
  151. # 单节点配置
  152. singleServerConfig:
  153. # 客户端名称
  154. clientName: ${ruoyi.name}
  155. # 最小空闲连接数
  156. connectionMinimumIdleSize: 8
  157. # 连接池大小
  158. connectionPoolSize: 32
  159. # 连接空闲超时,单位:毫秒
  160. idleConnectionTimeout: 10000
  161. # 命令等待超时,单位:毫秒
  162. timeout: 3000
  163. # 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
  164. retryAttempts: 3
  165. # 命令重试发送时间间隔,单位:毫秒
  166. retryInterval: 1500
  167. # 发布和订阅连接池大小
  168. subscriptionConnectionPoolSize: 50