Complete the command to create a snapshot backup of etcd.
ETCDCTL_API=3 etcdctl snapshot save [1]
The etcdctl snapshot save command requires the path where the snapshot file will be saved. Here, /var/lib/etcd/backup.db is a common location for backups.
Complete the command to check the status of the etcd cluster.
ETCDCTL_API=3 etcdctl endpoint [1]
The etcdctl endpoint status command shows the health and status of the etcd cluster endpoints.
Fix the error in the restore command by completing the missing flag.
ETCDCTL_API=3 etcdctl snapshot restore backup.db [1] /var/lib/etcd-new
The --data-dir flag specifies the directory where the restored etcd data will be stored.
Fill both blanks to set environment variables for etcdctl to connect securely.
export ETCDCTL_API=3 export ETCDCTL_ENDPOINTS=[1] export ETCDCTL_CACERT=[2]
The ETCDCTL_ENDPOINTS variable sets the etcd server address, usually with HTTPS and port 2379. The ETCDCTL_CACERT points to the CA certificate file for secure TLS connection.
Fill all three blanks to create a snapshot, check its status, and restore it to a new directory.
ETCDCTL_API=3 etcdctl snapshot save [1] ETCDCTL_API=3 etcdctl endpoint status --write-out=table ETCDCTL_API=3 etcdctl snapshot restore [2] [3]
--data-dir flag or using wrong directory.First, save the snapshot to /var/backups/etcd-snapshot.db. Then check the cluster status. Finally, restore the snapshot from the same file to a new data directory /var/lib/etcd-new using the --data-dir flag.