Skip to content

Instantly share code, notes, and snippets.

@therevoman
Forked from canhnt/etcd-defrag.sh
Created September 3, 2019 19:11
Show Gist options
  • Save therevoman/cf3b02b7577d5328c750f5c993fdce89 to your computer and use it in GitHub Desktop.
Save therevoman/cf3b02b7577d5328c750f5c993fdce89 to your computer and use it in GitHub Desktop.
Compact and defrag etcd cluster
# Ref https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/maintenance.md#space-quota
export ETCDCTL_API=3
etcdctl endpoint status --write-out="json"
etcdctl endpoint status --write-out="table"
etcdctl compact $rev
etcdctl defrag
etcdctl endpoint status --write-out="table"
etcdctl alarm list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment