1,下载源码

地址https://spring.io/guides/gs/centralized-configuration/

2,导入工程

解压后分别把Server端与Client端导入到两个Eclipse中,以便测试

3,修改源码中pom.xml为如下形式

    <dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

4,修改Server端配置,采用本地仓库

spring.cloud.config.server.git.uri=d:/config

5,创建本地仓库

在d:\config目录新增文件a-bootiful-client.properties,文件内容只需一行

message = Hello Terry

在dos下下执行git命令

git init;

git add a-bootiful-client.properties

git commit -m 'first bommit'

6,启动服务端以及客户端,访问http://localhost:92/message,就能看到程序运行结果

参照文档:https://spring.io/guides/gs/centralized-configuration/

初尝Spring Cloud Config的更多相关文章

  1. spring cloud config 入门

    简介 Spring cloud config 分为两部分 server client config-server 配置服务端,服务管理配置信息 config-client 客户端,客户端调用serve ...

  2. Spring Cloud Config

    Spring Cloud Config provides server and client-side support for externalized configuration in a dist ...

  3. Spring Cloud官方文档中文版-Spring Cloud Config(上)

    官方文档地址为:http://cloud.spring.io/spring-cloud-static/Dalston.SR2/#spring-cloud-feign 文中例子我做了一些测试在:http ...

  4. Spring Cloud官方文档中文版-Spring Cloud Config(下)-客户端等

    官方文档地址为:http://cloud.spring.io/spring-cloud-static/Dalston.SR2/#_serving_alternative_formats 文中例子我做了 ...

  5. SpringCloud的配置管理:Spring Cloud Config

    演示如何使用ConfigServer提供统一的参数配置服务 ###################################################################一.概 ...

  6. 搭建spring cloud config

    很久没更新了,因为不是专职研究spring cloud,因此更新速度得看工作强度大不大,每天能抽出的时间不多,如果更新太慢了,并且有小伙伴看的话,请见谅了. Spring Cloud简介 Spring ...

  7. Spring Cloud Config - RSA简介以及使用RSA加密配置文件

    简介 RSA非对称加密有着非常强大的安全性,HTTPS的SSL加密就是使用这种方法进行HTTPS请求加密传输的.因为RSA算法会涉及Private Key和Public Key分别用来加密和解密,所以 ...

  8. Spring Cloud Config 分布式配置中心使用教程

    一.简介 在分布式系统中,由于服务数量巨多,为了方便服务配置文件统一管理,实时更新,所以需要分布式配置中心组件.在Spring Cloud中,有分布式配置中心组件spring cloud config ...

  9. 【spring实战第五版遇到的坑】第14章spring.cloud.config.uri和token配置项无效

    本文使用的Spring Boot版本为:2.1.4.RELEASE Spring Cloud版本为:Greenwich.SR1 按照书上的做法,在application.yml中配置配置服务器的地址和 ...

随机推荐

  1. lxml.etree.HTML(text) 解析HTML文档

    0.参考 http://lxml.de/tutorial.html#the-xml-function There is also a corresponding function HTML() for ...

  2. Codeforces 431E Chemistry Experiment 线段树 + 二分

    Chemistry Experiment 维护一个权值线段树,然后二分答案. #include<bits/stdc++.h> #define LL long long #define LD ...

  3. vue-cli按需加载,懒加载组件

    vue来做一个单页面应用,当我们的项目越来越大,组件越来越多的时候,首次启动项目户特别慢,就算做一个加载框,蒙层之类的,体验也不会好,这个时候就需要按需加载 1.什么叫按需加载 所谓按需加载,顾名思义 ...

  4. 141. 环形链表 [JS Undefined类型的运用]

    [解析] 1.遍历每个节点 2.遍历过的节点用新的空间来标记 JS新的空间不用在使用前声明,用法参考实现. 3.如果遇到标记过的节点则是环形 [实现] /** * Definition for sin ...

  5. [POJ2559]Largest Rectangle in a Histogram (栈)

    题意 如图所示,在一条水平线上有n个宽为1的矩形,求包含于这些矩形的最大子矩形面积(图中的阴影部分的面积即所求答案). 思路 一个很老的,也是一个很好的题目. 维护一个单调栈即可. 不过在洛谷SP18 ...

  6. VUE重修01

    ---恢复内容开始--- 1.框架与库的区别 前端框架与库的区别? jquery 库 -> DOM(操作DOM) + 请求 art-template 库 -> 模板引擎 框架 = 全方位功 ...

  7. file_get_contents 在本地测试可以, 但在服务器上报错403

    解决方法: Most likely if you don't get any content while accessing an webpage, probably it doesn't want ...

  8. Laravel项目部署上线(阿里云 Ubuntu 16.04)

    第一次尝试把本地的项目上线,   购买了某云的轻量应用服务器, 镜像为Ubuntu 16.04  直接运行 apt-get install nginx 出错   根据提示运行 apt-get upda ...

  9. servlet 拦截器 (filter)

    使用: 创建一个类实现javax.servlet.Filter接口,并重写接口中所有的方法: 在web.xml配置所需要拦截的请求. 过程说明: 1>在应用启动的时候就进行装载Filter类(与 ...

  10. MTCP 在 64 位机器上不工作

    今天打开以前写的 MTCP, 却无法运行. 报错如下: Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: ...