Spring Cloud Config配置中心搭建

虽然不是第一次搭建了,但是每次搭建这些东西都是会有新的问题出现

首先是搭建配置中心服务端

spring:
  security:
    basic:
      enabled: false
    user:
      name: root
      password: booszy
  application:
    name: config-server
  cloud:
    config:
      server:
        git:
          uri: git@config-profile.git
          searchPaths: #'{application}'

这里要说说这个 searchPaths,它意思是首先通过应用的 application: name: 定位到查询开始的根目录,然后再通过 searchPaths定位到具体的应用

然后

@EnableConfigServer

 

最后在这个git里按照网上的路径说明就可以启动启动起来

http://localhost:8200/configserver/应用名称/环境名称/master (分支默认master)

最后遗留的一个问题是,难道一个产品就要单独搭建一个配置中心?

 

posted @ 2018-12-14 10:39  举起希望之灯  阅读(319)  评论(0编辑  收藏  举报