2019-06-12 eureka 注册中心 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.zz

eurekatest

0.0.1-SNAPSHOT

eurekatest

Demo project for Spring Boot

    1.8

    Greenwich.SR1

        

            org.springframework.cloud

            spring-cloud-starter-netflix-eureka-server

        

        

            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:1005

eureka:

    instance:

        hostname: 127.0.0.1

client:

    service-url:

        defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

    register-with-eureka:false

    fetch-registry:false

3、启动类

@SpringBootApplication

@EnableEurekaServer

public class EurekatestApplication {

    public static void main(String[] args) {

        SpringApplication.run(EurekatestApplication.class, args);

    }

}

你可能感兴趣的:(2019-06-12 eureka 注册中心 server)