阅读背景:

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

来源:互联网 

When I start my Spring Cloud Config Server I get the following error.

当我启动Spring Cloud Config Server时,我得到了以下错误。

Could not locate PropertySource: I/O error on GET request for "https://localhost:8888/configserver/default/master":Connection refused; nested exception is java.net.ConnectException: Connection refused

However when I hit that URL in my browser it exists and the config server is working. What is going on?

然而,当我在浏览器中点击那个URL时,它就存在了,配置服务器也在工作。什么是怎么回事?

application.yml

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     

bootstrap.yml

bootstrap.yml

spring:
  application:
    name: configserver

2 个解决方案

#1


5  

If your config server is not intended to be a config client as well you need to set spring.cloud.config.enabled=false to avoid that log entry (it's harmless though).

如果配置服务器不打算成为配置客户端,那么您需要设置spring.cloud.config。启用=false以避免日志条目(但它是无害的)。

#2


-3  

The eureka.client.serviceUrl.defaultZone and spring.cloud.config.* configuration in the bootstrap yml file

eureka.client.serviceUrl.defaultZone spring.cloud.config。*在bootstrap yml文件中的配置。


分享到: