目前我正在工作在Spring Boot微服务项目。考虑我有3个微服务,分别命名为A、B、C。现在我的项目为每个微服务单独application.yml文件。现在我想再添加一个微服务D,用于管理所有服务属性文件。
查看我的配置-服务结构
Eureka.yml(内部配置服务)文件是:
server:
port: 8761
eureka:
client:
registerWithEureka: false
fetchRegistry: false
server:
waitTimeInMsWhenSyncEmpty: 0
endpoints:
sensitive: false
在eureka-servicebootstrap.properties是:
spring:
application:
name: eureka
cloud:
config:
uri: http://localhost:8888
配置服务应用程序属性:
spring:
application:
name: config
cloud:
config:
server:
native:
search-locations: classpath:/config/DEVELOP
profiles:
active: native
server:
port: 8888
我的配置应用程序文件是:
@SpringBootApplication
@EnableConfigServer
public class ConfigApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigApplication.class, args);
}
}
我做了以下步骤:
不幸的是,尤里卡服务器出现错误。
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
问题是在运行eureka服务器时,它没有查看配置服务中的配置文件...
帮我解决这个问题。或者代替微服务,我如何使用文件夹?
感谢@ g00glen00b
我更改配置服务引导yml如下:
spring:
application:
name: config
cloud:
config:
server:
native:
searchLocations: classpath:/config/DEVELOP/
profiles:
active: native
server:
port: 8888
工作正常。