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

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

转载请注明出处:

  用docker 搭建的服务,今天重启了一个容器之后,请求这个服务的接口都变成了 502, 但通过docker 查看日志,发现没有异常,端口也都是正常,在nginx的日志中看到了这段错误信息

  在nginx 的日志中看到:connect() failed (113: No route to host) while connecting to upstream, client: 相关的错误信息,由于 nginx 服务一直正常且从未重启过,一直在定位 服务的容器是否启动成功。通过docker service ps 查看容器的状态:

docker  service ps service_name

  看到 服务的容器状态正常,但是通过接口请求一直报错 502,502 通常是由于服务启动失败,服务状态是异常的或者 nginx 的配置错误等等。 在尝试很多思路定位,但最终未能解决,想着重启 nginx 的容器试试,死马当活马医,重启了 nginx 之后,接口又能请求成功了,至于具体原因还未能明确。

  有明白这个具体原因的大佬,欢迎留言 


标签: 异常

目录
相关文章
|
7月前
|
Go 开发工具 git
【git】解决:Failed to connect to 127.0.0.1 port 7890: Connection refused
【git】解决:Failed to connect to 127.0.0.1 port 7890: Connection refused
2063 0
|
6月前
|
Linux 数据安全/隐私保护
Could not connect to ‘121.37.92.110‘ (port 22): Connection failed.
Could not connect to ‘121.37.92.110‘ (port 22): Connection failed.
|
7月前
|
Kubernetes Perl 容器
k8s创建完pod后报错: Failed connect to 10.244.36.90:8000; No route to host
k8s创建完pod后报错: Failed connect to 10.244.36.90:8000; No route to host
168 0
|
Java 应用服务中间件 PHP
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
702 0
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
|
7月前
|
网络协议 NoSQL Redis
解决 Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use
解决 Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use
343 0
Error: listen EADDRINUSE: address already in use :::5000
Error: listen EADDRINUSE: address already in use :::5000
|
Kubernetes 网络协议 容器
kubectl命令报错:Unable to connect to the server: dial tcp XXX:16443: connect: no route to host
kubectl命令报错:Unable to connect to the server: dial tcp XXX:16443: connect: no route to host
1048 0
|
Android开发
Error connecting to the service protocol failed to connect to错误
Error connecting to the service protocol failed to connect to错误
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
220 0