📜 ⬆️ ⬇️

Docker 1.9 + Weave 1.2.1 bridge mode

Today, after an update on Docker 1.9, I expected that the previously beautifully working Weave broke.
Description of the problems and their solution under the cut.


Problem number 1 .

Manifested in Ubuntu 14.04.
')
When trying to perform a weave launch, the following happens:
root@sahara:~/weave# /usr/local/bin/weave launch --no-dns --init-peer-count 8 --ipalloc-range 10.128.0.0/10 10.43.68.61 10.43.68.62 10.43.68.63 10.43.68.64 10.43.68.65 10.43.68.69 10.43.68.70 Error deleting container: Error response from daemon: Unable to remove filesystem for 4f15a00bcf3b7d6df83ed8467cad98177df331d2deed580c4547effc2db13a02: remove /var/lib/docker/containers/4f15a00bcf3b7d6df83ed8467cad98177df331d2deed580c4547effc2db13a02/shm: device or resource busy 


As it turned out, this is a known problem:
github.com/weaveworks/weave/issues/1647
github.com/weaveworks/weave/issues/1652

They write that, perhaps, the transition to using overlayfs instead of aufs will help, but the installation of the 3.19 kernel helped me (linux-image-extra-virtual-lts-vivid package)

Thank you for helping the guys from Weave sitting on #weavenetwork channel in IRC

Problem number 2

The second problem is that I use Weave to link the containers in the Mesos + Kubernetes cluster, and I don’t need dangling unused eth0 in the containers at all. Moreover, I set it up during the Weave 1.0, when the methods of an adequate combination of Mesos and Weave were not yet invented.

Therefore, I used the officially recommended method of binding weave to containers by replacing the docker0 bridge with weave.
This worked right up to Docker 1.8+. Weave 1.1.1
Today it all broke down:

 root@sahara:~/weave# /usr/local/bin/weave launch-router --no-dns --init-peer-count 8 --ipalloc-range 10.128.0.0/10 10.43.68.61 10.43.68.62 10.43.68.63 10.43.68.64 10.43.68.65 10.43.68.69 10.43.68.70 Error response from daemon: Cannot start container b5c0d3e7b69a0101586d1ffe79862f292ed72b72d3f6bf5e21debf086b81db67: [8] System error: failed to set gateway while updating gateway: network is unreachable root@sahara:~/weave# 

Here the help of the club from IRC did not help, I had to swim out myself.
Through lengthy trial and error, it turned out that the root of evil was in assigning a static IP address to the weave bridge during initial configuration.
Namely. Earlier, I raised a bridge with this entry in /etc/network/interfaces.d/weave :

 auto weave iface weave inet manual pre-up /usr/local/bin/weave --local create-bridge post-up ip addr add dev weave 10.4.7.1/16 pre-down ifconfig weave down post-down brctl delbr weave 

As it turned out, if you remove ip add... , then docker --bridge weave runs and works fine.
Also, to run weave in this mode, you need to turn off FASTDP:
export WEAVE_NO_FASTDP=1

As a result, the relevant parts of the configuration files:
/etc/network/interfaces.d/weave:

 auto weave iface weave inet manual pre-up WEAVE_NO_FASTDP=1 /usr/local/bin/weave --local create-bridge pre-down ifconfig weave down post-down brctl delbr weave 

/etc/init/weave.conf:

 start on filesystem and started docker respawn script export DOCKER_BRIDGE=weave export WEAVE_NO_FASTDP=1 /usr/local/bin/weave launch-router --no-dns --init-peer-count 8 --ipalloc-range 10.128.0.0/10 10.43.68.61 10.43.68.62 10.43.68.63 10.43.68.64 10.43.68.65 10.43.68.69 10.43.68.70 /usr/local/bin/weave expose 10.4.7.1/16 /usr/bin/docker attach weave end script 

/ etc / default / docker:
 DOCKER_NETWORK_OPTS="--bridge weave --fixed-cidr=10.4.7.0/24" 


Now everything works as before.

Perhaps this experience will save someone time and nerves.

Source: https://habr.com/ru/post/270521/


All Articles