Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c391092ea6 | ||
|
|
b3a29bec1b | ||
|
|
b055c9a4a2 | ||
|
|
3daceac668 | ||
|
|
4611e8825a | ||
|
|
00e4729533 | ||
|
|
517a2e0e0a | ||
|
|
bb8c7c599c | ||
|
|
0d0fc39236 | ||
|
|
302a5a4efc | ||
|
|
3b29e8e6f2 | ||
|
|
a1dff70ba2 | ||
|
|
12671be260 | ||
|
|
9a4adccec6 | ||
|
|
f90390974a | ||
|
|
f598ae297b | ||
|
|
4b0fe502f0 | ||
|
|
e4295a2da9 | ||
|
|
216a0fe4fc | ||
|
|
80770d39e5 | ||
|
|
beb15fa32c | ||
|
|
0adf7626d0 | ||
|
|
9c17fe259c | ||
|
|
ecab4b4716 | ||
|
|
7660ad761a | ||
|
|
c8ff2de3b3 | ||
|
|
24a2e43547 | ||
|
|
a9d212c888 | ||
|
|
c1b1276aaf | ||
|
|
370212609c | ||
|
|
281937cf82 | ||
|
|
d11b6e8075 | ||
|
|
7709c6d0bd | ||
|
|
ef3e478506 | ||
|
|
93eef26d0b | ||
|
|
14d78cf08c | ||
|
|
e96a63f550 | ||
|
|
7a5b69f850 | ||
|
|
a71d2a1682 | ||
|
|
257b1a5353 | ||
|
|
b45ac75735 | ||
|
|
c7c669fd11 |
No files matched your search
@@ -1,3 +1,25 @@
|
|||||||
|
## Release 1.4.2
|
||||||
|
|
||||||
|
Bug-fixes and minor improvements.
|
||||||
|
|
||||||
|
* A race condition in weavewait that would occasionally hang
|
||||||
|
containers at startup #1882/#1884
|
||||||
|
* Having the plugin auto-restart prevents successful `weave launch` on
|
||||||
|
reboot #1869
|
||||||
|
* Work round weave router failure on CoreOS 4.3 caused by kernel bug
|
||||||
|
#1854
|
||||||
|
* `weave launch` would exit with error code on docker <1.9 #1851
|
||||||
|
* Running `eval $(weave env)` multiple times would break `eval $(weave
|
||||||
|
env --restore)` #1824/#1825
|
||||||
|
* Don't complain in `weave stop` about "Plugin is not running" when
|
||||||
|
plugin is not enabled #1840/#1841
|
||||||
|
* `weave --local launch` would fail if utility program
|
||||||
|
`docker_tls_args` could not be found #1844
|
||||||
|
* Improved error reporting when TLS arg detection fails #1843
|
||||||
|
* Improve error reporting when docker isn't running #1845
|
||||||
|
* Add `--trusted-subnets` usage to `weave` script #1842
|
||||||
|
* weave run can hang under rare combinations of options #1858
|
||||||
|
|
||||||
## Release 1.4.1
|
## Release 1.4.1
|
||||||
|
|
||||||
This is a bug-fix release to cover a few issues that came up since the
|
This is a bug-fix release to cover a few issues that came up since the
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
PUBLISH=publish_weave publish_weaveexec
|
PUBLISH=publish_weave publish_weaveexec publish_plugin
|
||||||
|
|
||||||
.DEFAULT: all
|
.DEFAULT: all
|
||||||
.PHONY: all update tests lint publish $(PUBLISH) clean clean-bin prerequisites build travis run-smoketests
|
.PHONY: all update tests lint publish $(PUBLISH) clean clean-bin prerequisites build travis run-smoketests
|
||||||
|
|||||||
@@ -18,15 +18,16 @@ func EnsureInterface(ifaceName string) (*net.Interface, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ensureInterface(ifaceName string) (*net.Interface, error) {
|
func ensureInterface(ifaceName string) (*net.Interface, error) {
|
||||||
if iface, err := findInterface(ifaceName); err == nil {
|
|
||||||
return iface, nil
|
|
||||||
}
|
|
||||||
ch := make(chan netlink.LinkUpdate)
|
ch := make(chan netlink.LinkUpdate)
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
defer close(done)
|
defer close(done)
|
||||||
if err := netlink.LinkSubscribe(ch, done); err != nil {
|
if err := netlink.LinkSubscribe(ch, done); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// check for currently-existing interface after subscribing, to avoid race
|
||||||
|
if iface, err := findInterface(ifaceName); err == nil {
|
||||||
|
return iface, nil
|
||||||
|
}
|
||||||
for update := range ch {
|
for update := range ch {
|
||||||
if ifaceName == update.Link.Attrs().Name && update.IfInfomsg.Flags&syscall.IFF_UP != 0 {
|
if ifaceName == update.Link.Attrs().Name && update.IfInfomsg.Flags&syscall.IFF_UP != 0 {
|
||||||
break
|
break
|
||||||
@@ -44,16 +45,17 @@ func EnsureInterfaceAndMcastRoute(ifaceName string) (*net.Interface, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
dest := net.IPv4(224, 0, 0, 0)
|
|
||||||
if CheckRouteExists(ifaceName, dest) {
|
|
||||||
return iface, err
|
|
||||||
}
|
|
||||||
ch := make(chan netlink.RouteUpdate)
|
ch := make(chan netlink.RouteUpdate)
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
defer close(done)
|
defer close(done)
|
||||||
if err := netlink.RouteSubscribe(ch, done); err != nil {
|
if err := netlink.RouteSubscribe(ch, done); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
dest := net.IPv4(224, 0, 0, 0)
|
||||||
|
// check for currently-existing route after subscribing, to avoid race
|
||||||
|
if CheckRouteExists(ifaceName, dest) {
|
||||||
|
return iface, err
|
||||||
|
}
|
||||||
for update := range ch {
|
for update := range ch {
|
||||||
link, _ := netlink.LinkByIndex(update.Route.LinkIndex)
|
link, _ := netlink.LinkByIndex(update.Route.LinkIndex)
|
||||||
if link.Attrs().Name == ifaceName && update.Route.Dst.IP.Equal(dest) {
|
if link.Attrs().Name == ifaceName && update.Route.Dst.IP.Equal(dest) {
|
||||||
|
|||||||
+9
-5
@@ -21,7 +21,11 @@ You can also build in a container under any system that supports
|
|||||||
Docker. And you can run Ubuntu in a VM and build there. These
|
Docker. And you can run Ubuntu in a VM and build there. These
|
||||||
options are described below.
|
options are described below.
|
||||||
|
|
||||||
## Building directly on Ubuntu
|
* [Building directly on Ubuntu](#ubuntu)
|
||||||
|
* [Building in a Docker container](#docker)
|
||||||
|
* [Building using Vagrant](#vagrant)
|
||||||
|
|
||||||
|
## <a name="ubuntu"></a>Building directly on Ubuntu
|
||||||
|
|
||||||
The weave git repository should be cloned into
|
The weave git repository should be cloned into
|
||||||
`$GOPATH/src/github.com/weaveworks/weave`, in accordance with [the go
|
`$GOPATH/src/github.com/weaveworks/weave`, in accordance with [the go
|
||||||
@@ -53,10 +57,10 @@ $ make
|
|||||||
```
|
```
|
||||||
|
|
||||||
This will build the weave components and package them into three
|
This will build the weave components and package them into three
|
||||||
Docker images (`weaveworks/weave`, `weaveworks/weavedns`, and
|
Docker images (`weaveworks/weave`, `weaveworks/weaveexec`, and
|
||||||
`weaveworks/weaveexec`). These are then exported as `weave.tar.gz`.
|
`weaveworks/plugin`). These are then exported as `weave.tar.gz`.
|
||||||
|
|
||||||
## Building in a Docker container
|
## <a name="docker"></a>Building in a Docker container
|
||||||
|
|
||||||
As a preliminary step, we create a container image based on Ubuntu
|
As a preliminary step, we create a container image based on Ubuntu
|
||||||
that has all the prerequisites. This avoids the need to download and
|
that has all the prerequisites. This avoids the need to download and
|
||||||
@@ -106,7 +110,7 @@ $ sudo docker run -v /var/run/docker.sock:/var/run/docker.sock -v <host gopath>:
|
|||||||
This will leave the intermediate build artifacts on the host, so that
|
This will leave the intermediate build artifacts on the host, so that
|
||||||
you can modify the weave source code and rebuild quickly.
|
you can modify the weave source code and rebuild quickly.
|
||||||
|
|
||||||
## Building using Vagrant
|
## <a name="vagrant"></a>Building using Vagrant
|
||||||
|
|
||||||
If you aren't running Linux, or otherwise don't want to run the docker
|
If you aren't running Linux, or otherwise don't want to run the docker
|
||||||
daemon outside a VM, you can use
|
daemon outside a VM, you can use
|
||||||
|
|||||||
+4
-1
@@ -50,6 +50,8 @@ TCP/IP, e.g. a netcat UDP service would be run with
|
|||||||
|
|
||||||
root@a2:/# echo 'Hello, world.' | nc -u a1 5533
|
root@a2:/# echo 'Hello, world.' | nc -u a1 5533
|
||||||
|
|
||||||
|
Broadcast and multicast protocols also work over Weave Net.
|
||||||
|
|
||||||
We can deploy the entire arsenal of standard network tools and
|
We can deploy the entire arsenal of standard network tools and
|
||||||
applications, developed over decades, to configure, secure, monitor,
|
applications, developed over decades, to configure, secure, monitor,
|
||||||
and troubleshoot our container network. To put it another way, we can
|
and troubleshoot our container network. To put it another way, we can
|
||||||
@@ -113,7 +115,8 @@ Weave detects when a container has exited and releases its
|
|||||||
automatically allocated addresses so they can be re-used.
|
automatically allocated addresses so they can be re-used.
|
||||||
|
|
||||||
See the [Automatic IP Address Management](ipam.html) documentation for
|
See the [Automatic IP Address Management](ipam.html) documentation for
|
||||||
further details.
|
further details. We also have an explanation of
|
||||||
|
[the basics of IP addressing](ip-addresses.html)
|
||||||
|
|
||||||
Instead of getting weave to allocate IP addresses automatically, it is
|
Instead of getting weave to allocate IP addresses automatically, it is
|
||||||
also possible to specify an address and network explicitly, expressed
|
also possible to specify an address and network explicitly, expressed
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
---
|
||||||
|
title: IP Addresses, routes and networks
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
# IP Addresses, routes and networks
|
||||||
|
|
||||||
|
Weave Net lets you run containers on a private network, and so the IP
|
||||||
|
addresses those containers use are insulated from the rest of the
|
||||||
|
Internet, and you don't have to worry about them clashing. Except, if
|
||||||
|
they actually do clash with some addresses that you'd like the
|
||||||
|
containers to talk to.
|
||||||
|
|
||||||
|
### Some definitions
|
||||||
|
|
||||||
|
- _IP_ is the Internet Protocol, the fundamental basis of network
|
||||||
|
communication between billions of connected devices.
|
||||||
|
- The _IP address_ is (for most purposes) the four numbers separated
|
||||||
|
by dots, like `192.168.48.12`. Each number is one byte in size, so can
|
||||||
|
be between 0 and 255.
|
||||||
|
- Each IP address lives on a _Network_, which is some set of those
|
||||||
|
addresses that all know how talk to each other. The network address
|
||||||
|
is some prefix of the IP address, like `192.168.48`. To show
|
||||||
|
which part of the address is the network, we append a slash
|
||||||
|
and then the number of bits in the network prefix, like
|
||||||
|
`/24`.
|
||||||
|
- A _route_ is an instruction for how to deal with traffic destined
|
||||||
|
for somewhere else - it specifies a Network, and a way to talk to
|
||||||
|
that network. Every device using IP has a table of routes, so for
|
||||||
|
any destination address it looks up that table, finds the right
|
||||||
|
route, and sends it in the direction indicated.
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
In the IP address `10.4.2.6/8`, the network prefix is the first 8 bits
|
||||||
|
- `10`. Written out in full, that network is `10.0.0.0/8`.
|
||||||
|
|
||||||
|
The most common prefix lengths are 8, 16 and 24, but there is nothing
|
||||||
|
stopping you using a /9 network or a /26. E.g. `6.250.3.1/9` is on the
|
||||||
|
`6.128.0.0/9` network.
|
||||||
|
|
||||||
|
Several websites offer calculators to decode this kind of address; for
|
||||||
|
example [IP Address Guide](http://www.ipaddressguide.com/cidr).
|
||||||
|
|
||||||
|
Here is an example route table for a container attached to the Weave
|
||||||
|
network:
|
||||||
|
|
||||||
|
````
|
||||||
|
# ip route show
|
||||||
|
default via 172.17.42.1 dev eth0
|
||||||
|
10.2.2.0/24 dev ethwe proto kernel scope link src 10.2.2.1
|
||||||
|
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.170
|
||||||
|
````
|
||||||
|
|
||||||
|
It has two interfaces: one that Docker gave it called `eth0`, and one
|
||||||
|
that weave gave it called `ethwe`. They are on networks
|
||||||
|
`172.17.0.0/16` and `10.2.2.0/24` respectively, and if you want to
|
||||||
|
talk to any other address on those networks then the routing table
|
||||||
|
tells it to send directly down that interface. If you want to talk to
|
||||||
|
anything else not matching those rules, the default rule says to send
|
||||||
|
it to `172.17.42.1` down the eth0 interface.
|
||||||
|
|
||||||
|
So, suppose this container wants to talk to another container at
|
||||||
|
address `10.2.2.9`; it will send down the ethwe interface and weave
|
||||||
|
Net will take care of routing the traffic. To talk an external server
|
||||||
|
at address `74.125.133.128`, it looks in its routing table, doesn't
|
||||||
|
find a match, so uses the default rule.
|
||||||
|
|
||||||
|
### Configuring Weave
|
||||||
|
|
||||||
|
The default configurations for both weave Net and Docker use [Private
|
||||||
|
Networks](https://en.wikipedia.org/wiki/Private_network), whose
|
||||||
|
addresses are never found on the public internet, so that reduces the
|
||||||
|
chances of overlap. But it could be that you or your hosting provider
|
||||||
|
are using some of these private addresses in the same range, which would
|
||||||
|
cause a clash.
|
||||||
|
|
||||||
|
Here's an example: on `weave launch`, the following error message
|
||||||
|
can appear:
|
||||||
|
|
||||||
|
````
|
||||||
|
Network 10.32.0.0/12 overlaps with existing route 10.0.0.0/8 on host.
|
||||||
|
ERROR: Default --ipalloc-range 10.32.0.0/12 overlaps with existing route on host.
|
||||||
|
You must pick another range and set it on all hosts.
|
||||||
|
````
|
||||||
|
|
||||||
|
As the message says, the default that weave Net would like to use is
|
||||||
|
`10.32.0.0/12` - a 12-bit prefix so all addresses starting with the bit
|
||||||
|
pattern 000010100010, or in decimal everything from 10.32.0.0 through
|
||||||
|
10.47.255.255. But the user's host already has a route for `10.0.0.0/8`,
|
||||||
|
which overlaps, because the first 8 bits are the same. If we went
|
||||||
|
ahead and used the default network, then for an address like
|
||||||
|
`10.32.5.6` the kernel would never be sure whether this meant the
|
||||||
|
weave Net network of `10.32.0.0/12` or the hosting network of
|
||||||
|
`10.0.0.0/8`.
|
||||||
|
|
||||||
|
If you're sure the addresses you want are not really in use, then
|
||||||
|
explicitly setting the range with `--ipalloc-range` in the
|
||||||
|
command-line arguments to `weave launch` on all hosts will force Weave
|
||||||
|
Net to use that range, even though it overlaps. Otherwise, you can
|
||||||
|
pick a different range, preferrably another subset of the [Private
|
||||||
|
Networks](https://en.wikipedia.org/wiki/Private_network). For example
|
||||||
|
172.30.0.0/16.
|
||||||
+2
-1
@@ -109,7 +109,8 @@ The range parameter is written in
|
|||||||
[CIDR notation](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) -
|
[CIDR notation](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) -
|
||||||
in this example "/16" means the first 16 bits of the address form the
|
in this example "/16" means the first 16 bits of the address form the
|
||||||
network address and the allocator is to allocate container addresses
|
network address and the allocator is to allocate container addresses
|
||||||
that all start 10.2.
|
that all start 10.2. We have [a page with more information on IP
|
||||||
|
addresses and routes](ip-addresses.html).
|
||||||
|
|
||||||
Weave shares the IP address range across all peers, dynamically
|
Weave shares the IP address range across all peers, dynamically
|
||||||
according to their needs. If a group of peers becomes isolated from
|
according to their needs. If a group of peers becomes isolated from
|
||||||
|
|||||||
+9
-13
@@ -14,12 +14,6 @@ The Weave Net plugin runs automatically when you `weave launch`. You
|
|||||||
must still tell the weave peers to connect to one another, either via
|
must still tell the weave peers to connect to one another, either via
|
||||||
`weave launch` or `weave connect`.
|
`weave launch` or `weave connect`.
|
||||||
|
|
||||||
Note that the plugin container (`weaveplugin`) is run with
|
|
||||||
`--restart=always`, so that it is there after a restart or reboot. If
|
|
||||||
you remove this container (e.g. using `weave reset`) before removing
|
|
||||||
all endpoints created using `--net=weave`, Docker can
|
|
||||||
[hang](https://github.com/docker/libnetwork/issues/813).
|
|
||||||
|
|
||||||
## Starting a container
|
## Starting a container
|
||||||
|
|
||||||
$ docker run --net=weave -ti ubuntu
|
$ docker run --net=weave -ti ubuntu
|
||||||
@@ -84,15 +78,17 @@ The plugin command-line arguments are:
|
|||||||
* `--no-multicast-route`: stop weave adding a static IP route for
|
* `--no-multicast-route`: stop weave adding a static IP route for
|
||||||
multicast traffic on its interface
|
multicast traffic on its interface
|
||||||
|
|
||||||
|
By default, multicast traffic will be routed over the weave network.
|
||||||
|
To turn this off, e.g. because you want to configure your own multicast
|
||||||
|
route, add the `--no-multicast-route` flag to `weave launch-plugin`.
|
||||||
|
|
||||||
## Restarting
|
## Restarting
|
||||||
|
|
||||||
We start the plugin with a restart policy, because Docker attempts to
|
We start the plugin with a policy of `--restart=always`, so that it is
|
||||||
recreate networks on startup. If it isn't started automatically by
|
there after a restart or reboot. If you remove this container
|
||||||
Docker with a restart policy, it's not possible to start it manually
|
(e.g. using `weave reset`) before removing all endpoints created using
|
||||||
because Docker is blocked.
|
`--net=weave`, Docker can
|
||||||
|
[hang](https://github.com/docker/libnetwork/issues/813).
|
||||||
Specifically, we use the policy `on-failure:3`, so Docker will give up
|
|
||||||
after three attempts if something just isn't working.
|
|
||||||
|
|
||||||
[readme]: https://github.com/weaveworks/weave/blob/master/README.md#installation
|
[readme]: https://github.com/weaveworks/weave/blob/master/README.md#installation
|
||||||
[service-discovery]: weavedns.html
|
[service-discovery]: weavedns.html
|
||||||
|
|||||||
@@ -115,6 +115,10 @@ will only include one of them.
|
|||||||
|
|
||||||
host1$ weave launch-router && weave launch-proxy --rewrite-inspect
|
host1$ weave launch-router && weave launch-proxy --rewrite-inspect
|
||||||
|
|
||||||
|
By default, multicast traffic will be routed over the weave network.
|
||||||
|
To turn this off, e.g. because you want to configure your own multicast
|
||||||
|
route, add the `--no-multicast-route` flag to `weave launch-proxy`.
|
||||||
|
|
||||||
## <a name="ipam"></a>Automatic IP address assignment
|
## <a name="ipam"></a>Automatic IP address assignment
|
||||||
|
|
||||||
If [automatic IP address assignment](ipam.html) is enabled in weave,
|
If [automatic IP address assignment](ipam.html) is enabled in weave,
|
||||||
|
|||||||
+50
-43
@@ -5,14 +5,19 @@ layout: default
|
|||||||
|
|
||||||
# Troubleshooting Weave
|
# Troubleshooting Weave
|
||||||
|
|
||||||
* [Overall status](#weave-status)
|
* [Basic diagnostics](#diagnostics)
|
||||||
* [List connections](#weave-status-connections)
|
* [Status reporting](#weave-status)
|
||||||
* [List peers](#weave-status-peers)
|
- [List connections](#weave-status-connections)
|
||||||
* [List DNS entries](#weave-status-dns)
|
- [List peers](#weave-status-peers)
|
||||||
* [JSON report](#weave-report)
|
- [List DNS entries](#weave-status-dns)
|
||||||
* [List attached containers](#list-attached-containers)
|
- [JSON report](#weave-report)
|
||||||
|
- [List attached containers](#list-attached-containers)
|
||||||
|
* [Stopping weave](#stop)
|
||||||
|
* [Reboots](#reboots)
|
||||||
* [Snapshot releases](#snapshots)
|
* [Snapshot releases](#snapshots)
|
||||||
|
|
||||||
|
## <a name="diagnostics"></a>Basic diagnostics
|
||||||
|
|
||||||
Check what version of weave you are running with
|
Check what version of weave you are running with
|
||||||
|
|
||||||
weave version
|
weave version
|
||||||
@@ -37,31 +42,7 @@ Another useful debugging technique is to attach standard packet
|
|||||||
capture and analysis tools, such as tcpdump and wireshark, to the
|
capture and analysis tools, such as tcpdump and wireshark, to the
|
||||||
`weave` network bridge on the host.
|
`weave` network bridge on the host.
|
||||||
|
|
||||||
To stop weave, if you have configured your environment to use the
|
## <a name="weave-status"></a>Status reporting
|
||||||
Weave Docker API Proxy, e.g. by running `eval $(weave env)` in your
|
|
||||||
shell, you must first restore the environment with
|
|
||||||
|
|
||||||
eval $(weave env --restore)
|
|
||||||
|
|
||||||
Then run
|
|
||||||
|
|
||||||
weave stop
|
|
||||||
|
|
||||||
Note that this leaves the local application container network intact;
|
|
||||||
containers on the local host can continue to communicate, whereas
|
|
||||||
communication with containers on different hosts, as well as service
|
|
||||||
export/import, is disrupted but resumes when weave is relaunched.
|
|
||||||
|
|
||||||
To stop weave and completely remove all traces of the weave network on
|
|
||||||
the local host, run
|
|
||||||
|
|
||||||
weave reset
|
|
||||||
|
|
||||||
Any running application containers will permanently lose connectivity
|
|
||||||
with the weave network and have to be restarted in order to
|
|
||||||
re-connect.
|
|
||||||
|
|
||||||
### <a name="weave-status"></a>Overall status
|
|
||||||
|
|
||||||
A status summary can be obtained with `weave status`:
|
A status summary can be obtained with `weave status`:
|
||||||
|
|
||||||
@@ -267,22 +248,48 @@ You can also supply a list of container IDs/names to `weave ps`, like this:
|
|||||||
able ce:15:34:a9:b5:6d 10.2.5.1/24
|
able ce:15:34:a9:b5:6d 10.2.5.1/24
|
||||||
baker 7a:61:a2:49:4b:91 10.2.8.3/24
|
baker 7a:61:a2:49:4b:91 10.2.8.3/24
|
||||||
|
|
||||||
### Reboots
|
## <a name="stop"></a>Stopping weave
|
||||||
|
To stop weave, if you have configured your environment to use the
|
||||||
|
Weave Docker API Proxy, e.g. by running `eval $(weave env)` in your
|
||||||
|
shell, you must first restore the environment with
|
||||||
|
|
||||||
When a host reboots, docker's default behaviour is to restart any
|
eval $(weave env --restore)
|
||||||
containers that were running. Since weave relies on special network
|
|
||||||
configuration outside of the containers, the weave network will not
|
|
||||||
function in this state.
|
|
||||||
|
|
||||||
To remedy this, stop and re-launch the weave container, and re-attach
|
Then run
|
||||||
the application containers with `weave attach`.
|
|
||||||
|
|
||||||
For a more permanent solution,
|
weave stop
|
||||||
[disable Docker's auto-restart feature](https://docs.docker.com/articles/host_integration/)
|
|
||||||
and create appropriate startup scripts to launch weave and run
|
|
||||||
application containers from your favourite process manager.
|
|
||||||
|
|
||||||
### <a name="snapshots"></a>Snapshot Releases
|
Note that this leaves the local application container network intact;
|
||||||
|
containers on the local host can continue to communicate, whereas
|
||||||
|
communication with containers on different hosts, as well as service
|
||||||
|
export/import, is disrupted but resumes when weave is relaunched.
|
||||||
|
|
||||||
|
To stop weave and completely remove all traces of the weave network on
|
||||||
|
the local host, run
|
||||||
|
|
||||||
|
weave reset
|
||||||
|
|
||||||
|
Any running application containers will permanently lose connectivity
|
||||||
|
with the weave network and have to be restarted in order to
|
||||||
|
re-connect.
|
||||||
|
|
||||||
|
## <a name="reboots"></a>Reboots
|
||||||
|
|
||||||
|
The router and proxy containers do not have Docker restart policies
|
||||||
|
set, because the process of getting everything re-started and
|
||||||
|
re-connected via restart policies is not entirely reliable. Until that
|
||||||
|
changes, we recommend you create appropriate startup scripts to launch
|
||||||
|
weave and run application containers from
|
||||||
|
[your favourite process manager](systemd.html).
|
||||||
|
|
||||||
|
If you are shutting down or restarting a host deliberately, run `weave
|
||||||
|
reset` to clear everything down.
|
||||||
|
|
||||||
|
The Weave Docker plugin does restart automatically because it must
|
||||||
|
always start with Docker, as described in
|
||||||
|
[its documentation](plugin.html).
|
||||||
|
|
||||||
|
## <a name="snapshots"></a>Snapshot releases
|
||||||
|
|
||||||
We sometimes publish snapshot releases, to provide previews of new
|
We sometimes publish snapshot releases, to provide previews of new
|
||||||
features, assist in validation of bug fixes, etc. One can install the
|
features, assist in validation of bug fixes, etc. One can install the
|
||||||
|
|||||||
@@ -40,13 +40,11 @@ Usage:
|
|||||||
weave --help | help
|
weave --help | help
|
||||||
weave setup
|
weave setup
|
||||||
weave version
|
weave version
|
||||||
weave launch [--password <password>] [--nickname <nickname>]
|
weave launch <same arguments as 'weave launch-router'>
|
||||||
|
weave launch-router [--password <password>] [--nickname <nickname>]
|
||||||
[--ipalloc-range <cidr> [--ipalloc-default-subnet <cidr>]]
|
[--ipalloc-range <cidr> [--ipalloc-default-subnet <cidr>]]
|
||||||
[--no-discovery] [--init-peer-count <count>]
|
[--no-discovery] [--init-peer-count <count>]
|
||||||
[--trusted-subnets <cidr>,...] <peer> ...
|
[--trusted-subnets <cidr>,...] <peer> ...
|
||||||
weave launch-router [--password <password>] [--nickname <nickname>]
|
|
||||||
[--ipalloc-range <cidr> [--ipalloc-default-subnet <cidr>]]
|
|
||||||
[--no-discovery] [--init-peer-count <count>] <peer> ...
|
|
||||||
weave launch-proxy [-H <endpoint>] [--without-dns]
|
weave launch-proxy [-H <endpoint>] [--without-dns]
|
||||||
[--no-default-ipalloc] [--no-rewrite-hosts]
|
[--no-default-ipalloc] [--no-rewrite-hosts]
|
||||||
[--no-multicast-route]
|
[--no-multicast-route]
|
||||||
@@ -126,7 +124,6 @@ exec_remote() {
|
|||||||
-e DOCKER_CLIENT_HOST="$DOCKER_CLIENT_HOST" \
|
-e DOCKER_CLIENT_HOST="$DOCKER_CLIENT_HOST" \
|
||||||
-e DOCKER_CLIENT_ARGS \
|
-e DOCKER_CLIENT_ARGS \
|
||||||
-e PROXY_HOST="$PROXY_HOST" \
|
-e PROXY_HOST="$PROXY_HOST" \
|
||||||
-e WEAVE_CIDR=none \
|
|
||||||
-e COVERAGE \
|
-e COVERAGE \
|
||||||
$WEAVEEXEC_DOCKER_ARGS $EXEC_IMAGE --local "$@"
|
$WEAVEEXEC_DOCKER_ARGS $EXEC_IMAGE --local "$@"
|
||||||
}
|
}
|
||||||
@@ -167,7 +164,7 @@ check_docker_server_api_version() {
|
|||||||
# Cope with various versions of `docker version` output format
|
# Cope with various versions of `docker version` output format
|
||||||
if ! DOCKER_API_VERSION=$(docker version -f '{{.Server.APIVersion}}' 2> /dev/null ) ; then
|
if ! DOCKER_API_VERSION=$(docker version -f '{{.Server.APIVersion}}' 2> /dev/null ) ; then
|
||||||
if ! DOCKER_API_VERSION=$(docker version -f '{{.Server.ApiVersion}}' 2> /dev/null ) ; then
|
if ! DOCKER_API_VERSION=$(docker version -f '{{.Server.ApiVersion}}' 2> /dev/null ) ; then
|
||||||
if ! DOCKER_API_VERSION=$(docker version | sed -n -e 's|^Server API version: *\([0-9][0-9]*\.[0-9][0-9]\).*|\1|p') ; then
|
if ! DOCKER_API_VERSION=$(docker version | sed -n -e 's|^Server API version: *\([0-9][0-9]*\.[0-9][0-9]\).*|\1|p') || [ -z "$DOCKER_API_VERSION" ] ; then
|
||||||
echo "ERROR: Unable to determine docker version" >&2
|
echo "ERROR: Unable to determine docker version" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -912,22 +909,22 @@ check_not_running() {
|
|||||||
case ${RUN_STATUS%:*} in
|
case ${RUN_STATUS%:*} in
|
||||||
"true restarting $3")
|
"true restarting $3")
|
||||||
echo "$2 is restarting; you can stop it with 'weave stop-$1'." >&2
|
echo "$2 is restarting; you can stop it with 'weave stop-$1'." >&2
|
||||||
exit 1
|
return 3
|
||||||
;;
|
;;
|
||||||
"true "*" $3")
|
"true "*" $3")
|
||||||
echo "$2 is already running; you can stop it with 'weave stop-$1'." >&2
|
echo "$2 is already running; you can stop it with 'weave stop-$1'." >&2
|
||||||
exit 1
|
return 1
|
||||||
;;
|
;;
|
||||||
"false "*" $3")
|
"false "*" $3")
|
||||||
docker rm $2 >/dev/null
|
docker rm $2 >/dev/null
|
||||||
;;
|
;;
|
||||||
true*)
|
true*)
|
||||||
echo "Found another running container named '$2'. Aborting." >&2
|
echo "Found another running container named '$2'. Aborting." >&2
|
||||||
exit 1
|
return 2
|
||||||
;;
|
;;
|
||||||
false*)
|
false*)
|
||||||
echo "Found another container named '$2'. Aborting." >&2
|
echo "Found another container named '$2'. Aborting." >&2
|
||||||
exit 1
|
return 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -1172,7 +1169,7 @@ rewrite_etc_hosts() {
|
|||||||
CONTENTS="$(etc_hosts_contents $FQDN "$@")"
|
CONTENTS="$(etc_hosts_contents $FQDN "$@")"
|
||||||
# rewrite /etc/hosts, unlinking the file (so Docker does not modify it again) but
|
# rewrite /etc/hosts, unlinking the file (so Docker does not modify it again) but
|
||||||
# leaving it with valid contents...
|
# leaving it with valid contents...
|
||||||
docker run --rm --net=none --privileged \
|
docker run --rm --net=none -e WEAVE_CIDR=none --privileged \
|
||||||
-v $CONTAINERS_PATH:$MNT \
|
-v $CONTAINERS_PATH:$MNT \
|
||||||
--entrypoint=sh \
|
--entrypoint=sh \
|
||||||
$EXEC_IMAGE -c "echo '$CONTENTS' > $MNT_HOSTS && rm -f $MNT_HOSTS && echo '$CONTENTS' > $MNT_HOSTS"
|
$EXEC_IMAGE -c "echo '$CONTENTS' > $MNT_HOSTS && rm -f $MNT_HOSTS && echo '$CONTENTS' > $MNT_HOSTS"
|
||||||
@@ -1457,11 +1454,13 @@ proxy_args() {
|
|||||||
PROXY_HOST=""
|
PROXY_HOST=""
|
||||||
proxy_parse_args "$@"
|
proxy_parse_args "$@"
|
||||||
|
|
||||||
if [ -z "$PROXY_TLS_ENABLED" ] ; then
|
if [ -z "$PROXY_TLS_ENABLED" -a -z "$PROXY_TLS_DETECTION_DISABLED" ] && command_exists docker_tls_args ; then
|
||||||
if [ -z "$PROXY_TLS_DETECTION_DISABLED" ] && ! proxy_parse_args $(docker_tls_args) ; then
|
if ! DOCKER_TLS_ARGS=$(docker_tls_args) ; then
|
||||||
echo "Unable to auto-detect TLS configuration, --no-detect-tls or TLS options are required." >&2
|
echo "Unable to auto-detect proxy TLS configuration; you must launch the proxy with" >&2
|
||||||
exit 1
|
echo "'weave launch-proxy' and supply '--no-detect-tls' or TLS options." >&2
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
proxy_parse_args $DOCKER_TLS_ARGS
|
||||||
fi
|
fi
|
||||||
if [ -z "$PROXY_HOST" ] ; then
|
if [ -z "$PROXY_HOST" ] ; then
|
||||||
case "$DOCKER_CLIENT_HOST" in
|
case "$DOCKER_CLIENT_HOST" in
|
||||||
@@ -1676,7 +1675,6 @@ launch_proxy() {
|
|||||||
-v /var/run/weave:/var/run/weave \
|
-v /var/run/weave:/var/run/weave \
|
||||||
-v /proc:/hostproc \
|
-v /proc:/hostproc \
|
||||||
-e PROCFS=/hostproc \
|
-e PROCFS=/hostproc \
|
||||||
-e WEAVE_CIDR=none \
|
|
||||||
-e DOCKER_BRIDGE \
|
-e DOCKER_BRIDGE \
|
||||||
-e WEAVE_DEBUG \
|
-e WEAVE_DEBUG \
|
||||||
-e COVERAGE \
|
-e COVERAGE \
|
||||||
@@ -1691,7 +1689,14 @@ stop_proxy() {
|
|||||||
stop $PROXY_CONTAINER_NAME "Proxy"
|
stop $PROXY_CONTAINER_NAME "Proxy"
|
||||||
}
|
}
|
||||||
|
|
||||||
launch_plugin() {
|
launch_plugin_if_not_running() {
|
||||||
|
retval=0
|
||||||
|
check_not_running plugin $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE || retval=$?
|
||||||
|
# If an existing plugin is running (we start it with restart=always), return its ID
|
||||||
|
[ $retval = 1 ] && PLUGIN_CONTAINER=$(container_id $PLUGIN_CONTAINER_NAME) && return 0
|
||||||
|
# Any other kind of error code from check_not_running is a failure.
|
||||||
|
[ $retval -gt 0 ] && return $retval
|
||||||
|
|
||||||
PLUGIN_CONTAINER=$(docker run --privileged -d --name=$PLUGIN_CONTAINER_NAME \
|
PLUGIN_CONTAINER=$(docker run --privileged -d --name=$PLUGIN_CONTAINER_NAME \
|
||||||
--restart=always \
|
--restart=always \
|
||||||
--net=host \
|
--net=host \
|
||||||
@@ -1700,12 +1705,14 @@ launch_plugin() {
|
|||||||
$PLUGIN_IMAGE "$@")
|
$PLUGIN_IMAGE "$@")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin_disabled() {
|
||||||
|
[ -n "$WEAVE_NO_PLUGIN" ] || ! check_docker_server_api_version 1.21
|
||||||
|
}
|
||||||
|
|
||||||
remove_plugin_network() {
|
remove_plugin_network() {
|
||||||
if [ -z $WEAVE_NO_PLUGIN ] && check_docker_server_api_version 1.21 ; then
|
docker run --rm --net=host \
|
||||||
docker run --rm --net=host \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
$PLUGIN_IMAGE --remove-network
|
||||||
$PLUGIN_IMAGE --remove-network
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_plugin() {
|
stop_plugin() {
|
||||||
@@ -1846,11 +1853,11 @@ EOF
|
|||||||
deprecation_warnings "$@"
|
deprecation_warnings "$@"
|
||||||
check_not_running router $CONTAINER_NAME $BASE_IMAGE
|
check_not_running router $CONTAINER_NAME $BASE_IMAGE
|
||||||
check_not_running proxy $PROXY_CONTAINER_NAME $BASE_EXEC_IMAGE
|
check_not_running proxy $PROXY_CONTAINER_NAME $BASE_EXEC_IMAGE
|
||||||
check_not_running plugin $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE
|
# Don't check the plugin here, since we start it with `--restart=always`
|
||||||
COMMON_ARGS=$(common_launch_args "$@")
|
COMMON_ARGS=$(common_launch_args "$@")
|
||||||
launch_router "$@"
|
launch_router "$@"
|
||||||
launch_proxy $COMMON_ARGS
|
launch_proxy $COMMON_ARGS
|
||||||
[ -z $WEAVE_NO_PLUGIN ] && check_docker_server_api_version 1.21 && launch_plugin $COMMON_ARGS
|
plugin_disabled || launch_plugin_if_not_running $COMMON_ARGS
|
||||||
;;
|
;;
|
||||||
launch-router)
|
launch-router)
|
||||||
deprecation_warnings "$@"
|
deprecation_warnings "$@"
|
||||||
@@ -1873,14 +1880,14 @@ EOF
|
|||||||
echo $PROXY_CONTAINER
|
echo $PROXY_CONTAINER
|
||||||
;;
|
;;
|
||||||
launch-plugin)
|
launch-plugin)
|
||||||
check_not_running plugin $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE
|
launch_plugin_if_not_running "$@"
|
||||||
launch_plugin "$@"
|
|
||||||
echo $PLUGIN_CONTAINER
|
echo $PLUGIN_CONTAINER
|
||||||
;;
|
;;
|
||||||
env|proxy-env)
|
env|proxy-env)
|
||||||
[ "$COMMAND" = "env" ] || deprecation_warning "$COMMAND" "'weave env'"
|
[ "$COMMAND" = "env" ] || deprecation_warning "$COMMAND" "'weave env'"
|
||||||
if PROXY_ADDR=$(proxy_addr) ; then
|
if PROXY_ADDR=$(proxy_addr) ; then
|
||||||
echo "export DOCKER_HOST=$PROXY_ADDR ORIG_DOCKER_HOST=$DOCKER_CLIENT_HOST"
|
[ "$PROXY_ADDR" = "$DOCKER_CLIENT_HOST" ] || RESTORE="ORIG_DOCKER_HOST=$DOCKER_CLIENT_HOST"
|
||||||
|
echo "export DOCKER_HOST=$PROXY_ADDR $RESTORE"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
config|proxy-config)
|
config|proxy-config)
|
||||||
@@ -2127,7 +2134,7 @@ EOF
|
|||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
[ $# -eq 0 ] || usage
|
[ $# -eq 0 ] || usage
|
||||||
stop_plugin
|
plugin_disabled || stop_plugin
|
||||||
stop_router
|
stop_router
|
||||||
stop_proxy
|
stop_proxy
|
||||||
;;
|
;;
|
||||||
@@ -2145,7 +2152,8 @@ EOF
|
|||||||
;;
|
;;
|
||||||
reset)
|
reset)
|
||||||
[ $# -eq 0 ] || usage
|
[ $# -eq 0 ] || usage
|
||||||
remove_plugin_network || echo "WARNING: docker may hang in this state; re-launch weave and remove attached containers before shutting down" >&2
|
plugin_disabled || remove_plugin_network || \
|
||||||
|
echo "WARNING: docker may hang in this state; re-launch weave and remove attached containers before shutting down" >&2
|
||||||
warn_if_stopping_proxy_in_env
|
warn_if_stopping_proxy_in_env
|
||||||
call_weave DELETE /peer >/dev/null 2>&1 || true
|
call_weave DELETE /peer >/dev/null 2>&1 || true
|
||||||
for NAME in $PLUGIN_CONTAINER_NAME $CONTAINER_NAME $PROXY_CONTAINER_NAME ; do
|
for NAME in $PLUGIN_CONTAINER_NAME $CONTAINER_NAME $PROXY_CONTAINER_NAME ; do
|
||||||
|
|||||||
Reference in new issue
Block a user