本文共 6596 字,大约阅读时间需要 21 分钟。
4.0.0 com.kgf parent 0.0.1-SNAPSHOT pom parent org.springframework.boot spring-boot-starter-parent 2.0.3.RELEASE UTF-8 UTF-8 1.8 Finchley.RELEASE org.springframework.cloud spring-cloud-dependencies ${spring-cloud.version} pom import springcloud-config-server springcloud-config-client springcloud-eureka-server
4.0.0 com.kgf parent 0.0.1-SNAPSHOT springcloud-eureka-server org.springframework.cloud spring-cloud-starter-netflix-eureka-server org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-maven-plugin
---server: port: 8888spring: cloud: config: server: git: uri: https://github.com/kangf897570/SpringcloudConfig search-paths: - respo1 username: kangf897570 password: Kangf@897570 label: master application: name: config-server profiles: dev eureka: client: service-url: defaultZone: http://localhost:8761/eureka/ ---server: port: 9999spring: cloud: config: server: git: uri: https://github.com/kangf897570/SpringcloudConfig search-paths: - respo2 username: kangf897570 password: Kangf@897570 label: master application: name: config-server profiles: test eureka: client: service-url: defaultZone: http://localhost:8761/eureka/⑶在pom.xml中添加依赖
4.0.0 com.kgf parent 0.0.1-SNAPSHOT springcloud-config-server org.springframework.cloud spring-cloud-config-server org.springframework.cloud spring-cloud-starter-netflix-eureka-client org.springframework.boot spring-boot-maven-plugin
---server: port: 8762spring: application: name: config-client profiles: dev cloud: config: name: config-client-dev #表示要获取的配置文件名称 fail-fast: true discovery: enabled: true service-id: config-server #服务名称,表示从这个服务获取配置信息---server: port: 8763spring: application: name: config-client profiles: test cloud: config: name: config-client-dev fail-fast: true discovery: enabled: true service-id: config-server⑶在pom.xml中添加依赖
4.0.0 com.kgf parent 0.0.1-SNAPSHOT springcloud-config-client org.springframework.cloud spring-cloud-starter-config org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test org.springframework.cloud spring-cloud-starter-netflix-eureka-client org.springframework.cloud spring-cloud-starter-bus-amqp org.springframework.boot spring-boot-starter-actuator
转载地址:http://ryql.baihongyu.com/