Backup Mongodb on EC2 through EBS snapshots - timing issue
- by DmitrySemenov
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 shelldb.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 comand ec2-create-snapshot or after it's finished and the actual snapshot is created
thanks,
Dmitry