我在一个IaaS(基于OpenStack)上遇到问题,来自docker的连接不稳定。从主机VM(KVM)可以正常工作,但在docker内部却不稳定。最初在使用pip时检测到,但也可以复制卷曲,挂在:
[root@8f8a18704db1 /]# curl -v https://files.pythonhosted.org/packages/e9/50/13d72d9d3a3c8ffd3c66dc91f2918f9f6bc8454c3d869dd86576e2e02aaa/django-redis-cache-1.7.1.tar.gz
* About to connect() to files.pythonhosted.org port 443 (#0)
* Trying 151.101.1.63...
* Connected to files.pythonhosted.org (151.101.1.63) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
DNS仅设置为Google的。
[root@ut-os-jenkins-slave02 ~]# docker run busybox cat /etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8
失败时,strace将显示以下模式:
getpeername(3, {sa_family=AF_INET, sin_port=htons(443),
sin_addr=inet_addr("151.101.85.63")}, [16]) = 0
close(6) = 0
getpeername(3, {sa_family=AF_INET, sin_port=htons(443),
sin_addr=inet_addr("151.101.85.63")}, [16]) = 0
sendto(3, "\26\3\1\0\305\1\0\0\301\3\3T\3@y\210\257\314\376\266\311\337C\264\370\31\203\215\336\36\313\t"..., 202, 0, NULL, 0) = 202
recvfrom(3, 0x9aec18, 5, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(3, 0x9aec18, 5, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
recvfrom(3, 0x9aec18, 5, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
recvfrom(3, 0x9aec18, 5, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
recvfrom(3, 0x9aec18, 5, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
...
关于什么可以检查的任何想法?如果请求是从VM完成的,那么它总是也会立即从docker成功执行。