Project

Profile

Help

Task #3112

closed

Write a blog post with a recipe on how to reclaim a disk space used by MongoDB

Added by ttereshc over 6 years ago. Updated almost 5 years ago.

Status:
CLOSED - COMPLETE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Pulp 2
Sprint:
Sprint 34
Quarter:

Description

A common problem, especially in heavily loaded cases, is that MongoDB can use much more disk space than it needs after some time. And users are willing to reclaim disk space when it happens.

MongoDB docs: https://docs.mongodb.com/manual/reference/command/repairDatabase/#repairdatabase-wrappers

The suggestion is to write a blog post showing a recipe in the format of shell script which will:
- remind/suggest to make a backup
- perform checks
-- pulp services are stopped
-- mongod is not running
-- there is enough disk space (according to docs, twice of the used space + 2GB) to perform mongod --repair
- as a mongodb user, run mongod --repair (with additional parameters if needed)
- print to the stdout how much space was used before and after a repair.

Make sure, script works for MongoDB 2.6 (it's a default version for RHEL7).

Also available in: Atom PDF