Disk space running out

1,301 views
Skip to first unread message

Zelong Sun

unread,
May 18, 2011, 9:58:05 PM5/18/11
to mongod...@googlegroups.com
Hi all,

I am running a workload with writes and reads against MongoDB.  The disk space is running out, but I don't think its real size can be so large!  Is there a way to recycle the unused or outdated space?


Dennis

Nat

unread,
May 18, 2011, 10:22:12 PM5/18/11
to mongodb-user
You can reclaim the space by doing db.repairDatabase()

Zelong Sun

unread,
May 18, 2011, 10:50:14 PM5/18/11
to mongod...@googlegroups.com
> db.repairDatabase()
{
        "raw" : {
                "192.168.1.206:27018" : {
                        "errmsg" : "Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12776861696 (bytes)",
                        "ok" : 0
                },
                "192.168.1.201:27018" : {
                        "errmsg" : "Cannot repair database ycsb having size: 36440113152 (bytes) because free disk space is: 3184422912 (bytes)",
                        "ok" : 0
                },
                "192.168.1.202:27018" : {
                        "errmsg" : "Cannot repair database ycsb having size: 34293678080 (bytes) because free disk space is: 7046307840 (bytes)",
                        "ok" : 0
                },
                "192.168.1.203:27018" : {
                        "errmsg" : "Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12776861696 (bytes)",
                        "ok" : 0
                },
                "192.168.1.204:27018" : {
                        "errmsg" : "Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12735836160 (bytes)",
                        "ok" : 0
                },
                "192.168.1.205:27018" : {
                        "errmsg" : "Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12667666432 (bytes)",
                        "ok" : 0
                }
        },
        "ok" : 0,
        "errmsg" : "{ 192.168.1.206:27018: \"Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12776861696 (bytes)\", 192.168.1.201:27018: \"Cannot repair database ycsb having size: 36440113152 (bytes) because free disk space is: 3184422912 (bytes)\", 192.168.1.202:27018: \"Cannot repair database ycsb having size: 34293678080 (bytes) because free disk space is: 7046307840 (bytes)\", 192.168.1.203:27018: \"Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12776861696 (bytes)\", 192.168.1.204:27018: \"Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12735836160 (bytes)\", 192.168.1.205:27018: \"Cannot repair database ycsb having size: 32147243008 (bytes) because free disk space is: 12667666432 (bytes)\" }"
}


2011/5/19 Nat <nat....@gmail.com>
--
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.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Nat

unread,
May 18, 2011, 10:57:40 PM5/18/11
to mongodb-user
You need to have enough space for compaction as the compaction is not
inplace/online compaction. You can probably either
- copy the data files to disk that has more space and compact it from
there then copy it back
- mount _tmp folder underneath the database folder to other disk and
repairDatabase()
> 2011/5/19 Nat <nat.lu...@gmail.com>

Eliot Horowitz

unread,
May 18, 2011, 11:28:52 PM5/18/11
to mongod...@googlegroups.com
Can you look at db.stats to see what the actual size is compared to disk size?

Hasan Tayyar BESIK

unread,
Jan 21, 2012, 12:54:06 PM1/21/12
to mongod...@googlegroups.com
I've dropped my unused collections.
Is there any way to compact unused diskspace without having extra space.

Eliot Horowitz

unread,
Jan 21, 2012, 8:28:45 PM1/21/12
to mongod...@googlegroups.com
The only way is a repairDatabase() or resyncing a secondary.

> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.

> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/L-Paeebk1L0J.

Reply all
Reply to author
Forward
0 new messages