From 8cc80161a7f49ecbe68531caa2e4924ba3356b7e Mon Sep 17 00:00:00 2001 From: zlt Date: Mon, 18 Nov 2019 23:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=89=80=E6=9C=89=E7=9A=84?= =?UTF-8?q?=20nacos=20=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE=E5=88=B0=20zlt-?= =?UTF-8?q?config/bootstrap.properties=20=E6=96=87=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=B9=B6=E7=94=A8?= =?UTF-8?q?=20spring.cloud.nacos.server-addr=20=E4=BB=A3=E6=9B=BF=20spring?= =?UTF-8?q?.cloud.nacos.discovery.server-addr=20=E4=B8=8E=20spring.cloud.n?= =?UTF-8?q?acos.config.server-addr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 15 +-------------- .../file-center/src/main/resources/bootstrap.yml | 15 +-------------- .../src/main/resources/bootstrap.yml | 15 +-------------- .../user-center/src/main/resources/bootstrap.yml | 16 +++------------- .../src/main/resources/application.properties | 16 ++-------------- .../src/main/resources/bootstrap.properties | 6 ++++++ .../src/main/resources/bootstrap.yml | 10 +--------- .../src/main/resources/bootstrap.yml | 10 +--------- .../src/main/resources/bootstrap.yml | 10 +--------- .../sc-gateway/src/main/resources/bootstrap.yml | 15 +-------------- .../src/main/resources/bootstrap.yml | 15 +-------------- .../log-center/src/main/resources/bootstrap.yml | 15 +-------------- .../sc-admin/src/main/resources/bootstrap.yml | 10 ---------- zlt-uaa/src/main/resources/bootstrap.yml | 13 ------------- 14 files changed, 20 insertions(+), 161 deletions(-) diff --git a/zlt-business/code-generator/src/main/resources/bootstrap.yml b/zlt-business/code-generator/src/main/resources/bootstrap.yml index f546916..bffb899 100644 --- a/zlt-business/code-generator/src/main/resources/bootstrap.yml +++ b/zlt-business/code-generator/src/main/resources/bootstrap.yml @@ -1,19 +1,6 @@ server: port: 7300 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: code-generator - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: code-generator \ No newline at end of file diff --git a/zlt-business/file-center/src/main/resources/bootstrap.yml b/zlt-business/file-center/src/main/resources/bootstrap.yml index 877f5b4..fd60207 100644 --- a/zlt-business/file-center/src/main/resources/bootstrap.yml +++ b/zlt-business/file-center/src/main/resources/bootstrap.yml @@ -1,19 +1,6 @@ server: port: 5000 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: file-center - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: file-center \ No newline at end of file diff --git a/zlt-business/search-center/search-server/src/main/resources/bootstrap.yml b/zlt-business/search-center/search-server/src/main/resources/bootstrap.yml index e763457..de77b5c 100644 --- a/zlt-business/search-center/search-server/src/main/resources/bootstrap.yml +++ b/zlt-business/search-center/search-server/src/main/resources/bootstrap.yml @@ -1,19 +1,6 @@ server: port: 7100 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: search-center - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: search-center \ No newline at end of file diff --git a/zlt-business/user-center/src/main/resources/bootstrap.yml b/zlt-business/user-center/src/main/resources/bootstrap.yml index 897e3c5..37d61a5 100644 --- a/zlt-business/user-center/src/main/resources/bootstrap.yml +++ b/zlt-business/user-center/src/main/resources/bootstrap.yml @@ -1,21 +1,11 @@ server: port: 7000 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: name: user-center - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} +# cloud: +# nacos: +# discovery: # metadata: # version: zlt \ No newline at end of file diff --git a/zlt-config/src/main/resources/application.properties b/zlt-config/src/main/resources/application.properties index f242512..87d5e32 100644 --- a/zlt-config/src/main/resources/application.properties +++ b/zlt-config/src/main/resources/application.properties @@ -1,12 +1,4 @@ -########################## 通用配置 ########################## -# 默认开发环境 -spring.profiles.active=dev - -##### spring-boot-actuator配置 -management.endpoints.web.exposure.include=* -management.endpoint.health.show-details=always - - +########################## application级别通用配置 ########################## ##### ribbon配置 ## 从注册中心刷新servelist的时间 默认30秒,单位ms ribbon.ServerListRefreshInterval=15000 @@ -102,8 +94,4 @@ spring.redis.lettuce.pool.max-wait=-1 # 连接池中的最大空闲连接 spring.redis.lettuce.pool.max-idle=8 # 连接池中的最小空闲连接 -spring.redis.lettuce.pool.min-idle=0 - - -##### 允许bean覆盖 -spring.main.allow-bean-definition-overriding=true \ No newline at end of file +spring.redis.lettuce.pool.min-idle=0 \ No newline at end of file diff --git a/zlt-config/src/main/resources/bootstrap.properties b/zlt-config/src/main/resources/bootstrap.properties index eee2e90..c0baec4 100644 --- a/zlt-config/src/main/resources/bootstrap.properties +++ b/zlt-config/src/main/resources/bootstrap.properties @@ -2,6 +2,12 @@ # 默认开发环境 spring.profiles.active=dev +##### nacos(注册中心和配置中心)地址 +spring.cloud.nacos.server-addr=192.168.28.130:8848 +spring.cloud.nacos.config.file-extension=yml +spring.cloud.nacos.config.shared-dataids=common.yml +spring.cloud.nacos.config.refreshable-dataids=common.yml + ##### spring-boot-actuator配置 management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always diff --git a/zlt-demo/txlcn-demo/txlcn-demo-spring-service-a/src/main/resources/bootstrap.yml b/zlt-demo/txlcn-demo/txlcn-demo-spring-service-a/src/main/resources/bootstrap.yml index 9e4e284..288bff6 100644 --- a/zlt-demo/txlcn-demo/txlcn-demo-spring-service-a/src/main/resources/bootstrap.yml +++ b/zlt-demo/txlcn-demo/txlcn-demo-spring-service-a/src/main/resources/bootstrap.yml @@ -1,14 +1,6 @@ server: port: 12011 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: txlcn-demo-spring-service-a - cloud: - nacos: - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: txlcn-demo-spring-service-a \ No newline at end of file diff --git a/zlt-demo/txlcn-demo/txlcn-demo-spring-service-b/src/main/resources/bootstrap.yml b/zlt-demo/txlcn-demo/txlcn-demo-spring-service-b/src/main/resources/bootstrap.yml index 527c372..c3d532d 100644 --- a/zlt-demo/txlcn-demo/txlcn-demo-spring-service-b/src/main/resources/bootstrap.yml +++ b/zlt-demo/txlcn-demo/txlcn-demo-spring-service-b/src/main/resources/bootstrap.yml @@ -1,14 +1,6 @@ server: port: 12002 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: txlcn-demo-spring-service-b - cloud: - nacos: - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: txlcn-demo-spring-service-b \ No newline at end of file diff --git a/zlt-demo/txlcn-demo/txlcn-demo-spring-service-c/src/main/resources/bootstrap.yml b/zlt-demo/txlcn-demo/txlcn-demo-spring-service-c/src/main/resources/bootstrap.yml index a5fe647..e3bb0cb 100644 --- a/zlt-demo/txlcn-demo/txlcn-demo-spring-service-c/src/main/resources/bootstrap.yml +++ b/zlt-demo/txlcn-demo/txlcn-demo-spring-service-c/src/main/resources/bootstrap.yml @@ -1,14 +1,6 @@ server: port: 12003 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: txlcn-demo-spring-service-c - cloud: - nacos: - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: txlcn-demo-spring-service-c \ No newline at end of file diff --git a/zlt-gateway/sc-gateway/src/main/resources/bootstrap.yml b/zlt-gateway/sc-gateway/src/main/resources/bootstrap.yml index 02b4e22..a41f0b3 100644 --- a/zlt-gateway/sc-gateway/src/main/resources/bootstrap.yml +++ b/zlt-gateway/sc-gateway/src/main/resources/bootstrap.yml @@ -1,19 +1,6 @@ server: port: 9900 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: sc-gateway - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: sc-gateway \ No newline at end of file diff --git a/zlt-gateway/zuul-gateway/src/main/resources/bootstrap.yml b/zlt-gateway/zuul-gateway/src/main/resources/bootstrap.yml index bd95d8c..b64a9d4 100644 --- a/zlt-gateway/zuul-gateway/src/main/resources/bootstrap.yml +++ b/zlt-gateway/zuul-gateway/src/main/resources/bootstrap.yml @@ -4,19 +4,6 @@ server: buffer-size: 1024 direct-buffers: true -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: api-gateway - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: api-gateway \ No newline at end of file diff --git a/zlt-monitor/log-center/src/main/resources/bootstrap.yml b/zlt-monitor/log-center/src/main/resources/bootstrap.yml index a18fe27..c4b7c92 100644 --- a/zlt-monitor/log-center/src/main/resources/bootstrap.yml +++ b/zlt-monitor/log-center/src/main/resources/bootstrap.yml @@ -1,19 +1,6 @@ server: port: 7200 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: - name: log-center - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} \ No newline at end of file + name: log-center \ No newline at end of file diff --git a/zlt-monitor/sc-admin/src/main/resources/bootstrap.yml b/zlt-monitor/sc-admin/src/main/resources/bootstrap.yml index 742de40..102a2c9 100644 --- a/zlt-monitor/sc-admin/src/main/resources/bootstrap.yml +++ b/zlt-monitor/sc-admin/src/main/resources/bootstrap.yml @@ -1,10 +1,6 @@ server: port: 6500 -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: name: sc-admin @@ -14,13 +10,7 @@ spring: password: 'admin' cloud: nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml discovery: - server-addr: ${zlt.nacos.server-addr} metadata: user.name: ${spring.security.user.name} user.password: ${spring.security.user.password} \ No newline at end of file diff --git a/zlt-uaa/src/main/resources/bootstrap.yml b/zlt-uaa/src/main/resources/bootstrap.yml index 1625c4c..a21c53e 100644 --- a/zlt-uaa/src/main/resources/bootstrap.yml +++ b/zlt-uaa/src/main/resources/bootstrap.yml @@ -5,22 +5,9 @@ server: cookie: name: OAUTH2SESSION -zlt: - nacos: - server-addr: 192.168.28.130:8848 - spring: application: name: uaa-server - cloud: - nacos: - config: - server-addr: ${zlt.nacos.server-addr} - file-extension: yml - shared-dataids: common.yml - refreshable-dataids: common.yml - discovery: - server-addr: ${zlt.nacos.server-addr} encrypt: key-store: -- GitLab