#################### 注册中心 + 配置中心相关配置 #################### spring: cloud: nacos: server-addr: 192.168.1.103:18848 # Nacos 服务器地址 username: # Nacos 账号 password: # Nacos 密码 discovery: # 【配置中心】配置项 namespace: dev # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP metadata: version: 1.0.0 # 服务实例的版本号,可用于灰度发布 config: # 【注册中心】配置项 namespace: dev # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP #################### 数据库相关配置 #################### # 数据源配置项 autoconfigure: exclude: datasource: druid: # Druid 【监控】相关的全局配置 web-stat-filter: enabled: true stat-view-servlet: enabled: true allow: # 设置白名单,不填则允许所有访问 url-pattern: /druid/* login-username: # 控制台管理用户名和密码 login-password: filter: stat: enabled: true log-slow-sql: true # 慢 SQL 记录 slow-sql-millis: 100 merge-sql: true wall: config: multi-statement-allow: true dynamic: # 多数据源配置 druid: # Druid 【连接池】相关的全局配置 initial-size: 5 # 初始连接数 min-idle: 10 # 最小连接池数量 max-active: 20 # 最大连接池数量 max-wait: 60000 # 配置获取连接等待超时的时间,单位:毫秒(1 分钟) time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒(1 分钟) min-evictable-idle-time-millis: 600000 # 配置一个连接在池中最小生存的时间,单位:毫秒(10 分钟) max-evictable-idle-time-millis: 1800000 # 配置一个连接在池中最大生存的时间,单位:毫秒(30 分钟) validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效 test-while-idle: true test-on-borrow: false test-on-return: false pool-prepared-statements: true # 是否开启 PreparedStatement 缓存 max-pool-prepared-statement-per-connection-size: 20 # 每个连接缓存的 PreparedStatement 数量 primary: master datasource: master: url: jdbc:mysql://192.168.1.22:13306/rdms_v3?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: njcnpqs # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: redis: host: 127.0.0.1 # 地址 port: 16379 # 端口 database: 1 # 数据库索引 # password: njcnpqs # 密码,建议生产环境开启 #################### 监控相关配置 #################### # Actuator 监控端点的配置项 management: endpoints: web: base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator exposure: include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 *,可以开放所有端点。 # 日志文件配置 logging: level: # 配置本模块 MyBatis Mapper 打印日志 com.njcn.rdms.module.project.dal.mysql: debug org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # RDMS 配置项,设置当前项目所有自定义的本地扩展配置 rdms: env: # 多环境的配置项 tag: ${HOSTNAME} captcha: enable: false security: mock-enable: true access-log: # 访问日志的配置项 enable: true