SpringCloudConfigServer和Client记录

  • SpringCloudConfigServer
    还是SpringCloud引用组件的老套路.我自己总结的
  1. 引入组件依赖

       <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-config-server</artifactId>
         </dependency>
  2. 需要的在启动类加上注解这次的是@EableConfigServer

  3. 加上相应的配置

git那边的操作就不贴了

ConfigServer从git拉取配置文件的命名方式

第一种默认master分支下
name服务名 profiles环境 举例子 order-test(order服务测试环境)
根据名字访问到需要的配置文件,而且不需要重启究极方便!

  • ConfigServer的高可用
    其实这个很容易能想到,首先ConfigServer是一个springcloud的client在Eureka(微服务的高可用)的高可用中我就提到,client挂掉那么久多启动几个client同时往eureka上注册,ConfigClient是通过ConfigServer在Eureka上注册的注册名来通过eureka找到ConfigServer服务。

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。邮件至 wcfinyourheart@163.com

文章标题:SpringCloudConfigServer和Client记录

本文作者:wcf

发布时间:2020-05-01, 09:43:44

最后更新:2020-05-02, 15:50:51

原始链接:http://1007638786.github.io/2020/05/01/SpringCloudConfigServer%E5%92%8CClient%E8%AE%B0%E5%BD%95/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

目录
×

喜欢就点赞,疼爱就打赏