application-dev.yml 5.1 KB

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