springcloud - config统一配置管理
2019-10-17 19:25
239 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_41997060/article/details/102613328
什么是统一配置管理
spring cloud config为分布式系统外部配置提供了服务器和客户端的支持,他包括config server和config client 两部分,由于config server和config client 都实现了对spring ervironment(环境)和property source(属性源)抽象映射,因此,spring cloudconfig非常适合spring应用程序,当然也可以与任何其他语言编写的应用程序配合使用
config server是一个可横向拓展,集中式的配置服务器,他用于集中管理应用程序各个环境下的配置,默认使用git存储配置内容.因此可以很方便的实现对配置的版本控制与内容审计.
config client 是config server的客户端,用于操作存储在config server中的配置属性.
为什么要统一配置管理
配置集中管理
不同环境不同配置
运行期间动态调整配置
自动刷新
架构图
代码实现
该项目(jwxt-config)必须也是eureka服务
- 在github上创建文件
2.pom.xml
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency>
3.application.yml
spring: application: name: jwxt-config #指定服务名 cloud: config: label: master server: git: uri: https://github.com/hanxuesong123/jwxt-config username: 1323232302@qq.com password: hanzhibin1
- 启动类
@EnableConfigServer
pom.xml
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency>
application.xml
spring: cloud: config: uri: http://localhost:8888 label: master name: application-teacher profile: dev
相关文章推荐
- .NET Core微服务之基于Steeltoe使用Spring Cloud Config统一管理配置
- spring cloud :统一管理配置文件config
- 学习微服务的统一配置管理-springCloud config+git
- 详解使用spring cloud config来统一管理配置文件
- .NET Core微服务之基于Steeltoe使用Spring Cloud Config统一管理配置
- Spring Cloud版——电影售票系统<六>使用 Spring Cloud Config 统一管理微服务配置
- spring cloud config 统一配置管理
- 嗡汤圆的Spring Cloud自学(PART.1):统一配置管理(Cloud-config)
- Spring Cloud Config统一管理微服务配置
- SpringCloud微服务(06):Config组件,实现配置统一管理
- SpringCloud--SpringCloud Config构建统一微服务管理配置中心
- spring基础:快速入门spring cloud(6):统一配置管理之spring cloud config
- Spring Cloud Config集中式配置管理使用
- SpringCloud的配置管理:Spring Cloud Config
- 在 Golang 项目中使用 Spring Cloud Config Server 管理配置
- spring cloud config 统一配置中心 读取Git/SVN/本地文件配置及动态刷新
- 在 Golang 项目中使用 Spring Cloud Config Server 管理配置
- springboot+cloud 学习(五)统一配置中心 spring cloud config + cloud bus + WebHooks +RibbitMQ
- 统一配置服务——spring cloud config
- Spring Boot + Spring Cloud 实现权限管理系统 后端篇(二十三):配置中心(Config、Bus)