cURL:在DNS缓存中找不到主机名

时间:2016-10-22 14:00:55

标签: curl php-curl

我们遇到了一个奇怪的错误。它每分钟发生一次,这就是我们在日志中看到的:

* Connection #0 to host data01 left intact * Hostname was NOT found in DNS cache * Trying x.x.x.x... * connect to x.x.x.x port yyyy failed: Connection timed out * Failed to connect to x.x.x.x port yyyy: Connection timed out * Closing connection 0

我们在/ etc / hosts文件中正确定义了data01但由于某种原因,解析的x.x.x.x IP地址不正确,因此连接失败。

curl --version返回以下内容:

curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3

请帮忙。

1 个答案:

答案 0 :(得分:0)

flink-conf.yaml中的taskmanager.numberOfTaskSlots: 7 https://stackoverflow.com/users/93747/daniel-stenberg)的维护者:

  

在DNS缓存中找不到的文本只是垃圾,将来会删除

(另外我怀疑那条消息只有你有时而不是总是收到,也就是说如果你没有经历超时 - 只是猜测 此处。)

确保curl/libcurl更喜欢nsswitch.conf

/etc/hosts

否则DNS服务器可能会提供错误的IP。通过更改$ grep host /etc/nsswitch.conf hosts: files dns/etc/hosts

来检查这一点