01 Spring Cloud Config 实现配置中心
Spring Cloud官网: https://spring.io/projects/spring-cloud 本篇主要讲 Spring Cloud Config ,参考内容如下: Spring Cloud Config 2.2.1.RELEASE参考文档 Spring Cloud Config 实现配置中心,看这一篇就够了 实现简单的配置中心 配置文件就在Spring官方提供的配置仓库:https://github.com/spring-cloud-samples/config-repo 1 创建配置中心服务端 完整代码参考: https://github.com/sxpujs/spring-cloud-examples/tree/master/config/config-server 1 新建Spring Boot项目,引入config-server <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency> 2 配置config相关的配置项 bootstrap.yml spring: application: name: foo # 应用名 profiles: active: dev