【问题标题】:nslookup: isc_socket_bind: address in use - can't resolve dns in docker container (phusion image)nslookup:isc_socket_bind:正在使用的地址 - 无法解析 docker 容器中的 dns(phusion 映像)
【发布时间】:2018-04-30 18:25:39
【问题描述】:

我正在运行一个具有 2 个 CPU、8GB 内存、450Mbps 带宽的 AWS 实例,以及一个包含 python 应用程序的 docker 容器。

在 Python 运行的时候,容器平均负载几乎是 ~6.0,在容器启动大约 10 小时后,主机和容器仍在运行但无法连接任何域, 但仍然可以通过 IP 地址连接。此外,主机 DNS 仍然可以正常工作。

详情如下:

`nslookup google.com` results:
`nslookup: isc_socket_bind: address in use`

我知道在约 6.0 的平均负载下运行可能会导致很多问题,但在我的情况下,DNS 问题会随着时间的推移而发生,因此我需要在升级 AWS 实例之前了解原因。

【问题讨论】:

  • 错误nslookup: isc_socket_bind: address in use 表示nslookup 无法创建UDP 连接。您能否发布netstat -nvua 或文件cat /proc/net/upd or cat /proc/net/upd6 的输出?
  • 非常感谢@antonbormotov,我发现通过计算/proc/net/upd 中的UDP 连接数,我发现了16k 的挂起连接数。然后 DNS 停止响应就是结果。我通过停止 Python 应用程序来创建太多 UDP 连接来修复该错误。

标签: python amazon-web-services docker dns scrapy


【解决方案1】:

解决了。

wc -l /proc/net/upp #resulting ~16000 hanging connections.

然后我需要停止 Python 应用程序来建立太多的 UDP 连接。实际上它是带有 SyslogHander 的日志组件,它隐式打开 UDP 套接字。

【讨论】:

  • 更准确地说是/proc/net/udp
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-10-19
  • 2016-04-08
  • 1970-01-01
  • 2022-10-24
  • 2020-11-08
  • 2020-06-19
  • 1970-01-01
相关资源
最近更新 更多