spring-cloud-config-server——Environment Repository
参考资料:
http://cloud.spring.io/spring-cloud-static/Camden.SR7/#_environment_repository
Environment Repository——环境库
你要在哪里存储Config Server的配置数据呢?管理这种行为的策略是为Enviroment对象提供服务的EnvironmentRepository。这个Enviroment是Spring Environment域的一个浅层副本(包括propertySources作为主要功能)。Environment资源由三个变量参数化:
- {application} maps to "spring.application.name" on the client side;——{application}映射到客户端的"spring.application.name";
- {profile} maps to "spring.profiles.active" on the client (comma separated list);——{profile}映射到客户端的 "spring.profiles.active"(逗号分割列表);
- {label} which is a server side feature labelling a "versioned" set of config files.——{label}是服务端功能,标记"版本化"的配置文件集。
版本库实现通常像Spring Boot应用程序一样从“spring.config.name”加载配置文件,等同于{application}参数,而“spring.profiles.active”等同于{profiles}参数。配置文件的优先级规则也与常规的Boot应用程序中的规则相同:活动配置文件优先于默认配置,并且如果有多个配置文件,则最后一个配置文件将胜出(如向Map添加条目)。
例如,客户端应用程序具有此引导配置:
bootstrap.yml
spring:
application:
name: foo
profiles:
active: dev,mysql
(通常使用Spring Boot应用程序,这些属性也可以设置为环境变量或命令行参数)
如果存储库是基于文件的,则服务器将从application.yml(所有客户端之间共享)和foo.yml(以yoo.yml优先)创建一个Environment。如果YAML文件中有指向Spring配置文件的文档,那么这些文件将以更高的优先级(按列出的配置文件的顺序)应用,如果有特定于配置文件的YAML(或属性)文件,则这些文件的优先级高于默认值。较高的优先级转换为Environment之前列出的PropertySource.(这些规则于独立的Spring Boot应用程序相同)。
spring-cloud-config-server——Environment Repository的更多相关文章
- Spring Cloud Config Server 节点迁移引起的问题,请格外注意这一点!
前言: 虽然强烈推荐选择使用国内开源的配置中心,如携程开源的 Apollo 配置中心.阿里开源的 Nacos 注册&配置中心. 但实际架构选型时,根据实际项目规模.业务复杂性等因素,有的项目还 ...
- 为Spring Cloud Config Server配置远程git仓库
简介 虽然在开发过程,在本地创建git仓库操作起来非常方便,但是在实际项目应用中,多个项目组需要通过一个中心服务器来共享配置,所以Spring Cloud配置中心支持远程git仓库,以使分散的项目组更 ...
- ubuntu14.04 spring cloud config server + gradle搭建
Server端:在eclipse上,创建Java Project项目.自带的src包删掉手动建文件夹.基础的目录文件都创建上 |--ZSpringCloud|--build.gradle|----sr ...
- Spring Cloud config之三:config-server因为server端和client端的健康检查导致服务超时阻塞问题
springcloud线上一个问题,当config-server连不上git时,微服务集群慢慢的都挂掉. 在入口层增加了日志跟踪问题: org.springframework.cloud.config ...
- 网络原因导致的 spring cloud config 读取git上的配置文件时报错:Cannot clone or checkout repository
今天在公司使用spring cloud config搭建配置中心的时候,出现了读取不到git库的问题:Cannot clone or checkout repository.在网上百度,前面几个答案都 ...
- Spring Cloud Config
Spring Cloud Config provides server and client-side support for externalized configuration in a dist ...
- Spring Cloud官方文档中文版-Spring Cloud Config(上)
官方文档地址为:http://cloud.spring.io/spring-cloud-static/Dalston.SR2/#spring-cloud-feign 文中例子我做了一些测试在:http ...
- spring cloud config服务器
Spring Cloud Config提供了一种在分布式系统中外部化配置服务器和客户端的支持.配置服务器有一个中心位置,管理所有环境下的应用的外部属性.客户端和服务器映射到相同Spring Event ...
- Spring Cloud Config中文文档
https://springcloud.cc/spring-cloud-config.html 目录 快速开始 客户端使用 Spring Cloud Config服务器 环境库 健康指标 安全 加密和 ...
- Spring Cloud config之二:功能介绍
SVN配置仓库 示例见:http://lvdccyb.iteye.com/blog/2282407 本地仓库 本地文件系统 使用本地加载配置文件.需要配置:spring.cloud.config.se ...
随机推荐
- java.lang.NoClassDefFoundError 错误
练习jfianl,,,配置数据库插件的时候遇到: java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/ComboPooledDataSource 解 ...
- PHP面试大全 基础篇100道问题
2017年3月7日14:23:21 其实计划很久但是移植没时间去收集和处理弄成一个完整的文件 SVN地址: https://git.oschina.net/zxadmin/live_z 目前基础部分更 ...
- String类,ThreadLocal
1,StringBuffer修改缓冲区的方法是同步的 单任务使用StringBuilder更有效 2,replace和replaceAll方法区别 3,spilt方法 a,b,c ...
- POJ 3126 - Prime Path - [线性筛+BFS]
题目链接:http://poj.org/problem?id=3126 题意: 给定两个四位素数 $a,b$,要求把 $a$ 变换到 $b$.变换的过程每次只能改动一个数,要保证每次变换出来的数都是一 ...
- spark组件笔记
SparkContext 中最重要的3个组建: 1 TaskScheduler (包含两个内容,TaskSchedulerImpl和SparkDeploySchedulerBackend)-用于向Ma ...
- Storm UI说明
一.Storm ui 首页主要分为4块: Cluster Summary,Topology summary,Supervisor summary,Nimbus Configuration Cluste ...
- [vue]mvc模式和mvvm模式及vue学习思路(废弃)
好久不写东西了,感觉收生疏了, 学习使用以思路为主, 记录笔记为辅作用. v-if: http://www.cnblogs.com/iiiiiher/p/9025532.html v-show tem ...
- 【UML】NO.50.EBook.5.UML.1.010-【UML 大战需求分析】- 考勤系统
1.0.0 Summary Tittle:[UML]NO.50.EBook.1.UML.1.010-[UML 大战需求分析]- 考勤系统 Style:DesignPattern Series:Desi ...
- js对象属性名驼峰式转下划线
一.题目示例: 思路: 1.匹配属性名字符串中的大写字母和数字 2.通过匹配后的lastIndex属性获取匹配到的大写字母和数字的位置 3.判断大写字母的位置是否为首位置以及lastIndex是否为0 ...
- 笔记-ASP.NET WebApi
本文是针对ASP.NET WepApi 2 的笔记. Web API 可返回的结果: 1.void 2.HttpResponseMessage 3.IHttpActionResult 4.其他类型 返 ...