一.新建spring boot项目

Spring cloud(三) Config center 配置中心

Spring cloud(三) Config center 配置中心

Spring cloud(三) Config center 配置中心

二.注解@EnableConfigServer

@EnableDiscoveryClient
@EnableConfigServer
@SpringBootApplication
public class ConfigServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigServerApplication.class, args);
    }

}

三.创建git远程配置中心仓库

四.application.yml 配置文件

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka/
spring:
  application:
    name: config
  cloud:
    config:
      server:
        git:
          uri: https://gitee.com/xxxxxx/springcloud-config.git       //远程仓库地址
          basedir: /Users/wuyahan/Desktop/codes/springcloud/basedir  //本地保存配置文件目录
          username: username   //git账号
          password: password   //git密码
server:
  port: 8083

五.启动配置中心服务,网址访问http://localhost:8083/order-test.yml

Spring cloud(三) Config center 配置中心

 

相关文章:

  • 2021-11-07
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2021-11-02
猜你喜欢
  • 2021-08-14
  • 2022-12-23
  • 2021-11-10
  • 2021-11-20
  • 2021-10-15
  • 2021-07-23
相关资源
相似解决方案