当我启动 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
但是,当我在浏览器中点击该 URL 时,它存在并且配置服务器正在工作。到底是怎么回事?
应用程序.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
引导程序.yml
spring:
application:
name: configserver
原文由 Brian Abston 发布,翻译遵循 CC BY-SA 4.0 许可协议
如果您的配置服务器也不打算成为配置客户端,您需要设置
spring.cloud.config.enabled=false
以避免该日志条目(尽管它是无害的)。