我正在尝试使用本机文件位置启动一个简单的配置服务器。
服务器的配置如下所示
server:
port: 9001
spring:
cloud:
config:
server:
native:
search-locations: file://${HOME}/Desktop/config2
但是,当客户端服务器启动时使用以下配置
server.port=9002
spring.application.name=client-server
spring.config.import=optional:configserver:http://localhost:9001/
2021-12-01 09:47:07.563 INFO 14992 --- [ main] o.s.b.context.config.ConfigDataLoader : Fetching config from server at : http://localhost:9001/
2021-12-01 09:47:07.563 INFO 14992 --- [ main] o.s.b.context.config.ConfigDataLoader : Connect Timeout Exception on Url - http://localhost:9001/. Will be trying the next url if available
2021-12-01 09:47:07.563 WARN 14992 --- [ main] o.s.b.context.config.ConfigDataLoader : Could not locate PropertySource ([ConfigServerConfigDataResource@674bd420 uris = array<String>['http://localhost:9001/'], optional = true, profiles = list['local']]): I/O error on GET request for "http://localhost:9001/client-server/local": Invalid Http response; nested exception is java.io.IOException: Invalid Http response
有人有什么想法吗?
我调试到resttemplate并且请求形成正常,但是返回的httpStatusCd是-1。
谢谢