Please help me to find correct MongoDB size.
db version v3.4.10
I have also executed below command to check if there are any ghost file. The below command output is zero.
lsof | grep deleted | grep mongo | wc -l
In db.stats, the data size is showing 1236GB
"collections" : 23, "views" : 0, "objects" : 702876605, "avgObjSize" : 1914.5578033287934, "dataSize" : 1253.2788225263357, "storageSize" : 374.982120513916, "numExtents" : 0, "indexes" : 52, "indexSize" : 21.016620635986328, "ok" : 1
Disk used is showing as 916GB (/data/mongo/) out of 1.4T
In show dbs output, DB size is showing as 396B
admin 0.000GB
local 15.906GB
abcd 396.008GB
I need to sync DB from primary site to secondary (replication), How much free space is required on secondary site (915 GB or 1236GB)? Also why it's showing DB size different in point 1,2 & 3? Which value/size is correct DB size?
Thanks in advance.
mongo
is the (legacy) mongo shell, it does not store any data. I guess you need to search formongod
which is the database process./data/mongo/
would be correct. Apart from raw datasize you also need some space for the oplog, temp files, etc.