com.netflix.client.ClientException: Load balancer does not have available server for client xxxx
原创
©著作权归作者所有:来自51CTO博客作者mb62e351395277e的原创作品,请联系作者获取转载授权,否则将追究法律责任
版本
spring boot: 2.0.1.RELEASE
spring cloud: Finchley.M9
错误
通过zuul调用eureka注册的服务,错误内容如下
Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client xxxxx
方案
经过查询排查,两种解决方案
方案一(亲测有效)
在application.properties中添加
ribbon.eureka.enable: true
方案二
添加依赖(有待测试)
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
方案因为版本问题,没有测试,仅供参考