bootstrap-dev.yml配置如下:
spring:
profiles:
active: dev
cloud:
#服务注册和发现
nacos:
discovery:
server-addr: 127.0.0.1:8848
service: ${spring.application.name}
group: xx-service-${spring.profiles.active}
config:
group: xx-service-${spring.profiles.active}
server-addr: 127.0.0.1:8848
file-extension: yml
shared-configs:
- data-id: global-config.yml
group: xx-service-${spring.profiles.active}
注意配置中心Data ID的区别,全局配置必须加上文件后缀.yml;而其他配置因为 file-extension: yml 的存在可以省略后缀。
nocas版本是 2.2.1.RELEASE