Cluster Operations Fail With Error - etcdserver: mvcc: database space exceeded
Problem
We have noticed below logs while performing any operation on the cluster.
etcdserver: mvcc: database space exceededRequests are failing with no space warning:
etcdserver: failed to apply request,took 2.429[C2][B5]s,request header:[ID:1920634987875929770 ] txn:[compare:<target:MOD key:"/registry/services/endpoints/kube-system/kube-controller-manager" mod_revision:287319046 ] success:[request_put:<key:"/registry/services/endpoints/kube-system/kube-controller-manager" value_size:473 ]> failure:[]>,resp ,err is etcdserver: no spaceEnvironment
Platform9 Managed Kubernetes - All Versions
ETCD
Cause
The ETCD database size on master node reached 2.1 GB so ETCD stopped serving new read/write requests due to database size saturation.
Resolution
Follow the below steps to increase the ETCD space to accommodate new write requests. Make sure you have the ETCD backup before proceeding with the steps.
Note: In this example, the ETCD database space to increased to 6 GB.
Stop the PMK stack.
For PMK v5.1 and K8s v1.20 and above, append the
ETCD_QUOTA BACKEND_BYTESandETCD_SNAPSHOT_COUNTvalues to /etc/pf9/kube_override.env file.
Note: The variable ETCD_QUOTA_BACKEND_BYTES is used to increase disk space and ETCD_SNAPSHOT_COUNT to reduce the snapshot count in memory.
Start the PMK stack by running command:
Once the PMK stack is up, start the pf9-hostagent service.
Run the compaction on ETCD database by logging into the ETCD container.
Perform defragmentation on ETCD to reclaim space.
Disable the space exceeded alarms for the etcd container.
Additional Information
If post compaction and defragmentation the ETCD DB size is getting filled within days, enabling ETCD_AUTO_COMPACTION is a better solution. Reference: etcd documentation
Last updated
