flynn/flynn — pull request #514 by titanous (2014-11-26 23:46:08+00:00)
Title: etcd v0.5 + improvements

This is the first patchset for #427.

It still needs docs and tooling updates, but I thought I'd open it to get some feedback while I finish up.

The basic usage is that before starting `flynn-host`, you run on the first host:

```text
flynn-host init --discovery-init=3
```

Which creates an etcd discovery token and sets it up for a three node cluster. On subsequent nodes run:

```text
flynn-host init --discovery $TOKEN
```

And then start flynn-host on all of the nodes. The first three nodes to come up will participate in the consistency cluster, and the rest will be proxies to the cluster.

The non-discovery flow is similar, but substitutes the `--discovery` flag for a list of all of the peer IP addresses in `--peers`.

The `--join` flag adds a node to an existing consensus cluster.

Future commands will manage promoting and demoting nodes as well as removing them from the cluster.

This is all accomplished in a generic fashion with config files that contain a list of environment variables and arguments to add to the daemon when starting, so that it can be easily adapted to automation and non-etcd systems.