今天在做电商项目的时候,发现服务注册不到eureka。在再三确定配置文件无误的情况下,eureka客户端还是拉取不到服务,导致出现负载均衡的错误,Load balancer does not have available server for XXX client
这时只要在此服务的pom文件中引入eureka-client依赖即可
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>