Spring Cloud遠程調用服務時出現連接超時問題解決方法


1.idea報錯:Connection timed out: connect; nested exception is java.net.ConnectException: Connection timed out: connect] with root cause

2.訪問超時:訪問頁面如圖

3.原因:服務注冊到內網IP導致訪問失敗

4.解決方法:對服務提供者的spring配置文件中的eureka配置添加如下:

instance:
prefer-ip-address: true

 

 即可解決問題


免責聲明!

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



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