Problem using overlay networking on AWS
I have set up 3 Ubuntu VMs on AWS: U1: consul U2: swarm master and swarm slave1 U3: swarm slave2
These are all hooked up. I have opened all ports for inbound acccess. Consul and swarm slaves are addressed with external IP address (internal fails too by the way).
On U2: docker network create --driver overlay training1 docker network ls ubuntu@ip-172-31-1-189:~$ docker network ls NETWORK ID NAME DRIVER fca0612eeedd training1 overlay bfc01e112918 host host 713ff7bf154c bridge bridge 23ca7465169b none null
On U3: ubuntu@ip-172-31-1-188:~$ docker network ls NETWORK ID NAME DRIVER fca0612eeedd training1 overlay c9ae140a6c43 bridge bridge 191e25441fba none null 3dd0fcbff20a host host
When I do on U2: docker run --net="training1" -it ubuntu
I get: Error response from daemon: Cannot start container ad6a06130624bd59be301cb6a8ff293874f39901c370313e782bc74fe3727a63: subnet sandbox join failed for "10.0.0.0/24": vxlan interface creation failed for subnet "10.0.0.0/24": failed in prefunc: failed to set namespace on link "vxlan7ee9cf7": invalid argument
DATA U1: ubuntu@ip-172-31-1-190:~$ docker info Containers: 1 Images: 26 Server Version: 1.9.0 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 28 Dirperm1 Supported: false Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 3.13.0-48-generic Operating System: Ubuntu 14.04.2 LTS CPUs: 1 Total Memory: 588.6 MiB Name: ip-172-31-1-190 ID: UV3K:XZ2Y:QRN4:CZPJ:FOHN:UWPJ:X6IF:7YBO:M7P2:COLO:ZFOC:KRKO WARNING: No swap limit support
DATA U2: ubuntu@ip-172-31-1-189:~$ docker info Containers: 10 Images: 107 Server Version: 1.9.0 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 127 Dirperm1 Supported: false Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 3.13.0-48-generic Operating System: Ubuntu 14.04.2 LTS CPUs: 1 Total Memory: 588.6 MiB Name: ip-172-31-1-189 ID: K344:KVL3:2KQC:QAMX:BJAX:Q4OZ:4W2G:RXKA:NVRF:TLZQ:RG3D:7OVP Username: bergtwvd Registry: https://index.docker.io/v1/ WARNING: No swap limit support Cluster store: consul://54.229.190.241:8500 Cluster advertise: 54.229.190.254:2375
DATA U3: ubuntu@ip-172-31-1-188:~$ docker info Containers: 3 Images: 105 Server Version: 1.9.0 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 111 Dirperm1 Supported: false Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 3.13.0-48-generic Operating System: Ubuntu 14.04.2 LTS CPUs: 1 Total Memory: 588.6 MiB Name: ip-172-31-1-188 ID: YIRV:RR5M:NEPO:XPPD:GHFX:3AGA:76JD:T22B:TVOI:YHDZ:5SVW:T26B Username: bergtwvd Registry: https://index.docker.io/v1/ WARNING: No swap limit support Cluster store: consul://54.229.190.241:8500 Cluster advertise: 54.229.189.241:2375
On U2: ubuntu@ip-172-31-1-190:~$ docker version Client: Version: 1.9.0 API version: 1.21 Go version: go1.4.2 Git commit: 76d6bc9 Built: Tue Nov 3 17:43:42 UTC 2015 OS/Arch: linux/amd64
Server: Version: 1.9.0 API version: 1.21 Go version: go1.4.2 Git commit: 76d6bc9 Built: Tue Nov 3 17:43:42 UTC 2015 OS/Arch: linux/amd64
On U2: ubuntu@ip-172-31-1-190:~$ uname -a Linux ip-172-31-1-190 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
@bergtwvd Currently overlay driver requires kernel 3.16+.
The documentation at https://docs.docker.com/engine/installation/ubuntulinux/ mentions 3.10 and above though. Time to update this?
Kernel version 3.16+ is an Overlay network driver specific requirement. The rest of Docker core works with kernel 3.10+. Hence, it is documented under https://github.com/docker/docker/blob/master/docs/userguide/networking/get-started-overlay.md
Thanks so far.
However, run into some other issue, read on.
I went ahead and looked for an approriate image on AWS. I found Community AMI ubuntu-vivid-15.04-amd64-server-20150818 (ami-e2de8195). Kernel 3.19.0-26-generic.
I instantiated this AMI three times (U1..3). Per AMI:
- I installed Docker 1.9 as per Docker Docs.
- And configured systemd as per Docker Docs.
- I configured AWS Inbound network access to "all traffic".
- And disabled source/destination check for the network (not sure if this is needed)
I set up U2 and U3 to use U1.Consul as KV store.
In the first case I use the AWS INTERNAL IP address for the docker daemon on U2 and U3: --cluster-store="consul://consul-ip:8500" --cluster-advertise="my-internal-ip:2375"'
In the second case I use the AWS EXTERNAL IP address for the docker daemon on U2 and U3: --cluster-store="consul://consul-ip:8500" --cluster-advertise="my-external-ip:2375"'
In either case I can create an overlay network with: docker network create --driver overlay training3.
- In case 1, I successfully can run two containers on U2 and U3, pinging each other.
- In case 2, same test, but a ping fails with something like "From de2260dd5a5c (10.0.0.2) icmp_seq=1 Destination Host Unreachable"
Is there a restriction here for the default Docker overlay network? Subnet issue?
Note that I am able to get this running across Weave without problem.
Mistakenly closed it; is still open.
+1 for "Destination Host Unreachable" when using cluster-advertise with external IPs. This is on Azure though. I have ensured required tcp/udp ports are open.
I get a similar problem on AWS:
> docker-compose -f hello-zookeeper.yml --x-networking up -d
Starting helloworld_keeper_1
ERROR: Cannot start container 4bc5e407358e432829c033ce5b57973b745a605d4842907b511b729b699a6556: subnet sandbox join failed for "10.0.0.0/24": vxlan interface creation failed for subnet "10.0.0.0/24": failed in prefunc: failed to set namespace on link "vxlan6a1b254": invalid argument
@dzlab this error more looks like related to kernel version, Can you check your kernel version once, it should be >= 3.16.
Indeed, I had to manually updated the kernel for all aws machines, now it works!!
> docker-machine -D ssh docker_machine_name
> sudo apt-get install -y linux-image-generic-lts-utopic && sudo reboot
+1 Great! Kernel upgrade works for me!
We just merged https://github.com/docker/libnetwork/pull/821 which brings in overlay driver support for kernels < 3.16 :+1:
the "Destination Host Unreachable" keeps reproducing.