统一NACOS配置
This commit is contained in:
parent
4732cb276f
commit
accc6aee52
2
yudao-gateway/src/main/resources/application.yaml
Normal file
2
yudao-gateway/src/main/resources/application.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
server:
|
||||||
|
port: 8080
|
||||||
@ -1,2 +0,0 @@
|
|||||||
#server:
|
|
||||||
# port: 8080
|
|
||||||
@ -9,11 +9,11 @@ spring:
|
|||||||
discovery:
|
discovery:
|
||||||
group: ${DEPLOY_ENV}
|
group: ${DEPLOY_ENV}
|
||||||
namespace: ${DEPLOY_ENV}
|
namespace: ${DEPLOY_ENV}
|
||||||
|
ip: ${LOCAL_CLIENT_IP:} #必须要写:如果不写的话会注册成${LOCAL_CLIENT_IP}
|
||||||
config:
|
config:
|
||||||
group: ${DEPLOY_ENV}
|
group: ${DEPLOY_ENV}
|
||||||
namespace: ${DEPLOY_ENV}
|
namespace: ${DEPLOY_ENV}
|
||||||
file-extension: yaml
|
file-extension: yaml
|
||||||
config:
|
config:
|
||||||
import:
|
import:
|
||||||
- optional:nacos:zoe-gateway.yaml?group=DEFAULT_GROUP
|
- optional:nacos:zoe-common.yaml?group=DEFAULT_GROUP
|
||||||
- optional:classpath:application.yaml
|
|
||||||
@ -3,28 +3,13 @@ package cn.iocoder.yudao.module.system;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目的启动类
|
|
||||||
*
|
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
*
|
|
||||||
* @author 芋道源码
|
|
||||||
*/
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class SystemServerApplication {
|
public class SystemServerApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到 启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
|
|
||||||
SpringApplication.run(SystemServerApplication.class, args);
|
SpringApplication.run(SystemServerApplication.class, args);
|
||||||
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,106 +1,3 @@
|
|||||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
|
||||||
|
|
||||||
spring:
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
server-addr: 127.0.0.1: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:
|
|
||||||
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
|
|
||||||
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: 1 # 初始连接数
|
|
||||||
min-idle: 1 # 最小连接池数量
|
|
||||||
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:
|
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
|
||||||
# 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 连接的示例
|
|
||||||
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
|
||||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
|
|
||||||
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例
|
|
||||||
# url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
|
|
||||||
username: root
|
|
||||||
password: 123456
|
|
||||||
# username: sa # SQL Server 连接的示例
|
|
||||||
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
|
|
||||||
# username: SYSDBA # DM 连接的示例
|
|
||||||
# password: SYSDBA # DM 连接的示例
|
|
||||||
slave: # 模拟从库,可根据自己需要修改
|
|
||||||
lazy: true # 开启懒加载,保证启动速度
|
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
|
||||||
username: root
|
|
||||||
password: 123456
|
|
||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
|
||||||
data:
|
|
||||||
redis:
|
|
||||||
host: 127.0.0.1 # 地址
|
|
||||||
port: 6379 # 端口
|
|
||||||
database: 0 # 数据库索引
|
|
||||||
# password: 123456 # 密码,建议生产环境开启
|
|
||||||
|
|
||||||
--- #################### 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:
|
xxl:
|
||||||
job:
|
job:
|
||||||
enabled: false # 是否开启调度中心,默认为 true 开启
|
enabled: false # 是否开启调度中心,默认为 true 开启
|
||||||
@ -1,15 +1,10 @@
|
|||||||
server:
|
server:
|
||||||
port: 48081
|
port: 48081
|
||||||
spring:
|
spring:
|
||||||
main:
|
|
||||||
allow-circular-references: true
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
# Servlet 配置
|
|
||||||
servlet:
|
servlet:
|
||||||
# 文件上传相关配置项
|
|
||||||
multipart:
|
multipart:
|
||||||
max-file-size: 16MB # 单个文件大小
|
max-file-size: 16MB
|
||||||
max-request-size: 32MB # 设置总上传的文件大小
|
max-request-size: 32MB
|
||||||
# Jackson 配置项
|
# Jackson 配置项
|
||||||
jackson:
|
jackson:
|
||||||
serialization:
|
serialization:
|
||||||
@ -42,24 +37,6 @@ spring:
|
|||||||
# Kafka Consumer Listener 监听器配置
|
# Kafka Consumer Listener 监听器配置
|
||||||
listener:
|
listener:
|
||||||
missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错
|
missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错
|
||||||
logging:
|
|
||||||
file:
|
|
||||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
|
||||||
|
|
||||||
springdoc:
|
|
||||||
api-docs:
|
|
||||||
enabled: true # 1. 是否开启 Swagger 接文档的元数据
|
|
||||||
path: /v3/api-docs
|
|
||||||
swagger-ui:
|
|
||||||
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
|
|
||||||
path: /swagger-ui
|
|
||||||
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
|
|
||||||
|
|
||||||
knife4j:
|
|
||||||
enable: false # TODO 芋艿:需要关闭增强,具体原因见:https://github.com/xiaoymin/knife4j/issues/874
|
|
||||||
setting:
|
|
||||||
language: zh_cn
|
|
||||||
|
|
||||||
# MyBatis Plus 的配置项
|
# MyBatis Plus 的配置项
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: zoe-system-server
|
name: zoe-system
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: ${NACOS_CONFIG_SERVER}
|
server-addr: ${NACOS_CONFIG_SERVER}
|
||||||
@ -9,12 +9,12 @@ spring:
|
|||||||
discovery:
|
discovery:
|
||||||
group: ${DEPLOY_ENV}
|
group: ${DEPLOY_ENV}
|
||||||
namespace: ${DEPLOY_ENV}
|
namespace: ${DEPLOY_ENV}
|
||||||
|
ip: ${LOCAL_CLIENT_IP:} #必须要写:如果不写的话会注册成${LOCAL_CLIENT_IP}
|
||||||
config:
|
config:
|
||||||
group: DEFAULT_GROUP
|
group: DEFAULT_GROUP
|
||||||
namespace: ${DEPLOY_ENV}
|
namespace: ${DEPLOY_ENV}
|
||||||
file-extension: yml
|
file-extension: yaml
|
||||||
config:
|
config:
|
||||||
import:
|
import:
|
||||||
- optional:nacos:zoe-common.yml?group=DEFAULT_GROUP
|
- optional:nacos:zoe-common.yaml?group=DEFAULT_GROUP
|
||||||
- optional:nacos:zoe-system-server.yml?group=DEFAULT_GROUP
|
- optional:nacos:zoe-infra-datasource.yaml?group=DEFAULT_GROUP
|
||||||
- optional:classpath:application.yml
|
|
||||||
Loading…
Reference in New Issue
Block a user