spring cloud config 小坑

2017-11-18  本文已影响0人  hikaru小刚

文件格式

建议统一使用yml,对中文支持好,properties需要转码。

文件编码(统一utf8)

很多同学喜欢用其他编辑器创建或者编辑yml文件,而未注意编码,造成配置中心获取yml文件错误。

config server 运行一段时间后获取不到最新的配置文件。

添加spring.cloud.config.server.git.force-pull=true 强制获取更新.

config server 运行一段时间后发现获取不到配置.

默认config server 会将仓库克隆到临时仓库(/tmp),但是tmp目录系统会定时清理,
更改仓库的目录配置 spring.cloud.config.server.git.basedir=/opt/hnconfig

上一篇下一篇

猜你喜欢

热点阅读