etcd is a key-value store built on the Raft consensus protocol.


etcd data is stored in /var/lib/etcd by default.

The etcd daemon is managed with the etcdctl client, which is obtainable directly from GitHub as a standalone statically-linked binary or in container form.

The version of the protocol used for communication with the server is specified by the ETCDCTL_API environment variable; it's easiest to export this in the shell ahead of time. The --cacert, --cert and --key options can also be specified as environment variable.


Snapshots take a backup of the current state of the data:

etcdctl \
    --endpoints https://localhost:2379 \
    --cacert /etc/etcd/ca.crt \
    --cert /etc/etcd/server.crt \
    --key /etc/etcd/server.key \
    snapshot save /tmp/backup.db

etcdctl \
    --write-out=table \
    snapshot status /tmp/backup.db


Just specify the path:

etcdctl snapshot restore /tmp/backup.db

Managing members


$ etcdctl --endpoints http://localhost:2379 \
    member list
8211f1d0f64f3269, started, member1,,
91bc3c398fb3c146, started, member2,,
fd422379fda50e48, started, member3,,

Removing failed members:

etcdctl member remove 8211f1d0f64f3269

Adding new members:

etcdctl member add name --peer-urls=