Matthias Radestock bfb050c9cc better convergence when peers restart
Previously when a peer restarted, information about the new
incarnation (i.e. with a different UID) was not accepted by other
peers (and connections would be dropped) unless all knowledge of the
previous incarnation had been purged. This could result in a lot of
connection churn and hence connectivity disruption, and, in some
pathological cases, very slow convergence and hence acceptance of the
new incarnation into the network.

We now no longer drop connections when encountering different
incarnations of a peer. There are two situations when that can happen:

1) on connection establishment

we simply proceed

2) on receipt of gossip

to ensure convergence we

a) treat the UID as an additional discriminator when deciding whether
we should update our information about a peer with that which was
gossiped. Specifically, we update the information we hold when a) the
gossiped version is greater, or b) is the same and the UID is
greater.

b) include the UID in the information we update

c) move our own version number beyond any we receive for ourselves, if
the received UID differs from ours.

With (a) we establishes a total order of peer information across
several incarnations of the same peer. i.e. we consider information to
be fresher if it has a higher version, or the same version and higher
UID. This may seem somewhat counter intutive, since it will generally
treat information about new incarnations as older than old
incarnations, since incarnations always start life with version 1. But
to do better we'd need to establish a total order of incarnations that
matches their temporal occurrence. Which requires some sort of durable
state.

So instead we have (c). Through that we learn the highest version
number of any old incarnation of ourselves that other peers still
hold, and then make sure that our version is greater than
that. Essentially we continue where the old incarnations left
off. It's as if instead of restarting we had simply changed UIDs. And
due to (a) and (b) the information about the new incarnation of
ourselves, now with a higher version, will supersede that of the old
incarnations.

Fixes #1554.
2015-11-09 14:58:33 +00:00
2015-09-30 08:20:56 +00:00
2015-09-25 06:19:00 +00:00
2015-10-15 14:26:39 +01:00
2015-11-07 15:45:29 +00:00
2015-11-03 10:13:43 +00:00
2015-11-04 16:45:16 +00:00
2015-11-08 11:04:48 +00:00
2015-09-30 08:20:56 +00:00
2015-11-05 14:34:13 +00:00
2015-10-01 11:49:31 +00:00
2014-08-18 17:55:26 +01:00
2015-11-03 15:31:51 +00:00
2015-10-22 11:58:14 +01:00

Weave - weaving containers into applications

Build Status Integration Tests Coverage Status

About Weaveworks

Weaveworks is the company that develops Weave - the most productive way for developers to connect, observe and control Docker containers. To learn about our products, including getting started tutorials, visit our website and documentation or continue to read about some of the more technical aspects of Weave in this readme.

Weave

Weave creates a virtual network that connects Docker containers deployed across multiple hosts and enables their automatic discovery.

Weave Virtual Network

Applications use the network just as if the containers were all plugged into the same network switch, with no need to configure port mappings, links, etc. Services provided by application containers on the weave network can be made accessible to the outside world, regardless of where those containers are running. Similarly, existing internal systems can be exposed to application containers irrespective of their location.

Weave Deployment

Weave can traverse firewalls and operate in partially connected networks. Traffic can be encrypted, allowing hosts to be connected across an untrusted network.

With weave you can easily construct applications consisting of multiple containers, running anywhere.

Weave works alongside Docker's existing (single host) networking capabilities, so these can continue to be used by containers.

Installation

Ensure you are running Linux (kernel 3.8 or later) and have Docker (version 1.3.1 or later) installed. Then install weave with

sudo curl -L git.io/weave -o /usr/local/bin/weave
sudo chmod a+x /usr/local/bin/weave

For usage on OSX (with Docker Machine) you first need to make sure that a VM is running and configured, as shown in the Docker Machine documentation. Then you can launch weave directly from the OSX host.

CoreOS users see here for an example of installing weave using cloud-config.

Amazon ECS users see here for the latest Weave AMIs and here to get started with Weave on ECS.

Weave respects the environment variable DOCKER_HOST, so you can run it locally to control a weave network on a remote host.

Quick Start Screencast

Example

Say you have docker running on two hosts, accessible to each other as $HOST1 and $HOST2, and want to deploy an application consisting of two containers, one on each host.

On $HOST1 we run:

host1$ weave launch
host1$ eval $(weave env)
host1$ docker run --name a1 -ti ubuntu

NB: If the first command results in an error like http:///var/run/docker.sock/v1.19/containers/create: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS? then you likely need to be 'root' in order to connect to the Docker daemon. If so, run the above and all subsequent commands in a single root shell (e.g. one created with sudo -s). Do not prefix individual commands with sudo, since some commands modify environment entries and hence they all need to be executed from the same shell.

The first line runs weave. The second line configures our environment so that containers launched via the docker command line are automatically attached to the weave network. Finally, we run our application container.

That's it! If our application consists of more than one container on this host we simply launch them with docker run as appropriate.

Next we repeat similar steps on $HOST2...

host2$ weave launch $HOST1
host2$ eval $(weave env)
host2$ docker run --name a2 -ti ubuntu

The only difference, apart from the name of the application container, is that we tell our weave that it should peer with the weave on $HOST1 (specified as the IP address or hostname, and optional :port, by which $HOST2 can reach it). NB: if there is a firewall between $HOST1 and $HOST2, you must permit traffic to the weave control port (TCP 6783) and data ports (UDP 6783/6784).

Note that we could instead have told the weave on $HOST1 to connect to $HOST2, or told both about each other. Order does not matter here; weave automatically (re)connects to peers when they become available. Also, we can tell weave to connect to multiple peers by supplying multiple addresses, separated by spaces. And we can add peers dynamically.

Weave must be started once per host. The relevant container images are pulled down on demand, but if you wish you can preload them by running weave setup - this is particularly useful for automated deployments, and ensures that there are no delays during later operations.

Now that we've got everything set up, let's see whether our containers can talk to each other...

In the container started on $HOST1...

root@a1:/# ping -c 1 -q a2
PING a2.weave.local (10.40.0.2) 56(84) bytes of data.
--- a2.weave.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.341/0.341/0.341/0.000 ms

Similarly, in the container started on $HOST2...

root@a2:/# ping -c 1 -q a1
PING a1.weave.local (10.32.0.2) 56(84) bytes of data.
--- a1.weave.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.366/0.366/0.366/0.000 ms

So there we have it, two containers on separate hosts happily talking to each other.

Find out more

Contact Us

Found a bug, want to suggest a feature, or have a question? You can File an issue. And there is a Weave Users Google Group, which you can post to by email at weave-users@weave.works. Or you can contact Weaveworks directly at help@weave.works. When reporting a bug, please include which version of weave you are running, as shown by weave version.

Follow on Twitter: @weaveworks.

Read the Weave blog: Weaveblog.

IRC: #weavenetwork

S
Description
Weave Net fork (from rajch/weave)
Readme
36 MiB
0 Stars 1 Watchers 0 Forks
Languages
Go 73.7%
Shell 21.8%
Makefile 2.4%
Dockerfile 1.5%
Ruby 0.3%
Other 0.3%