diff --git a/JY-Core/src/main/resources/bootstrap.yaml b/JY-Core/src/main/resources/bootstrap.yaml index a52539b8..e9deddd7 100644 --- a/JY-Core/src/main/resources/bootstrap.yaml +++ b/JY-Core/src/main/resources/bootstrap.yaml @@ -40,6 +40,9 @@ spring: password: ${NACOS_PASSWORD:} # Core 与 Gateway 共享的公共配置文件。 shared-configs: + - data-id: datasource.yaml + group: ${NACOS_GROUP:DEFAULT_GROUP} + refresh: true - data-id: infra.yaml group: ${NACOS_GROUP:DEFAULT_GROUP} refresh: true diff --git a/JY-Gateway/src/main/resources/bootstrap.yaml b/JY-Gateway/src/main/resources/bootstrap.yaml index a7cb27e4..31a4fed1 100644 --- a/JY-Gateway/src/main/resources/bootstrap.yaml +++ b/JY-Gateway/src/main/resources/bootstrap.yaml @@ -34,6 +34,9 @@ spring: password: ${NACOS_PASSWORD:} # Core 与 Gateway 共享的公共配置文件。 shared-configs: + - data-id: datasource.yaml + group: ${NACOS_GROUP:DEFAULT_GROUP} + refresh: true - data-id: infra.yaml group: ${NACOS_GROUP:DEFAULT_GROUP} refresh: true diff --git a/scripts/应用配置迁移到Nacos说明_20260630.md b/scripts/应用配置迁移到Nacos说明_20260630.md index 5ff12e02..58ca899c 100644 --- a/scripts/应用配置迁移到Nacos说明_20260630.md +++ b/scripts/应用配置迁移到Nacos说明_20260630.md @@ -44,10 +44,18 @@ NACOS_PASSWORD=通过受控渠道保存 - `core.yaml` - `gateway.yaml` +- `datasource.yaml` - `infra.yaml` - `secret.yaml` - `logging.yaml` +数据库连接配置应放在 `datasource.yaml`: + +- `spring.datasource.url` +- `spring.datasource.username` +- `spring.datasource.password` +- `spring.datasource.driver-class-name` + 七牛 Kodo 必填配置应放在 `infra.yaml` 和 `secret.yaml`: - `qiniu.kodo.bucket-name`