diff --git a/nacos-spring-boot-example/nacos-spring-boot-config-example/src/main/resources/application.properties b/nacos-spring-boot-example/nacos-spring-boot-config-example/src/main/resources/application.properties index 3daa51fce..2b471c283 100644 --- a/nacos-spring-boot-example/nacos-spring-boot-config-example/src/main/resources/application.properties +++ b/nacos-spring-boot-example/nacos-spring-boot-config-example/src/main/resources/application.properties @@ -1,12 +1,12 @@ -# \u5728\u547D\u540D\u7A7A\u95F4\u8BE6\u60C5\u5904\u53EF\u4EE5\u83B7\u53D6\u5230 endpoint \u548C namespace \u7684\u503C +# 在命名空间详情处可以获取到 endpoint 和 namespace 的值 nacos.config.endpoint=xxx nacos.config.namespace=xxx -# \u63A8\u8350\u4F7F\u7528 RAM \u8D26\u6237\u7684 accessKey \u548C secretKey +# 推荐使用 RAM 账户的 accessKey 和 secretKey nacos.config.access-key=xxx nacos.config.secret-key=xxx # endpoint http://localhost:8080/actuator/nacos-config # health http://localhost:8080/actuator/health management.endpoints.web.exposure.include=* -management.endpoint.health.show-details=always \ No newline at end of file +management.endpoint.health.show-details=always diff --git a/nacos-spring-cloud-example/nacos-spring-cloud-config-example/src/main/resources/bootstrap.properties b/nacos-spring-cloud-example/nacos-spring-cloud-config-example/src/main/resources/bootstrap.properties index 925de2781..aa2dcf3f2 100644 --- a/nacos-spring-cloud-example/nacos-spring-cloud-config-example/src/main/resources/bootstrap.properties +++ b/nacos-spring-cloud-example/nacos-spring-cloud-config-example/src/main/resources/bootstrap.properties @@ -1,16 +1,16 @@ -# \u5728\u547D\u540D\u7A7A\u95F4\u8BE6\u60C5\u5904\u53EF\u4EE5\u83B7\u53D6\u5230 endpoint \u548C namespace \u7684\u503C +# 在命名空间详情处可以获取到 endpoint 和 namespace 的值 spring.cloud.nacos.config.endpoint=xxx spring.cloud.nacos.config.namespace=xxx -# \u63A8\u8350\u4F7F\u7528 RAM \u8D26\u6237\u7684 accessKey \u548C secretKey +# 推荐使用 RAM 账户的 accessKey 和 secretKey spring.cloud.nacos.config.access-key=xxx spring.cloud.nacos.config.secret-key=xxx -# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A -# Data ID\uFF1Acom.alibaba.nacos.example.properties -# Group\uFF1ADEFAULT_GROUP -# \u914D\u7F6E\u5185\u5BB9\uFF1AconnectTimeoutInMills=5000 +# ACM 控制台添加配置: +# Data ID:com.alibaba.nacos.example.properties +# Group:DEFAULT_GROUP +# 配置内容:connectTimeoutInMills=5000 spring.application.name=com.alibaba.nacos.example -# \u6307\u5B9A\u914D\u7F6E\u7684\u540E\u7F00\uFF0C\u652F\u6301 properties\u3001yaml\u3001yml\uFF0C\u9ED8\u8BA4\u4E3A properties +# 指定配置的后缀,支持 properties、yaml、yml,默认为 properties spring.cloud.nacos.config.file-extension=properties -#spring.cloud.nacos.config.file-extension=yaml \ No newline at end of file +#spring.cloud.nacos.config.file-extension=yaml diff --git a/nacos-spring-cloud-example/nacos-spring-cloud-config-multi-data-ids-example/src/main/resources/bootstrap.properties b/nacos-spring-cloud-example/nacos-spring-cloud-config-multi-data-ids-example/src/main/resources/bootstrap.properties index d28e7d6b9..ee35f9cbe 100644 --- a/nacos-spring-cloud-example/nacos-spring-cloud-config-multi-data-ids-example/src/main/resources/bootstrap.properties +++ b/nacos-spring-cloud-example/nacos-spring-cloud-config-multi-data-ids-example/src/main/resources/bootstrap.properties @@ -1,27 +1,27 @@ spring.application.name=multi-data-ids-example -# \u5728\u547D\u540D\u7A7A\u95F4\u8BE6\u60C5\u5904\u53EF\u4EE5\u83B7\u53D6\u5230 endpoint \u548C namespace \u7684\u503C +# 在命名空间详情处可以获取到 endpoint 和 namespace 的值 spring.cloud.nacos.config.endpoint=xxx spring.cloud.nacos.config.namespace=xxx -# \u63A8\u8350\u4F7F\u7528 RAM \u8D26\u6237\u7684 accessKey \u548C secretKey +# 推荐使用 RAM 账户的 accessKey 和 secretKey spring.cloud.nacos.config.access-key=xxx spring.cloud.nacos.config.secret-key=xxx -# 0.2.1.RELEASE \u4EE5\u4E0A\u652F\u6301\u591A\u4E2A\u914D\u7F6E\uFF0C\u6587\u6863\uFF1Ahttps://github.com/spring-cloud-incubator/spring-cloud-alibaba/wiki/Nacos-config +# 0.2.1.RELEASE 以上支持多个配置,文档:https://github.com/spring-cloud-incubator/spring-cloud-alibaba/wiki/Nacos-config -# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A -# Data ID\uFF1Aapp.properties -# Group\uFF1Amulti-data-ids -# \u914D\u7F6E\u5185\u5BB9\uFF1Aapp.user.cache=false +# ACM 控制台添加配置: +# Data ID:app.properties +# Group:multi-data-ids +# 配置内容:app.user.cache=false spring.cloud.nacos.config.ext-config[0].data-id=app.properties spring.cloud.nacos.config.ext-config[0].group=multi-data-ids spring.cloud.nacos.config.ext-config[0].refresh=true -# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A -# Data ID\uFF1Adatasource.properties -# Group\uFF1Amulti-data-ids -# \u914D\u7F6E\u5185\u5BB9\u793A\u4F8B\uFF1A +# ACM 控制台添加配置: +# Data ID:datasource.properties +# Group:multi-data-ids +# 配置内容示例: # spring.datasource.url=jdbc:mysql://localhost:3306/test?useSSL=false # spring.datasource.username=root # spring.datasource.password=root @@ -30,10 +30,10 @@ spring.cloud.nacos.config.ext-config[0].refresh=true spring.cloud.nacos.config.ext-config[1].data-id=datasource.properties spring.cloud.nacos.config.ext-config[1].group=multi-data-ids -# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A -# Data ID\uFF1Aredis.properties -# Group\uFF1Amulti-data-ids -# \u914D\u7F6E\u5185\u5BB9\u793A\u4F8B\uFF1A +# ACM 控制台添加配置: +# Data ID:redis.properties +# Group:multi-data-ids +# 配置内容示例: # spring.redis.host=localhost # spring.redis.password=20190101 # spring.redis.timeout=5000 @@ -42,4 +42,4 @@ spring.cloud.nacos.config.ext-config[1].group=multi-data-ids # spring.redis.max-wait=3000 # spring.redis.test-on-borrow=false spring.cloud.nacos.config.ext-config[2].data-id=redis.properties -spring.cloud.nacos.config.ext-config[2].group=multi-data-ids \ No newline at end of file +spring.cloud.nacos.config.ext-config[2].group=multi-data-ids diff --git a/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/resources/application.properties b/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/resources/application.properties index 6d58ecf67..01713b446 100644 --- a/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/resources/application.properties +++ b/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/resources/application.properties @@ -1,2 +1,2 @@ spring.application.name=service-consumer -spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 \ No newline at end of file +spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 diff --git a/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/resources/application.properties b/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/resources/application.properties index 6e3f69868..f831b9a4c 100644 --- a/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/resources/application.properties +++ b/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/resources/application.properties @@ -1,3 +1,3 @@ server.port=18080 spring.application.name=service-provider -spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 \ No newline at end of file +spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 diff --git a/pom.xml b/pom.xml index 3e9e5644d..c5b4a0284 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,12 @@ nacos-examples pom 0.2.0-SNAPSHOT + + + UTF-8 + UTF-8 + + nacos-spring-example nacos-spring-boot-example