Etcd is a highly available, distributed, and consistent key-value store that is used for shared configuration and service discovery. Some notable projects that use Etcd are SwarmKit, Kubernetes, and Fleet.
Etcd can gracefully manage master elections in case of network splits and can tolerate node failure, including the master. Applications, in our case Docker containers and Swarm nodes, can read and write data into Etcd's key-value storage, for example the location of services.
We once again create an example with one manager and three nodes, this time by illustrating Etcd.
This time, we'll need a real discovery service. We can simulate a non-HA system by running the Etcd server inside Docker itself. We create a cluster made of four hosts, with the following names:
etcd-m
will be the Swarm master and will host also the Etcd serveretcd-1
: The first Swarm nodeetcd-2
: The second Swarm nodeetcd-3
: The third Swarm node
The operator, by connecting...