SpringCloud------客户端服务适配配置中心

1.前提

配置中心已经完成配置

参考

https://www.cnblogs.com/tianhengblogs/p/12507862.html

2.修改application.yml为bootstrap.yml

3.修改bootstrap.yml

除了以下配置,其它配置放到git服务器配置

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

spring:
  application:
    name: product-service
  cloud:
    config:
      discovery:
        enabled: true
        #指定从哪个配置中心读取配置
        service-id: config-server
      #环境dev,test
      profile: test
      #分支master,test
      label: test

猜你喜欢

转载自www.cnblogs.com/tianhengblogs/p/12508120.html