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