I set up a new standalone mongo2.6 and copy one folder(database) from another machine to its data path (because I enabled directoryperdb
).
Then I set up another machine to make them as a replica set.
After rs.initiate
and data sync finished, I found the local file size on primary and secondary are:
primary: 232G
secondary: 316G
I found similar question here https://stackoverflow.com/questions/14843229/mongodb-replica-set-disk-size-difference-in-primary-and-secondary-nodes
But as the above answer, the primary should use more disk space than the secondary.
I need to migrate about 25T data from the old mongo 2.6 cluster. If every database's local file size takes so much more disk space in the secondary, then I need to take this as a spec consideration in the newly bought machine. :(