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