connect() failed (113: No route to host) while connecting to upstream

docker swarm部署

[error] 37#37: *176 connect() failed (113: No route to host) while connecting to upstream, client: 10.11.0.9, server: , request: "GET /sys/randomImage/1629428467008?_t=1689850588496 HTTP/1.1", upstream: "http://172.16.1.22:9999/sys/randomImage/1629428467008?_t=1689850588496", host: "10.8.81.231", referrer: "http://10.8.81.231/ems-portal/login"
 

nginx请求网关gateway:9999,IP解析成172.16.1.22;

通过排查docker network,没有发现此IP。

怀疑是缓存的IP。

重启该报错的服务,重新换取gateway 服务名:IP 映射,问题解决。

怀疑是docker swarm部署的服务,hostname:ip 的解析不会实时刷新,根绝服务部署时候获取一次列表。后续如果有变化,需要重启服务?

你可能感兴趣的:(docker)