spring 多环境配置管理最佳实践是什么?

2020-04-02 17:09:10 +08:00
 zhuwd

遇到越来越复杂的项目,不同的环境、不同的分支都会有不同的配置文件,管理起来也越来越混乱,想请教各位前辈有没有比较好的管理思路

3097 次点击
所在节点    Java
12 条回复
Smilencer
2020-04-02 17:22:27 +08:00
maven profile 或者 spring profile,二选一
Jafee
2020-04-02 18:03:16 +08:00
使用 spring profile 方便点吧,每个环境一个配置文件。
Yuicon
2020-04-02 18:06:24 +08:00
配置中心
saximoer
2020-04-02 18:11:04 +08:00
配置中心+10086
根据 profile 区分即可
sprit
2020-04-02 18:11:33 +08:00
Apollo
rockyou12
2020-04-02 18:11:48 +08:00
spring cloud config + profile 功能可以拯救你
huskyui
2020-04-02 18:12:40 +08:00
后辈来一句 spring cloud config
Aresxue
2020-04-02 18:12:47 +08:00
不超过十个 spring 自己够用, 超过十个上个配置中心好了, 比如 nacos
chendy
2020-04-02 18:27:09 +08:00
spring 自己的 profile + 配置中心
xuanbg
2020-04-02 23:30:35 +08:00
最简单的解决方案就是 spring cloud config
yiyi11
2020-04-03 05:37:51 +08:00
用配置中心,国产的 nacos,apollo,外国的 consul 。纯用做配置管理的话 apollo 最好,但是 nacos 和 consul 还有个好处是它们还是服务注册中心,所以看你的项目技术栈选择。
WhereverYouGo
2020-04-03 14:25:19 +08:00
Apollo +1

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/658725

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX