文件的存储方式:

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

最新文章

  1. 爬虫6:多页面增量Java爬虫-sina主页
  2. 搜索 + 剪枝 --- POJ 1101 : Sticks
  3. AsyncTask的注意事项
  4. MITK Tutorial(二)
  5. 根据id设置、获取元素的文本和value
  6. Ubuntu Mysql开通外网访问权限
  7. Spring定时任务quartz表达式
  8. Elasticsearch JAVA api搞定groupBy聚合
  9. 为什么使用正则test( )第一次是 true,第二次是false?
  10. matplotlib figure图像-【老鱼学matplotlib】
  11. yarn安装
  12. 30个php操作redis常用方法代码例子(转载)
  13. linux 查看cpu的使用百分比
  14. Hbase建表时遇到的问题This could be a sign that the server has too many connections
  15. Win10环境Tensorflow-GPU13.1/JupyterNotebook的安装
  16. 第二个spring冲刺第6天
  17. Android组件化之终极方案
  18. 查看linux安装包的版本信息-TX2
  19. opencv-python教程学习系列5-处理鼠标事件
  20. 【STL学习】堆相关算法详解与C++编程实现(Heap)

热门文章

  1. twemproxy
  2. 使用CMD实现批量重命名[转]
  3. (记录)mysql分页查询,参数化过程的坑
  4. blockchain_eth客户端安装 &amp; geth使用 &amp;批量转账(一)
  5. 向WPF的Grid里面增加控件
  6. 通通玩blend美工(5)——旋转木马,交互性设计
  7. C#开发奇技淫巧一:调试windows系统服务
  8. WPF控件TextBlock中文字自动换行
  9. 详解 Java 8 HashMap 实现原理
  10. C++得到当前进程所占用的内存