Spring Cloud Eureka 简单创建

1.pom.xml 添加相关依赖

<dependency>
     <groupId>org.springframework.cloud</groupId>
     <artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>

 

2. .yml文件 添加相关配置

server:
    port: 8761
eureka:
    client:
       register-with-eureka: false
       fetch-registry: false
       service-url:
       defaultZon:
            http://localhost:8761/euraka/

 

3. 启动类添加相关的注解

@EnableAutoConfiguration
@EnableEurekaServer

 

posted @ 2020-10-02 12:22  yiy梵  阅读(46)  评论(0编辑  收藏  举报