1.检查config server 是否能正常访问
2.检查config client配置:
1)必须是"bootstrap"命名的引导配置文件
2)
spring:
application:
name: 这里配置的名称需要与远程库的配置文件名称一致 或者使用spring.cloud.config.name = xxx 来指定(多个使用逗号分割)
cloud:
config:
enabled: true # 默认开启
label: master # 指明远程仓库的分支
profile: test #
# uri: http://127.0.0.1:8098/ # 使用该属性指明配置服务中心的地址
discovery: # 或者从eureka服务注册中心获取服务
enabled: true
service-id: config-server
3) 启动发现抓取配置文件地址为:Fetching config from server at: http://localhost:8888
可能是配置文件名称不是"bootstrap"导致
或者java build path问题,如图eclipse java build path没有加入src/main/resources:
将excluded** 删掉即可