com.netflix.client.ClientException: Load balancer does not have available server for client xxxx


版本

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
  
  
 
 
         

方案二

  添加依賴(有待測試)


   
   
  
  
          
  1. <dependency>
  2. <groupId>org.springframework.cloud</groupId>
  3. <artifactId>spring-cloud-starter-eureka</artifactId>
  4. </dependency>

方案因為版本問題,沒有測試,僅供參考

方案三(留作使用)

解決方法:serviceprovider這個application.name可能是太長了,改短一些就行了,我直接改成了sp(長的字符串可以使用中划線-分割),經測試可以正常調用,springcloud關於這些錯誤的提示內容實在太少了,翻閱英文資料也沒找到,在此謝謝Spring Cloud中國社區②:530321604里大佬們的幫助


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM