本文共 5723 字,大约阅读时间需要 19 分钟。
4.0.0 eureka-server 0.0.1-SNAPSHOT eureka-server eureka-server project for Spring Boot com.xiaobu springcloud-demo 0.0.1-SNAPSHOT org.springframework.cloud spring-cloud-starter-netflix-eureka-server org.springframework.cloud spring-cloud-starter-netflix-eureka-client org.springframework.cloud spring-cloud-config-server org.springframework.cloud spring-cloud-dependencies ${spring-cloud.version} pom import org.springframework.boot spring-boot-maven-plugin
4.0.0 com.xiaobu springcloud-demo 0.0.1-SNAPSHOT config-server 0.0.1-SNAPSHOT config-server config-server project for Spring Boot UTF-8 UTF-8 1.8 org.springframework.cloud spring-cloud-dependencies ${spring-cloud.version} pom import org.springframework.boot spring-boot-starter org.springframework.cloud spring-cloud-config-server org.springframework.cloud spring-cloud-starter-netflix-eureka-client org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-compiler-plugin
server.port=7001spring.application.name=config-server#配置Git仓库的地址spring.cloud.config.server.git.uri=https://gitee.com/xiaobu1994/spring-cloud-learning#配置仓库路径下的相对搜索位置,可以配置多个spring.cloud.config.server.git.search-paths=spring-cloud-config-file#这里配置你的Git仓库的用户名spring.cloud.config.server.git.username=username#这里配置你的Git仓库的密码spring.cloud.config.server.git.password=passwordeureka.client.serviceUrl.defaultZone=http://localhost:8001/eureka/
4.0.0 com.xiaobu springcloud-demo 0.0.1-SNAPSHOT config-client 0.0.1-SNAPSHOT config-client config-client project for Spring Boot 1.8 org.springframework.cloud spring-cloud-dependencies ${spring-cloud.version} pom import org.springframework.boot spring-boot-starter org.springframework.cloud spring-cloud-starter-config org.springframework.cloud spring-cloud-starter-netflix-eureka-client org.springframework.boot spring-boot-maven-plugin
bootstrap.properties
# 从config-server获取配置信息#server.port=7002#{application}#spring.application.name=xiaobu#{profile}#spring.cloud.config.profile=dev#{label}#spring.cloud.config.label=master# spring.cloud.config.uri=http://localhost:7001/# 从eureka-server获取配置信息#{application}spring.application.name=xiaobu#{profile}spring.cloud.config.profile=dev#{label}spring.cloud.config.label=masterspring.cloud.config.uri= http://localhost:7001/eureka.client.serviceUrl.defaultZone=http://localhost:8001/eureka/spring.cloud.config.discovery.enabled=truespring.cloud.config.discovery.serviceId=config-serverserver.port=7002
一次启动eureka-server、config-server、config-client
访问 http://localhost:8001/ 如下:
访问 http://localhost:7002/from
git-dev-1.0
转载地址:http://rzgai.baihongyu.com/