Weave networks are built by getting the reachable IP addresses of your Weave routers and connecting them. However, trying to automate this process can be a difficult task: peers on the same network should discover each other automatically, getting their IPs, connecting, etc… In order to make things easier in this kind of scenario, we have developed Weave Discovery.
Discovery retrieves and watches the list of peers in a Weave network from a discovery backend. Discovery uses this information for telling a Weave Router about new peers it must connect to, as well as peers that are not available anymore and must be forgotten. Discovery can also advertise this Weave Router in the same backend so other peers can join it.
And what is a discovery backend? A backend is any kind of database where the list of peers is stored. It can be as simple as a regular file with one IP per line, or as sophisticated as a etcd database or a Zookeeper cluster. In fact, Discovery uses the same backends that Docker’s Swarm discovery employs for their clustering solution, so we can even use Swarm tokens for connecting nodes.
Read the complete article here.