标签:keyword over preview exe cep neu info sans ant
报错环境:
报错时,注册中心的情况:
Application Status
SERVICE-HOT 192.168.22.180:8308
SERVICE-REDIS 127.0.0.1:4046
SERVICE-ZUUL 127.0.0.1:4041
报错情况:
feign.RetryableException:
connect timed out executing
GET http://SERVICE-REDIS/redis/NaviKey-24149-1
at feign.FeignException.errorExecuting(FeignException.java:84)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:113)
排查后发现:是因为注册服务ip问题,导致本地服务无法通过服务名字找到相应的服务.
127.0.0.1:4046
.那么,这就有问题了!!!127.0.0.1
是自己的服务器ip,本地服务肯定找不到Application Status
SERVICE-HOT 192.168.22.180:8308
SERVICE-REDIS 192.168.22.180:4046
SERVICE-ZUUL 192.168.22.180:4041
不修改服务注册配置,还有一种办法: 使用fegin时,通过url指定访问服务的ip
@FeignClient(value = "SERVICE-REDIS",
url="http://192.168.22.180:4041/service-redis" ,
fallback = RedisSvcFallback.class)
public interface RedisSvc {
标签:keyword over preview exe cep neu info sans ant
原文地址:https://www.cnblogs.com/linyufeng/p/12082845.html