springcloud-注册中心Eureka Server

1.版本说明

springboot 2.2.5.RELEASE

springcloud Hoxton.SR6

2.依赖

        <!--引入eurekaserver组件的依赖-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>

 3.配置文件

server.port=8080
spring.application.name=eurekaserver
eureka.client.service-url.defaultZone=http://localhost:8080/eureka
eureka.client.fetch-registry=false
eureka.client.register-with-eureka=false

 4.启动注解

@SpringBootApplication
@EnableEurekaServer
public class EurekaserverApplication {

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

}

 

posted @ 2020-08-07 22:18  陶海军  阅读(166)  评论(0编辑  收藏  举报