MongoDB副本集secondary初始化同步数据问题
为情所困
为情所困 2017-04-28 09:04:41
0
1
528

场景:

由于磁盘空间不足,要替换mongoDB工作目录所在的硬盘,
其中有个db的数据差不多150G大小,现在新增了个硬盘,
新增节点从primary节点初始化同步完成后,该db的大小只有差不多70G,
看了下里面每个collection的count总数不变。

疑问:

这一个同步后,数据容量为什么会相差这么多呢?
这种全量的初始化同步方式,是会有数据压缩什么的吗?
看了文档,找了好久没找到相关信息。跪求!!!
为情所困
为情所困

reply all(1)
曾经蜡笔没有小新

Because some data has been deleted. Nothing like a database automatically reduces the file size when data is deleted - this is an extremely expensive operation that requires rewriting the entire file.

But it’s okay. Although MongoDB is not PostgreSQL and does not have automatic sorting, MongoDB is not MySQL either and even manual sorting is not possible. You try the compact command, if that doesn't work, try repair. I did it before, but I forgot about it now.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template