一个应用应该具有一个配置文件
1、通过命名空间指定配置文件的环境,需要注意的是 配置文件中需要指定的namespace为创建的namespaceid
2、通过group 来区分不同的项目
3、具体的应用配置文件为对应每个服务
spring:
application:
name: order-service
cloud:
nacos:
server-addr: 192.168.1.112:8847
username: nacos
password: nacos
config:
file-extension: yaml
#namespace: a4577de5-6b05-4da1-b19d-8c5629a52cb8 # prod 命名空间
namespace: 23c66181-e34e-466a-8496-eb9c00581c75 # dev命名空间 一般部署 改变这里就可以了
group: tulingmall # group 区分 项目
shared-configs:
- dataId: tuling-mall.yml
group: tulingmall
refresh: true
extension-configs:
- dataId: tuling-mall-extension.yml
group: tulingmall
refresh: true
优先级:
profile > 默认配置文件 >extension>share-config(同一个配置中,后读取到的配置覆盖之前的)
最好配置 share-config , extension-config 用来应急 应急完就删除,所以extension-config中配置的是一些应急的配置



