Project

Profile

Help

Task #3112

Updated by ttereshc over 6 years ago

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 add a blog post showing a recipe to the docs in the format of a 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 2.4+ (there could be difference in options for RHEL7). @mongod@ command) 

Back