我目前有一个MongoDB(在AWS上)备份策略,涉及在一个节点上自动执行数据/日志卷的每日快照。这个过程是:
更换RS成员时,我从快照启动一个新实例并将其添加到副本集。我唯一的问题是在mongo进程启动时,在新节点跳转到SECONDARY并从另一个成员的oplog重放之前,有一个很长的延迟(〜500GB数据约20-30分钟)。我在mongodb.log文件中看到的所有内容都是这样的:
[initandlisten] Starting WiredTigerRecordStoreThread local.oplog.rs
[initandlisten] The size storer reports that the oplog contains 659681 records totaling to 4196461664 bytes
[initandlisten] Sampling from the oplog between Dec 20 05:29:14:2 and Jan 18 06:00:00:8 to determine where to place markers for truncation
[initandlisten] Taking 335 samples and assuming that each section of oplog contains approximately 19672 records totaling to 125140475 bytes