Spring Cloud Config 使用SVN 和 git方式的相关配置
文件的存储方式:
1、使用svn 当做配置中心 config server的配置方式:
引入svn的包
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.10</version>
</dependency>
修改application.yml
我的svn路径是 http://ip:port/svn/mogo/Coding/app-hotpoint-parent/app-global-config/config-repo
spring:
application:
name: app-provider-config
cloud:
config:
enabled: true
server:
svn:
uri: http://ip:port/svn/mogo/Coding/app-hotpoint-parent/app-global-config
username: username
password: password
default-label: config-repo
profiles:
active: subversion
config client 的配置
bootstrap.yml
spring:
application:
name: config-client # 这里要跟文件(config-client-dev.yml)的前面的application段相同
cloud:
config:
label: config-repo
uri: http://localhost:7805
name: config-client
profiles:
active: dev
至于其余的端口什么的,放在application.yml中即可
2、使用git 当做文件存储方式
config server 的 application.yml
spring:
application:
name: app-provider-config
cloud:
config:
server:
git:
uri: git@code.aliyun.com:.............
search-paths: config-repo/div,config-repo/test
username: username
password: password
label: master logging:
level:
org.springframework.boot.env.PropertySourcesLoader: TRACE
org.springframework.cloud.config.server: DEBUG server:
port: 7805
eureka:
client:
serviceUrl:
defaultZone: ...........
instance:
ip-address: true
instance-id: ${spring.application.name}:${spring.application.instance_id:${server.port}}
config client 的 bootstrap.yml
spring:
application:
name: app-provider-ams
cloud:
config:
label: master
uri: http://localhost:7805
discovery:
enabled: true
service-id: app-provider-config
fail-fast: true
profiles:
active: dev
eureka:
client:
serviceUrl:
defaultZone: ..........
instance:
ip-address: true
instance-id: ${spring.application.name}:${spring.application.instance_id:${server.port}}
management:
endpoints:
web:
exposure:
include: refresh,health,info
单点刷新
需要引入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
2.0 版本以上需要加一下
management:
endpoints:
web:
exposure:
include: refresh,health,info
接下来刷新路径是 /actuator/refresh
Spring Cloud Config 使用SVN 和 git方式的相关配置的更多相关文章
- Spring Cloud Config(三):基于JDBC搭建配置中心
1.简介 本文主要内容是基于jdbc搭建配置中心,使应用从配置中心读取配置信息并成功注册到注册中心,关于配置信息表结构仅供参考,大家可以根据具体需要进行扩展. 2.Config Server 搭建 2 ...
- 微服务SpringCloud之Spring Cloud Config配置中心Git
微服务以单个接口为颗粒度,一个接口可能就是一个项目,如果每个项目都包含一个配置文件,一个系统可能有几十或上百个小项目组成,那配置文件也会有好多,对后续修改维护也是比较麻烦,就和前面的服务注册一样,服务 ...
- 微服务SpringCloud之Spring Cloud Config配置中心SVN
在回来的路上看到一个个的都抱着花,吃了一路的狗粮,原本想着去旁边的工业园里跑跑步呢,想想还是算了,人家过七夕,俺们过巴西.上一博客学习了Spring Cloud Config使用git作为配置中心,本 ...
- Spring Cloud Config采用Git存储时两种常用的配置策略
由于Spring Cloud Config默认采用了Git存储,相信很多团队在使用Spring Cloud的配置中心时也会采用这样的策略.即便大家都使用了Git存储,可能还有各种不同的配置方式,本文就 ...
- Spring Cloud官方文档中文版-Spring Cloud Config(上)
官方文档地址为:http://cloud.spring.io/spring-cloud-static/Dalston.SR2/#spring-cloud-feign 文中例子我做了一些测试在:http ...
- Spring Boot + Spring Cloud 构建微服务系统(九):配置中心(Spring Cloud Config)
技术背景 如今微服务架构盛行,在分布式系统中,项目日益庞大,子项目日益增多,每个项目都散落着各种配置文件,且随着服务的增加而不断增多.此时,往往某一个基础服务信息变更,都会导致一系列服务的更新和重启, ...
- 对spring cloud config的一点理解
以下部分纯属个人理解,但是结果都是经过demo验证. 一.spring cloud config介绍 spring cloud是spring家族中的一个微服务工具包,其中包含了很多微服务的工具.偏向于 ...
- Spring Cloud Config中文文档
https://springcloud.cc/spring-cloud-config.html 目录 快速开始 客户端使用 Spring Cloud Config服务器 环境库 健康指标 安全 加密和 ...
- 跟我学SpringCloud | 第六篇:Spring Cloud Config Github配置中心
SpringCloud系列教程 | 第六篇:Spring Cloud Config Github配置中心 Springboot: 2.1.6.RELEASE SpringCloud: Greenwic ...
随机推荐
- delphi之IOCP学习(一)
困扰已久的网络通信(IOCP:完成端口),今天终于揭开她的神秘面纱了,之前百度N久还是未能理解IOCP,网络上好多博文都没有贴出源码,初学者很难正在理解IOCP并自己写出通信例子 ,经过努力,今天自己 ...
- qt的应用层主要是大型3d,vr,管理软件和器械嵌入软件(有上千个下一代软件黑科技项目是qt的,美国宇航局,欧洲宇航局,超级战舰DDG1000)
作者:Nebula.Trek链接:https://www.zhihu.com/question/24316868/answer/118944490来源:知乎著作权归作者所有.商业转载请联系作者获得授权 ...
- python3 操作注册表
1.1 读取 import winreg key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,r"Software\Microsoft\Windows ...
- ASP.NET Core 登录登出 - ASP.NET Core 基础教程 - 简单教程,简单编程
原文:ASP.NET Core 登录登出 - ASP.NET Core 基础教程 - 简单教程,简单编程 ASP.NET Core 登录登出 上一章节我们总算完善了注册的功能,而且也添加了一个用户,现 ...
- java线:辛格尔顿隐藏ThreadLocal实现线程数据共享
效果图分享: A和B需要共享同一线程,还有一组的相同A和B共享还有一组线程,两组相互之间不受影响. 代码: package cn.itcast.lesson6; import java.util.Ra ...
- WPF ListView控件设置奇偶行背景色交替变换以及ListViewItem鼠标悬停动画
原文:WPF ListView控件设置奇偶行背景色交替变换以及ListViewItem鼠标悬停动画 利用WPF的ListView控件实现类似于Winform中DataGrid行背景色交替变换的效果,同 ...
- WPF x:Array的使用
<Window x:Class="XamlTest.Window1" xmlns="http://schemas.microsoft.com/winf ...
- 【C#】获取"我的电脑"的名字,如This PC、这台计算机
原文:[C#]获取"我的电脑"的名字,如This PC.这台计算机 注意:这里获取的[我的电脑]的名字,不是机器的名字.如图所示: 要获取的是This PC这个字符串. ----- ...
- centos7 防火墙问题
centos从7开始默认用的是firewalld,这个是基于iptables的,虽然有iptables的核心,但是iptables的服务是没安装的.所以你只要停止firewalld服务即可:sudo ...
- DevExpress的xtraMessageBox汉化
原文:DevExpress的xtraMessageBox汉化 项目使用的界面库是DevExpress 相当好用,不过里面弹出对话框XtraMessageBox的按钮都是英文的, 可能会对用户造成困扰, ...