etcd默认的空间配额限制为2G,超出空间配额限制就会影响服务,所以需要定期清理

以下是etcd磁盘清理的步骤:

1. 显示空间配额: ETCDCTL_API=3 etcdctl --endpoints=$ip:$port --write-out=table endpoint status

etcd磁盘清理步骤

2.查看告警: ETCDCTL_API=3 etcdctl --endpoints=$ip:$port alarm list 

3.获取当前etcd数据的修订版本(revision)

1)rev=$(ETCDCTL_API=3 etcdctl --endpoints=$ip:$port endpoint status --write-out="json" | egrep -o '"revision":[0-9]*' | egrep -o '[0-9].*')

2)echo $rev

etcd磁盘清理步骤

4.整合压缩旧版本数据 :ETCDCTL_API=3 etcdctl --endpoints=$ip:$port compact $rev

etcd磁盘清理步骤

5. 执行碎片整理: ETCDCTL_API=3 etcdctl --endpoints=$ip:$port defrag

etcd磁盘清理步骤

6.解除告警 : ETCDCTL_API=3 etcdctl --endpoints=$ip:$port alarm disarm

7.验证可以添加新数据:ETCDCTL_API=3 etcdctl --endpoints=$ip:$port put newkeytestfornospace 123

etcd磁盘清理步骤

etcd默认的空间配额限制为2G,超出空间配额限制就会影响服务,所以需要定期清理

以下是etcd磁盘清理的步骤:

1. 显示空间配额: ETCDCTL_API=3 etcdctl --endpoints=$ip:$port --write-out=table endpoint status

etcd磁盘清理步骤

2.查看告警: ETCDCTL_API=3 etcdctl --endpoints=$ip:$port alarm list 

3.获取当前etcd数据的修订版本(revision)

1)rev=$(ETCDCTL_API=3 etcdctl --endpoints=$ip:$port endpoint status --write-out="json" | egrep -o '"revision":[0-9]*' | egrep -o '[0-9].*')

2)echo $rev

etcd磁盘清理步骤

4.整合压缩旧版本数据 :ETCDCTL_API=3 etcdctl --endpoints=$ip:$port compact $rev

etcd磁盘清理步骤

5. 执行碎片整理: ETCDCTL_API=3 etcdctl --endpoints=$ip:$port defrag

etcd磁盘清理步骤

6.解除告警 : ETCDCTL_API=3 etcdctl --endpoints=$ip:$port alarm disarm

7.验证可以添加新数据:ETCDCTL_API=3 etcdctl --endpoints=$ip:$port put newkeytestfornospace 123

etcd磁盘清理步骤

相关文章:

  • 2022-02-09
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-29
  • 2022-01-15
  • 2021-12-29
  • 2021-07-24
相关资源
相似解决方案