I currently have a MongoDB backup strategy (on AWS) that includes automating daily snapshots of data / log volume on a single node. Process:
- fsyncLock ()
- launch an AWS snapshot on a volume (and expect success)
- fsyncUnlock ()
When replacing an RS member, I start a new instance from the snapshot and add it to the replica set. The only problem I encountered is that the mongo startup process is very long (~ 20-30 minutes for ~ 500 GB of data) before the new node goes into SECONDARY and repeats from another oplog member. Everything I see looks like this in the mongodb.log file:
[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
- What is Mongo doing here?
- Is oplog useful for MongoDB on startup (from a snapshot), other than determining when it was last selected (I have logging)?
- Can I fix this by simply trimming everything from the oplog except the most recent entry before taking the picture?
source
share