Skip to main content

5.1.5.3. Useful Commands

To use the executable on the master, we will use the etcdctl alias; to use etcdctl inside a container, use the ectl, nectl aliases.

CommandsDescription
etcdctl --endpoints=$(etcdctlMembers) member list -w table
List ETCD cluster nodes from one of the nodes in table format
etcdctl --endpoints=$(etcdctlMembers) endpoint status -w table
Display ETCD cluster node status in table format
etcdctl --endpoints=$(etcdctlMembers) get / --prefix
List all keys and values whose key matches the given prefix.
etcdctl --endpoints=$(etcdctlMembers) get / --prefix --keys-only
List all keys whose key matches the given prefix.
etcdctl --endpoints=$(etcdctlMembers) snapshot save PATH_TO_SAVE.db
Create a snapshot of the ETCD database state
etcdctl --endpoints=$(etcdctlMembers) defrag --cluster
Defragment the DB files. (When the cluster is stopped, use with the --data-dir flag specifying the file path)
etcdctl --endpoints=$(etcdctlMembers) compaction ${INDEX}
Compact the data and assign a revision number