spring cloud笔记5

spring cloud config简介:

spring cloud笔记5

架构图:

spring cloud笔记5

映射规则:

spring cloud笔记5

1.

c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888
c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/foobar/dev/master": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
 c.itmuch.cloud.ConfigServerApplication   : No active profile set, falling back to default profiles: default

application.yml

server:
  port: 8081
spring:
  cloud:
    config:
      uri: http://localhost:8080
      profile: dev
      label: master   # 当configserver的后端存储是Git时,默认就是master
  application:
    name: foobar
   解析:

 bootstrap.*里面的配置先加载  ——>连接config service, 加载远程配置(git仓库里面的配置)  ——>加载application.*里面的配置

解决方法:

新建文件bootstrap.yml

spring:
  cloud:
    config:
      uri: http://localhost:8080
      profile: dev
      label: master 
  application:
    name: foobar
    spring cloud笔记52.尽量不要把@RefreshScope和@Configuration放在一起使用
   

相关文章:

  • 2021-06-21
  • 2021-04-14
  • 2022-12-23
  • 2021-10-28
  • 2022-01-15
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-06
  • 2021-07-22
  • 2021-12-30
  • 2022-12-23
  • 2021-06-20
  • 2021-06-19
  • 2021-05-23
相关资源
相似解决方案