Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1126025
  • 博文数量: 188
  • 博客积分: 1156
  • 博客等级: 少尉
  • 技术积分: 2173
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-16 15:01
个人简介

go!go!go!

文章分类

全部博文(188)

文章存档

2024年(2)

2023年(11)

2022年(13)

2021年(15)

2020年(38)

2019年(3)

2018年(6)

2016年(1)

2015年(16)

2014年(13)

2013年(24)

2012年(46)

分类: 服务器与存储

2023-03-02 16:02:13

以下是官方回答:
What does “mvcc: database space exceeded” mean and how do I fix it?
The multi-version concurrency control data model in etcd keeps an exact history of the keyspace. Without periodically compacting this history (e.g., by setting --auto-compaction), etcd will eventually exhaust its storage space. If etcd runs low on storage space, it raises a space quota alarm to protect the cluster from further writes. So long as the alarm is raised, etcd responds to write requests with the error mvcc: database space exceeded.
可以确认下使用空间

  1. ETCDCTL_API=3 etcdctl --write-out=table endpoint status



解决办法:


1. 手动清理历史数据

  1. # get current revision
  2. $ rev=$(ETCDCTL_API=3 etcdctl --endpoints=:2379 endpoint status --write-out="json" | egrep -o '"revision":[0-9]*' | egrep -o '[0-9].*')
  3. # compact away all old revisions
  4. $ ETCDCTL_API=3 etcdctl compact $rev
  5. compacted revision 1516
  6. # defragment away excessive space
  7. $ ETCDCTL_API=3 etcdctl defrag
  8. Finished defragmenting etcd member[127.0.0.1:2379]
  9. # disarm alarm
  10. $ ETCDCTL_API=3 etcdctl alarm disarm
  11. memberID:13803658152347727308 alarm:NOSPACE
  12. # test puts are allowed again
  13. $ ETCDCTL_API=3 etcdctl put newkey 123
  14. OK
2. 自动清理

Auto Compaction

etcd can be set to automatically compact the keyspace with the --auto-compaction-* option with a period of hours:

# keep one hour of history $ etcd --auto-compaction-retention=1

阅读(983) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~