Closed Alice52 closed 3 years ago
find solution about nacos config multi env later
.we can use start command to fix this issue
data id:
${prefix}-${spring.profiles.active}.${file-extension}
java -Dspring.profiles.active=test -jar example-0.0.1-SNAPSHOT.jar
# bootstramp.yml, and create config file in nacos, such as others-dev.yml
spring:
application:
name: example
profiles:
active: dev
cloud:
nacos:
config:
server-addr: 192.168.100.10:8848
file-extension: yaml
group:
java -Dspring.cloud.nacos.config.group=DEV_GROUP -jar example-0.0.1-SNAPSHOT.jar
# bootstramp.yml, and create config file in nacos, such as others.yml and put in DEV_GROUP
spring:
application:
name: example
cloud:
nacos:
config:
group: DEV_GROUP
server-addr: 192.168.100.10:8848
file-extension: yaml
namespace
: and please forget switch env by active in this place.
java -Dspring.cloud.nacos.config.namespace=ns_test -jar example-0.0.1-SNAPSHOT.jar
# bootstramp.yml, and create config file in nacos, such as others.yml in uuid namsespace
spring:
application:
name: example
cloud:
nacos:
config:
namespace: uuid
server-addr: 192.168.100.10:8848
file-extension: yaml
java -Dspring.profiles.active=test \
-Dspring.cloud.nacos.config.namespace=ns_test \
-Dspring.cloud.nacos.config.group=TEST_GROUP \
-jar example-0.0.1-SNAPSHOT.jar
but I donot think we have to use nacos config.
bootstrap.yml