eureka 提供服务

1:pom依赖

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

2:yml

 

eureka:
  client:
    fetch-registry: true
    register-with-eureka: true
    service-url:
      defaultZone:  http://localhost:7001/eureka

 

3:开启注解

@EnableEurekaClient
@SpringBootApplication
public class Paytment8001 {

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

 

端口分配 8001

 

posted @ 2020-04-15 20:51  Draymond  阅读(136)  评论(0编辑  收藏  举报