MongoDB Replica Set: Disk size difference in Primary and Secondary Nodes

烂漫一生 提交于 2019-12-05 07:35:20

When you do an initial sync from scratch on a secondary, it writes all the data fresh. This removes padding, empty space (deleted data) etc. As a result, in that respect it is similar to running a repair.

If you ran a repair on the primary (blocking operation, only to be done if absolutely necessary), then the two would be far closer overall.

If you check the output from db.stats() you should see that the various databases have the same object count, the data directory size differences are nothing to be worried about.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!