# 进入容器内部
docker exec -it kuboard /bin/sh
# 查看 etcd 当前状态
ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2379" --write-out=table endpoint status
#ETCDCTL_API=3 etcdctl --endpoints=127.0.0.1:2379 endpoint status --write-out="json"
# 获取当前revision
rev=$(ETCDCTL_API=3 etcdctl--endpoints="http://127.0.0.1:2379"endpointstatus--write-out="json"|egrep-o'"revision":[0-9]*'|egrep-o'[0-9].*')
# echo $rev
6078532
# 以$rev为基准,压缩历史数据:
ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2379" compact $rev
# 清理多余的碎片空间
ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2379" defrag
#ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2379" --command-timeout=180s defrag
# 解除报警
ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2379" alarm disarm
添加评论