spring-cloud-config笔记
spring-cloud-config 简单来讲就是spring-cloud实现的分布式配置中心.与之前介绍的开源配置服务方案 disconf是一样的,spring-cloud-config分为服务与客户两端
spring-cloud-config 使用git或者svn 甚至是本地的文件系统作为配置文件的仓库
spring-cloud-config 用application,profile,label 三个维度来实现分布式配置管理和发布.
application : 使用spring-cloud-config服务的客户端名称
profile : 这个很好理, manve的profile概念基本一致 可以理解成环境
lable : 这个可以理解成版本,如果使用的是git作为配置管理的仓库,label可以是分支名,tag的名称
spring-cloud-config的原理就是 将远程git仓库中的配置文件clone到本地临时目录并加载至内存中
spring-cloud-config客户端通过URL的形式来获取配置,spring官网的介绍如下
/{application}/{profile}[/{label}] /{application}-{profile}.yml /{label}/{application}-{profile}.yml /{application}-{profile}.properties /{label}/{application}-{profile}.properties
客户端可以通过http GET 请求直接获取spring-cloud-server的配置,实际应用中则不需要这样获取,只需要配置服务的host即可,如果使用Eureka,则只需要配置服务端的服务即可
与开源方案disconf的对比
控制台:
disconf : 拥有自己的web界面管理配置
spring-cloud-config: 没有web界面维护配置,主要靠git,svn等操作管理配置
推拉模型:
disconfi: 通过zookeeper实现推模型,拉模型
spring-cloud-config: 通过git,svn实现 推拉模型
配置存储:
disconf: 通过数据库存储配置
spring-cloud-config:通过git,以及本地文件的形式存储配置文件
配置管理及发布:
disconf : 拥有 环境,app,version 管理及发布配置.
spring-cloud-config : 通过 application,profile , label 管理发布配置
部署:
disconf: web程序,既是控制台也是服务,高可用方案依赖nginx,zookeeper
spring-cloud-config: spring-boot程序, 高可用方案依赖spring-cloud技术方案
通过对比,disconf的优势是管理配置简单,而spring-cloud-config的优势是与我们的spring-cloud技术方案完美的集成,不需要单独的考虑高可用方案
而且spring-cloud-config部署方式也优于disconf,使用git对于程序员非常的熟悉,而且git天生对版本的支持也是spring-cloud-config的优势 鸣谢崔老大.
最新文章
- DuiLib 源码分析之解析xml类CMarkup &; CMarkupNode cpp文件
- Elasticsearch推荐插件篇(head,sense,marvel)
- 了解了这些才能开始发挥jQuery的威力(转)
- BerkeleyDB 多索引查询
- UIViewAnimationOptions swift 2
- 计算机网络——TCP与UDP协议详解
- CentOS 报no acceptable C compiler found in $PATH的解决办法
- 洛谷 P2279 03湖南 消防局的设立
- 《C语言程序设计现代方法》第4章 表达式
- 最长回文 HDU 3068 (裸的Manacher)
- DbUtility-关于DataTable转成List的效率问题
- 7_Table Views
- 包含中文字符的NSString 转换为NSURL
- 【机器学习实战】Machine Learning in Action 代码 视频 项目案例
- openGL learning
- (原)matlab导出oracle中blob的jpg数据到图片
- POJ2311 Cutting Game 博弈 SG函数
- .Net Core Api 跨域配置
- u3d一个GameObject绑定两个AudioSource
- 170320、使用快照和AOF将Redis数据持久化到硬盘中