1、建Module
2、改POM
<!--eureka-client--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency>
3、写YML
eureka: client: #表示是否将自己注册进EurekaServer默认为true。 register-with-eureka: true #是否从EurekaServer抓取已有的注册信息,默认为true。单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡 fetchRegistry: true service-url: defaultZone: http://localhost:7001/eureka
4、主启动
@EnableEurekaClient标签:EurekaClient,eureka,EurekaServer,注册,服务提供者,true From: https://www.cnblogs.com/ai377377/p/16913041.html