Spring Cloud Config Server无法在启动时找到PropertySource

Bri*_*ton 11 spring-boot spring-cloud

当我启动Spring Cloud Config Server时出现以下错误.

Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/configserver/default/master":Connection refused; nested exception is java.net.ConnectException: Connection refused
Run Code Online (Sandbox Code Playgroud)

但是,当我在浏览器中点击该URL时,它存在且配置服务器正在运行.到底是怎么回事?

application.yml

server:
  port: 8888
management:
  context-path: /admin
logging:
  level:
    com.netflix.discovery: 'OFF'
    org.springframework.cloud: 'DEBUG'
spring:
  cloud:
    config:
      server:
        git:
          uri: file:/home/dev/configs     
Run Code Online (Sandbox Code Playgroud)

bootstrap.yml

spring:
  application:
    name: configserver
Run Code Online (Sandbox Code Playgroud)

Dav*_*yer 8

如果您的配置服务器也不打算成为配置客户端,则需要设置spring.cloud.config.enabled=false为避免该日志条目(尽管它是无害的).

  • 感谢你的回答。还有一个问题。如果该配置存在,那么为什么我在启动时会收到错误消息?我希望配置服务器也是客户端。 (2认同)