博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spring cloud微服务分布式云架构- Config 快速开始
阅读量:7197 次
发布时间:2019-06-29

本文共 1114 字,大约阅读时间需要 3 分钟。

启动服务器:

$ cd spring-cloud-config-server$ ../mvnw spring-boot:run复制代码

该服务器是一个Spring Boot应用程序,所以您可以从IDE运行它,而不是喜欢(主类是ConfigServerApplication)。然后尝试一个客户端:Spring Cloud大型企业分布式微服务云架构源码请加一七九一七四三三八零

$ curl localhost:8888/foo/development{"name":"development","label":"master","propertySources":[  {"name":"https://github.com/scratches/config-repo/foo-development.properties","source":{"bar":"spam"}},  {"name":"https://github.com/scratches/config-repo/foo.properties","source":{"foo":"bar"}}]}复制代码

定位资源的默认策略是克隆一个git仓库(在spring.cloud.config.server.git.uri),并使用它来初始化一个迷你SpringApplication。小应用程序的Environment用于枚举属性源并通过JSON端点发布。

HTTP服务具有以下格式的资源:

/{application}/{profile}[/{label}]/{application}-{profile}.yml/{label}/{application}-{profile}.yml/{application}-{profile}.properties/{label}/{application}-{profile}.properties复制代码

其中“应用程序”作为SpringApplication中的spring.config.name注入(即常规的Spring Boot应用程序中通常是“应用程序”),“配置文件”是活动配置文件(或逗号分隔列表的属性),“label”是可选的git标签(默认为“master”)。

Spring Cloud Config服务器从git存储库(必须提供)为远程客户端提供配置:

spring:  cloud:    config:      server:        git:          uri: https://github.com/spring-cloud-samples/config-repo复制代码

转载地址:http://jzakm.baihongyu.com/

你可能感兴趣的文章
v4l2
查看>>
JS倒计时
查看>>
(new Function("return " + json))();
查看>>
mscrm 4.0 报表服务器报错
查看>>
SVM原理简介
查看>>
TLV----Demo讲解
查看>>
Mermaid js与流程图、甘特图..
查看>>
什么是.Net的异步机制(线程间通信) - step 5
查看>>
Lambda应用设计模式
查看>>
解决svn异常报错“”cleanup failed to process the following paths …… previous operation has not finished”...
查看>>
富文本框--FreeTextBox的使用
查看>>
koa2使用阿里云oss的nodejs sdk实现上传图片
查看>>
简单select(2)
查看>>
pandas基础学习
查看>>
用实例一步步教你写Jquery插件
查看>>
Qt资源整理ING
查看>>
看看checksec
查看>>
1. Two Sum
查看>>
MySQL基础之 标准模式通配符
查看>>
聊一聊python的单例模式
查看>>