mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 21:32:07 +08:00
188 lines
7.4 KiB
YAML
188 lines
7.4 KiB
YAML
--- #################### 注册中心 + 配置中心相关配置 ####################
|
|
|
|
spring:
|
|
cloud:
|
|
nacos:
|
|
server-addr: 192.168.1.205:8848 # 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
|
|
|
|
--- #################### 数据库相关配置 ####################
|
|
spring:
|
|
# 数据源配置项
|
|
autoconfigure:
|
|
exclude:
|
|
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
|
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: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
|
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
|
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
|
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
|
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
|
test-while-idle: true
|
|
test-on-borrow: false
|
|
test-on-return: false
|
|
primary: master
|
|
datasource:
|
|
master:
|
|
name: imes_base
|
|
url: jdbc:mysql://192.168.1.205:3307/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
username: root
|
|
password: root
|
|
|
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
|
data:
|
|
redis:
|
|
host: 192.168.1.205 # 地址
|
|
port: 6379 # 端口
|
|
database: 1 # 数据库索引
|
|
password: cf@2024 # 密码,建议生产环境开启
|
|
|
|
--- #################### MQ 消息队列相关配置 ####################
|
|
|
|
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
|
rocketmq:
|
|
name-server: 127.0.0.1:9876 # RocketMQ Namesrv
|
|
|
|
spring:
|
|
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
|
rabbitmq:
|
|
host: 127.0.0.1 # RabbitMQ 服务的地址
|
|
port: 5672 # RabbitMQ 服务的端口
|
|
username: guest # RabbitMQ 服务的账号
|
|
password: guest # RabbitMQ 服务的密码
|
|
# Kafka 配置项,对应 KafkaProperties 配置类
|
|
kafka:
|
|
bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔
|
|
|
|
--- #################### 定时任务相关配置 ####################
|
|
xxl:
|
|
job:
|
|
enabled: false
|
|
admin:
|
|
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
|
|
|
--- #################### 服务保障相关配置 ####################
|
|
|
|
# Lock4j 配置项
|
|
lock4j:
|
|
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
|
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
|
|
|
--- #################### 监控相关配置 ####################
|
|
|
|
# Actuator 监控端点的配置项
|
|
management:
|
|
endpoints:
|
|
web:
|
|
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
|
exposure:
|
|
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
|
|
|
# Spring Boot Admin 配置项
|
|
spring:
|
|
boot:
|
|
admin:
|
|
# Spring Boot Admin Client 客户端的相关配置
|
|
client:
|
|
instance:
|
|
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
|
# Spring Boot Admin Server 服务端的相关配置
|
|
context-path: /admin # 配置 Spring
|
|
|
|
--- #################### 晨丰相关配置 ####################
|
|
|
|
# 晨丰配置项,设置当前项目所有自定义的配置
|
|
chenfeng:
|
|
info:
|
|
version: 1.0.0
|
|
base-package: com.cf.imes.module.infra
|
|
web:
|
|
admin-ui:
|
|
url: http://dashboard.chenfeng.iocoder.cn # Admin 管理后台 UI 的地址
|
|
websocket:
|
|
enable: true # websocket的开关
|
|
path: /infra/ws # 路径
|
|
sender-type: local # 消息发送的类型,可选值为 local、redis、rocketmq、kafka、rabbitmq
|
|
sender-rocketmq:
|
|
topic: ${spring.application.name}-websocket # 消息发送的 RocketMQ Topic
|
|
consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 RocketMQ Consumer Group
|
|
sender-rabbitmq:
|
|
exchange: ${spring.application.name}-websocket-exchange # 消息发送的 RabbitMQ Exchange
|
|
queue: ${spring.application.name}-websocket-queue # 消息发送的 RabbitMQ Queue
|
|
sender-kafka:
|
|
topic: ${spring.application.name}-websocket # 消息发送的 Kafka Topic
|
|
consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 Kafka Consumer Group
|
|
swagger:
|
|
title: 日志、文件存储、监控、定时任务、代码生成
|
|
description: 提供日志、文件存储、监控、定时任务、代码生成等功能
|
|
version: ${chenfeng.info.version}
|
|
base-package: ${chenfeng.info.base-package}
|
|
codegen:
|
|
base-package: com.cf.imes
|
|
db-schemas: ${spring.datasource.dynamic.datasource.master.name}
|
|
front-type: 10 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类
|
|
error-code: # 错误码相关配置项
|
|
constants-class-list:
|
|
- com.cf.imes.module.infra.enums.ErrorCodeConstants
|
|
organ: # 多组织相关配置项
|
|
enable: true
|
|
ignore-urls:
|
|
- /admin-api/infra/file/*/get/** # 获取图片,和组织无关
|
|
ignore-tables:
|
|
- infra_codegen_column
|
|
- infra_codegen_table
|
|
- infra_test_demo
|
|
- infra_config
|
|
- infra_file_config
|
|
- infra_file
|
|
- infra_file_content
|
|
- infra_job
|
|
- infra_job_log
|
|
- infra_job_log
|
|
- infra_data_source_config
|
|
|
|
xss:
|
|
enable: false
|
|
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
|
|
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
|
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
|
encrypt:
|
|
enable: false
|
|
publicKey: cfimes
|
|
|
|
mybatis-plus:
|
|
configuration:
|
|
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl |