diff --git a/pom.xml b/pom.xml index 5b8a7a869d751b7d89e2da50135273594f732062..1b2ef01700a83159c8baf12fe55dcedf40684021 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,7 @@ springcloud-service-portal-8081 springcloud-service-config springcloud-service-config-client + springcloud-service-config-info springcloud-service-feign springcloud-service-zuul springcloud-service-consul diff --git a/springcloud-service-goods-9100/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-goods9100.yaml similarity index 96% rename from springcloud-service-goods-9100/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-goods9100.yaml index 297ced16622fdfea8a20cbc80e9641272c3059d3..3b367232c6333a26561511a907e821d467149211 100644 --- a/springcloud-service-goods-9100/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-goods9100.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 9100 - #兼容swagger配置 spring: # mysql diff --git a/springcloud-service-goods-9200/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-goods9200.yaml similarity index 96% rename from springcloud-service-goods-9200/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-goods9200.yaml index 5dff84d6f18a53dbb979309a4cf0a6ee23c1da57..881086a6c016d71149081ae11c996c2267b52344 100644 --- a/springcloud-service-goods-9200/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-goods9200.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 9200 - #兼容swagger配置 spring: # mysql diff --git a/springcloud-service-goods-9300/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-goods9300.yaml similarity index 96% rename from springcloud-service-goods-9300/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-goods9300.yaml index c176c3584d4e7d6ca5af404c6fc6a2a14db85682..5e214f193bbdcd5c1c86bf17e5a6bc42c180eaec 100644 --- a/springcloud-service-goods-9300/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-goods9300.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 9300 - #兼容swagger配置 spring: # mysql diff --git a/springcloud-service-portal-8080/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-portal8080.yaml similarity index 95% rename from springcloud-service-portal-8080/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-portal8080.yaml index 514609cd1c25930b179541ce6b3514e58bf7eb4e..0542506d9fb590e1c8ac25835a74ab871fb0bd2a 100644 --- a/springcloud-service-portal-8080/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-portal8080.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 8080 - spring: application: name: portal-service #服务名称 diff --git a/springcloud-service-portal-8081/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-portal8081.yaml similarity index 95% rename from springcloud-service-portal-8081/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-portal8081.yaml index 296990a32ec29600b4b8072a65962d4191326d78..d9ba0e4b1b7e6ff2636262570fc3d59f6e17939f 100644 --- a/springcloud-service-portal-8081/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-portal8081.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 8081 - spring: application: name: portal-service #服务名称 diff --git a/springcloud-service-config-info/pom.xml b/springcloud-service-config-info/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..bf506edfb0b5721c289ecf5dd1caa28494a03529 --- /dev/null +++ b/springcloud-service-config-info/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + com.kwan.springcloud + springcloud-service-parent + 1.0.0 + + springcloud-service-config-info + 0.0.1-SNAPSHOT + springcloud-service-config-info + + 1.8 + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/springcloud-service-config/src/main/resources/application.yaml b/springcloud-service-config/src/main/resources/application.yaml index ea21a13aeb5d0d8e306fb6e07f03ec8ce94dc819..587f73e1cf458813d7d0c2bcc1c65854145a725d 100644 --- a/springcloud-service-config/src/main/resources/application.yaml +++ b/springcloud-service-config/src/main/resources/application.yaml @@ -9,12 +9,12 @@ spring: config: server: git: - uri: https://gitcode.net/qyj19920704/springcloud-config.git + uri: https://gitcode.net/qyj19920704/springcloud-study.git search-paths: - - config-repo + - springcloud-service-config-info/dev username: 13113691357 password: 15671628341qwe - label: master + label: main #服务提供者 eureka: diff --git a/springcloud-service-goods-9100/src/main/resources/bootstrap.yml b/springcloud-service-goods-9100/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000000000000000000000000000000000..41144f78ac5fb23576310a8b1e7f74c1501da064 --- /dev/null +++ b/springcloud-service-goods-9100/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +#端口号 +server: + port: 9100 + + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-goods9100 #获取的文件名 + profile: goods9100 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-goods-9200/src/main/resources/bootstrap.yml b/springcloud-service-goods-9200/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000000000000000000000000000000000..63f3460ff2879939554347cfe640e57d3fab94a1 --- /dev/null +++ b/springcloud-service-goods-9200/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +#端口号 +server: + port: 9200 + + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-goods9200 #获取的文件名 + profile: goods9200 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-goods-9300/src/main/resources/bootstrap.yml b/springcloud-service-goods-9300/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000000000000000000000000000000000..e1a0a161cac4cc3fb1c009343813eb31f6f9f541 --- /dev/null +++ b/springcloud-service-goods-9300/src/main/resources/bootstrap.yml @@ -0,0 +1,18 @@ +#端口号 +server: + port: 9300 + +#spring配置 +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-goods9300 #获取的文件名 + profile: goods9300 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +#注册中心配置 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-portal-8080/pom.xml b/springcloud-service-portal-8080/pom.xml index c96c8bd383d9c1ba77e7d2eb5b1d20ad947b22b3..811d39b9351fcf9a134fd8d37b27c6e16a3436b4 100644 --- a/springcloud-service-portal-8080/pom.xml +++ b/springcloud-service-portal-8080/pom.xml @@ -33,7 +33,6 @@ org.springframework.cloud spring-cloud-openfeign-core - org.springframework.boot spring-boot-starter-actuator @@ -42,6 +41,15 @@ org.springframework.cloud spring-cloud-starter-netflix-hystrix + + org.springframework.cloud + spring-cloud-config-client + + + org.springframework.boot + spring-boot-starter-web + + diff --git a/springcloud-service-portal-8080/src/main/resources/bootstrap.yml b/springcloud-service-portal-8080/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000000000000000000000000000000000..8b523f876ccc86d5aecd8e1c04379c4ffe513ba0 --- /dev/null +++ b/springcloud-service-portal-8080/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +#端口号 +server: + port: 8080 + + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-portal8080 #获取的文件名 + profile: portal8080 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-portal-8081/pom.xml b/springcloud-service-portal-8081/pom.xml index ee5573acba9ea850e6a056226845d7a2b51dc61d..9dce6d2995447f696bd3ceab249ffc225c99fede 100644 --- a/springcloud-service-portal-8081/pom.xml +++ b/springcloud-service-portal-8081/pom.xml @@ -33,7 +33,6 @@ org.springframework.cloud spring-cloud-openfeign-core - org.springframework.boot spring-boot-starter-actuator @@ -42,9 +41,15 @@ org.springframework.cloud spring-cloud-starter-netflix-hystrix - + + org.springframework.cloud + spring-cloud-config-client + + + org.springframework.boot + spring-boot-starter-web + - diff --git a/springcloud-service-portal-8081/src/main/resources/bootstrap.yml b/springcloud-service-portal-8081/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000000000000000000000000000000000..36ee5108372d7b1b3e17af171d538db464805aea --- /dev/null +++ b/springcloud-service-portal-8081/src/main/resources/bootstrap.yml @@ -0,0 +1,16 @@ +#端口号,指定端口,不然默认是8080,会出现冲突 +server: + port: 8081 + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-portal8081 #获取的文件名 + profile: portal8081 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file