2019-06-12 config server 配置中心服务器端

1、pom 文件

        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    4.0.0

   

        org.springframework.boot

        spring-boot-starter-parent

        2.1.5.RELEASE

       

   

    com.zbiti

    configserver

    0.0.1-SNAPSHOT

    configserver

    Demo project for Spring Boot

   

        1.8

        Greenwich.SR1

   

   

       

            org.springframework.boot

            spring-boot-starter-web

       

       

            org.springframework.cloud

            spring-cloud-config-server

       

       

            org.springframework.cloud

            spring-cloud-starter-netflix-eureka-client

       

       

            org.springframework.boot

            spring-boot-starter-test

            test

       

   

   

       

           

                org.springframework.cloud

                spring-cloud-dependencies

                ${spring-cloud.version}

                pom

                import

           

       

   

   

       

           

                org.springframework.boot

                spring-boot-maven-plugin

           

       

   

2、application.yml

server:

  port: 1008

spring:

  application:

    name: config-server

  cloud:

    config:

      server:

        git:

            #uri 到新建文件夹之上

          uri: https://gitee.com/zbiti/springcloudconfig.git

            #文件夹

          search-paths:

            - config

    #分支

      label: master

eureka:

  client:

    service-url:

      defaultZone: http://localhost:1005/eureka/

    register-with-eureka: true

    fetch-registry: true

3、程序主类

@SpringBootApplication

@EnableEurekaClient

@EnableConfigServer //开启配置中心server

public class ConfigserverApplication {

public static void main(String[] args) {

SpringApplication.run(ConfigserverApplication.class, args);

}

}

你可能感兴趣的:(2019-06-12 config server 配置中心服务器端)