How-to-reclaim-disk-space-by-dropping-mongodb-indexes
How to Reclaim disk space by dropping MongoDB indexes
Even after purging records from the Swimlane main database (esp. the Records collection) and the SwimlaneHistory database (esp. the Records collection) DBs, followed by compacting the space, the disk can still be full. If the disk space is still full, it would be worth checking the size of the indexes and dropping and recreating them accordingly. Follow the steps below to drop the indexes and reclaim space. 1. Check the PVC sizes kubectl get pvc Output: NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE datadir-swimlane-sw-mongo-0 Bound pvc-0b394d7f-19dc-4494-b9c0-eb671c0562a7 10Gi RWO openebs <unset> 422d kotsadm-rqlite-kotsadm-rqlite-0 Bound pvc-6cd0af18-5076-4aa1-ae85-5aef2c0777c1 1Gi RWO openebs <unset> 422dpgdata-postgresql-0 Bound pvc-1022e219-f3af-476c-ab91-b20a1bcb2304 8Gi RWO openebs <unset> 422d 2. Show the disk space occupied by indexes du -hsx /var/openebs/local/*mongo-pvc*/* | sort -rh | head -10 Output: