forezp / blog-comments

3 stars 0 forks source link

SpringCloud教程第6篇:config - 方志朋的博客 #118

Open forezp opened 5 years ago

forezp commented 5 years ago

https://www.fangzhipeng.com/springcloud/2017/06/06/sc06-config.html

在上一篇文章讲述zuul的时候,已经提到过,使用配置服务来保存各个服务的配置文件。它就是Spring Cloud Config。

GYFgaoyuefei commented 5 years ago

prefect

PlantAsh commented 5 years ago

请问一下为什么没有在配置文件填写注册中心信息也能注册服务

wcfb commented 5 years ago

请问一下,为啥修改一下端口号就会提示查找不到那个foo

suvue commented 5 years ago

感谢!

lhlh1992 commented 5 years ago

同问,配置文件没有配置服务注册中心的任何东西,但是启动config-server必须得启动之前的Eureka-server,这里不太明白

hexhero commented 5 years ago

@PlantAsh 请问一下为什么没有在配置文件填写注册中心信息也能注册服务

是否注册服务取决于spring.cloud.config.uri= http://localhost:8888/ 使用服务名还是物理地址

JunJieYuki commented 5 years ago

我在配置config-client的时候,发现了一个问题,我总是在fetch对应的config-server的时候,等待很久,从而最终导致服务启动失败。 后来才意识到,好像需要把信息写在bootstrap配置文件中,关于application与bootstrap配置文件的区别如下:

bootstrap.yml(bootstrap.properties)用来程序引导时执行,应用于更加早期配置信息读取,如可以使用来配置application.yml中使用到参数等

application.yml(application.properties) 应用程序特有配置信息,可以用来配置后续各个模块中需使用的公共参数等。

bootstrap.yml 先于 application.yml 加载