My local.oplog.rs collection is 16GB. Is there anyway to reclaim that wasted free space? Can I do a repair database on it?
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
2. drop local database's oplog collection
db = db.getSiblingDB('local')
db.oplog.rs.drop()
3. create new oplogs with 15GB
db.runCommand( { create: "oplog.rs", capped: true, size: (15 * 1024 * 1024 * 1024) } )
4.insert last entry
db.oplog.rs.save( db.temp.findOne() )
5.double check it
db.oplog.rs.find();
6. If you are increase op log, skip following steps and go to last one for restart mongodb.
For shrink op log and release space from local database
run a mongodump by make a new directory
cd
mkdir localcopy
cd localcopy
mongodump --port 28017 -u admin -p -d local
7.drop local database (will finally release the space)
use local
db.dropDatabase()
8.mongorestore (will recreate local with smaller size)
cd localcopy
mongorestore --port 28017 -u admin -p
9. restart database to double check. ops.rs record
use local
db.oplog.rs.find();