springcloud-服务注册Eureka Client

1.版本说明

springboot 2.2.5.RELEASE

springcloud Hoxton.SR6

2.依赖

        <!--引入 eureka client-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

 3.配置文件

server.port=8081
spring.application.name=eurekaclient

eureka.client.service-url.defaultZone=http://localhost:8080/eureka

 4.启动注解

@SpringBootApplication
@EnableEurekaClient
public class EurekaclientApplication {

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

}

 

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