Backup Mongodb on EC2 through EBS snapshots - timing issue

by DmitrySemenov   Last Updated November 08, 2018 22:00 PM

I'm following this guidance http://docs.mongodb.org/ecosystem/tutorial/backup-and-restore-mongodb-on-amazon-ec2/

I have 4 EBS 1000 IOPS volumes assigned to instance.

These 4 volumes through MDADM assembled into software RAID10 array.

I want to do backups through EBS Snapshots as explained in the article above.

Question:

Mongodb says - that I need to

mongo shell>db.runCommand({fsync:1,lock:1}); -- this will lock the db for writing

....run snapshot creation...

mongo shell> db.$cmd.sys.unlock.findOne(); -- this will unlock the db for writing

So, do I need to unlock the DB for writing after I issued the command ec2-create-snapshot or after it's finished and the actual snapshot is created?

thanks, Dmitry



Answers 1


do I need to unlock the DB for writing after I issued the comand ec2-create-snapshot or after it's finished and the actual snapshot is created

once the ec2-create-snapshot api cmd returns (with the snap-id), you are good to unlock for writing. However, you may see slightly degraded performance until snap is finished.

Amazon sends new writes during the snapshot creation time to temp storage, and this can be slower. Once snap is complete things converge. Keep in mind, the first ebs volume snap will take a while, but then the following snaps are incremental backups, and will finish much faster.

nandoP
nandoP
June 02, 2014 06:27 AM

Related Questions


How to make daily database backups readily queryable

Updated January 17, 2018 08:00 AM

RDS snapshot: how long does I/O suspension occur?

Updated July 05, 2018 07:00 AM

How to do offsite AWS RDS PostgreSQL backups?

Updated October 16, 2017 23:00 PM


MongoDB Backup & purge

Updated May 18, 2015 23:00 PM