Backing up the cluster configuration

The important data on managers is stored in /var/lib/docker/swarm. Here we have:

  • The certificates in certificates/
  • The Raft status with Etcd logs and snapshots in raft/
  • The tasks database in worker/
  • Other less crucial information, such as the current manager status, the current connection socket, and so on.

It's a good idea to set up a periodical backup of this data, in case recovery is needed.

The space used by the Raft log depends on the number of tasks spawned onto the cluster and on how frequently their states change. For 200,000 containers, the Raft log can grow up to around 1GB of disk space every three hours. A log entry of each task occupies around 5 KB. Consequently, the log rotation policies for the Raft ...

Get Native Docker Clustering with Swarm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.