使用group
添加两组方案,分别位于不同group
bootstrap.yml 添加 group: group名
application.yml
指定统一的环境名
重启测试
使用命名空间
新建命名空间
新建配置
bootstrap.yml 添加namespace
server:
port: 3377
spring:
application:
name: nacos-config-client
cloud:
nacos:
discovery:
server-addr: localhost:8848
config:
server-addr: localhost:8848
file-extension: yaml
namespace: 71ff8c8a-e2e9-41c7-a0c6-7f3923cc9406 #dev
group: TEST_GROUP
application.yml 指定当前环境
spring:
profiles:
#active: test
active: dev #表示开发环境