博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
第七篇: 分布式配置中心(Greenwich版)
阅读量:4182 次
发布时间:2019-05-26

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

改造eureka-server

4.0.0
eureka-server
0.0.1-SNAPSHOT
eureka-server
eureka-server project for Spring Boot
com.xiaobu
springcloud-demo
0.0.1-SNAPSHOT
org.springframework.cloud
spring-cloud-starter-netflix-eureka-server
org.springframework.cloud
spring-cloud-starter-netflix-eureka-client
org.springframework.cloud
spring-cloud-config-server
org.springframework.cloud
spring-cloud-dependencies
${spring-cloud.version}
pom
import
org.springframework.boot
spring-boot-maven-plugin

改造config-server

4.0.0
com.xiaobu
springcloud-demo
0.0.1-SNAPSHOT
config-server
0.0.1-SNAPSHOT
config-server
config-server project for Spring Boot
UTF-8
UTF-8
1.8
org.springframework.cloud
spring-cloud-dependencies
${spring-cloud.version}
pom
import
org.springframework.boot
spring-boot-starter
org.springframework.cloud
spring-cloud-config-server
org.springframework.cloud
spring-cloud-starter-netflix-eureka-client
org.springframework.boot
spring-boot-maven-plugin
org.apache.maven.plugins
maven-compiler-plugin
1.8
1.8
UTF-8
server.port=7001spring.application.name=config-server#配置Git仓库的地址spring.cloud.config.server.git.uri=https://gitee.com/xiaobu1994/spring-cloud-learning#配置仓库路径下的相对搜索位置,可以配置多个spring.cloud.config.server.git.search-paths=spring-cloud-config-file#这里配置你的Git仓库的用户名spring.cloud.config.server.git.username=username#这里配置你的Git仓库的密码spring.cloud.config.server.git.password=passwordeureka.client.serviceUrl.defaultZone=http://localhost:8001/eureka/

改造config-client

4.0.0
com.xiaobu
springcloud-demo
0.0.1-SNAPSHOT
config-client
0.0.1-SNAPSHOT
config-client
config-client project for Spring Boot
1.8
org.springframework.cloud
spring-cloud-dependencies
${spring-cloud.version}
pom
import
org.springframework.boot
spring-boot-starter
org.springframework.cloud
spring-cloud-starter-config
org.springframework.cloud
spring-cloud-starter-netflix-eureka-client
org.springframework.boot
spring-boot-maven-plugin

bootstrap.properties

# 从config-server获取配置信息#server.port=7002#{application}#spring.application.name=xiaobu#{profile}#spring.cloud.config.profile=dev#{label}#spring.cloud.config.label=master# spring.cloud.config.uri=http://localhost:7001/# 从eureka-server获取配置信息#{application}spring.application.name=xiaobu#{profile}spring.cloud.config.profile=dev#{label}spring.cloud.config.label=masterspring.cloud.config.uri= http://localhost:7001/eureka.client.serviceUrl.defaultZone=http://localhost:8001/eureka/spring.cloud.config.discovery.enabled=truespring.cloud.config.discovery.serviceId=config-serverserver.port=7002

一次启动eureka-server、config-server、config-client

访问 http://localhost:8001/ 如下:

1610444595.jpg

访问 http://localhost:7002/from

git-dev-1.0

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

你可能感兴趣的文章
拷贝整个目录到另一台服务器并排除log目录
查看>>
拜托,面试别再问我跳表了!
查看>>
android ArrayList<String> 转 String[]
查看>>
RecyclerView baseadapter
查看>>
Android中应用程序如何获得系统签名权限
查看>>
Recycler表格(excelPanel)
查看>>
android一行代码实现沉浸式布局效果
查看>>
json, recyclerView问题
查看>>
cmake处理多源文件目录的方法
查看>>
Service Intent must be explicit
查看>>
android studio SDK开发
查看>>
studio 统计代码的行数
查看>>
字符数组和16进制互换
查看>>
PHP项目中出现致命错误: Class 'Redis' not found
查看>>
There is no tracking information for the current branch.
查看>>
fatal: refusing to merge unrelated histories
查看>>
Git命令还原未提交的变更
查看>>
Linux系统中环境变量的配置
查看>>
Linux系统中配置脚本程序开机启动
查看>>
让Linux系统上的nginx支持php程序
查看>>