Openstack 에서 Docker 사용 시 yum timeout error 해결책
Openstack Host 내 Docker VM을 이용하여 build 시 yum timeout error 가 발생한다
Step 3/24 : RUN yum -y update; yum clean all
---> Running in fe30261d039a
Loaded plugins: fastestmirror, ovl
Setting up Update Process
http://ftp.neowiz.com/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.neowiz.com/centos/6.8/os/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
- yum mirror 사이트를 찾지만 timeout 발생
ifconfig 명령어로 mtu 값을 확인한다
- docker0의 mtu 값과 openstack vm 내의 interface mtu 값이 상이하여 문제 발생
[root@Linux]# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0
inet6 fe80::42:dfff:fe1a:97d9 prefixlen 64 scopeid 0x20<link>
ether 02:42:df:1a:97:d9 txqueuelen 0 (Ethernet)
RX packets 1274 bytes 74818 (73.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2390 bytes 5104402 (4.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1454
inet 10.10.100.25 netmask 255.255.255.0 broadcast 10.10.100.255
ether fa:16:3e:8b:e6:8b txqueuelen 1000 (Ethernet)
RX packets 58736 bytes 71451560 (68.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 30435 bytes 2683880 (2.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
mtu 값을 맞춰준다
1. docker 파일 수정
#vi /etc/default/docker
DOCKER_OPTS='
-H tcp://0.0.0.0:2376
-H unix:///var/run/docker.sock
--mtu 1454
--storage-driver aufs
--tlsverify
--tlscacert /etc/docker/ca.pem
--tlscert /etc/docker/server.pem
--tlskey /etc/docker/server-key.pem
--label provider=openstack