You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
6.2 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. --- #################### 注册中心 + 配置中心相关配置 ####################
  2. spring:
  3. cloud:
  4. nacos:
  5. server-addr: 47.105.52.65:8848 # Nacos 服务器地址
  6. username: nacos # Nacos 账号
  7. password: Yyjh2025 # Nacos 密码
  8. discovery: # 【配置中心】配置项
  9. namespace: dev # 命名空间。这里使用 dev 开发环境
  10. group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
  11. metadata:
  12. version: 1.0.0 # 服务实例的版本号,可用于灰度发布
  13. config: # 【注册中心】配置项
  14. namespace: dev # 命名空间。这里使用 dev 开发环境
  15. group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
  16. --- #################### 数据库相关配置 ####################
  17. spring:
  18. # 数据源配置项
  19. autoconfigure:
  20. exclude:
  21. - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
  22. - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
  23. datasource:
  24. druid: # Druid 【监控】相关的全局配置
  25. web-stat-filter:
  26. enabled: true
  27. stat-view-servlet:
  28. enabled: true
  29. allow: # 设置白名单,不填则允许所有访问
  30. url-pattern: /druid/*
  31. login-username: # 控制台管理用户名和密码
  32. login-password:
  33. filter:
  34. stat:
  35. enabled: true
  36. log-slow-sql: true # 慢 SQL 记录
  37. slow-sql-millis: 100
  38. merge-sql: true
  39. wall:
  40. config:
  41. multi-statement-allow: true
  42. dynamic: # 多数据源配置
  43. druid: # Druid 【连接池】相关的全局配置
  44. initial-size: 1 # 初始连接数
  45. min-idle: 1 # 最小连接池数量
  46. max-active: 20 # 最大连接池数量
  47. max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
  48. time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
  49. min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
  50. max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
  51. validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
  52. test-while-idle: true
  53. test-on-borrow: false
  54. test-on-return: false
  55. primary: master
  56. datasource:
  57. master:
  58. url: jdbc:mysql://47.104.144.223:34306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
  59. # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
  60. # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
  61. # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
  62. # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例
  63. # url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
  64. username: root
  65. password: rootWHJ2018
  66. # username: sa # SQL Server 连接的示例
  67. # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
  68. # username: SYSDBA # DM 连接的示例
  69. # password: SYSDBA # DM 连接的示例
  70. slave: # 模拟从库,可根据自己需要修改
  71. lazy: true # 开启懒加载,保证启动速度
  72. url: jdbc:mysql://47.104.144.223:34306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
  73. username: root
  74. password: rootWHJ2018
  75. # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
  76. redis:
  77. host: 47.105.52.65 # 地址
  78. port: 9100 # 端口
  79. database: 0 # 数据库索引
  80. password: Jj2021WhjHjkj # 密码,建议生产环境开启
  81. --- #################### MQ 消息队列相关配置 ####################
  82. --- #################### 定时任务相关配置 ####################
  83. xxl:
  84. job:
  85. enabled: false # 是否开启调度中心,默认为 true 开启
  86. admin:
  87. addresses: http://139.129.20.34:8178/xxl-job-admin # 调度中心部署跟地址
  88. --- #################### 服务保障相关配置 ####################
  89. # Lock4j 配置项
  90. lock4j:
  91. acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
  92. expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
  93. --- #################### 监控相关配置 ####################
  94. # Actuator 监控端点的配置项
  95. management:
  96. endpoints:
  97. web:
  98. base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
  99. exposure:
  100. include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
  101. # Spring Boot Admin 配置项
  102. spring:
  103. boot:
  104. admin:
  105. # Spring Boot Admin Client 客户端的相关配置
  106. client:
  107. instance:
  108. service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
  109. # 日志文件配置
  110. logging:
  111. level:
  112. # 配置自己写的 MyBatis Mapper 打印日志
  113. cn.iocoder.yudao.module.report.dal.mysql: debug
  114. org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
  115. --- #################### 芋道相关配置 ####################
  116. # 芋道配置项,设置当前项目所有自定义的配置
  117. yudao:
  118. env: # 多环境的配置项
  119. tag: ${HOSTNAME}
  120. security:
  121. mock-enable: true
  122. access-log: # 访问日志的配置项
  123. enable: false