Take Snapshot of mongodb server in AMAZON using ec2-consistent-snapshot

285 views
Skip to first unread message

Ranjeet Kumar

unread,
Jul 19, 2015, 2:15:10 PM7/19/15
to mongod...@googlegroups.com
I want to take snapshot of mongodb server in AMAZON using ec2-consistent snapshot. if any one do that then please help me.Thanks in Advance...


 

Stephen Steneker

unread,
Jul 20, 2015, 1:35:54 AM7/20/15
to mongod...@googlegroups.com, ranjee...@meritnation.com
On Monday, 20 July 2015 04:15:10 UTC+10, Ranjeet Kumar wrote:
I want to take snapshot of mongodb server in AMAZON using ec2-consistent snapshot. if any one do that then please help me.Thanks in Advance...

Hi Ranjeet,

Instructions for backing up with EC2 snapshots are included in the MongoDB documentation:
 http://docs.mongodb.org/ecosystem/tutorial/backup-and-restore-mongodb-on-amazon-ec2/

As noted in these instructions, if your data and journal files are on a single EC2 volume (i.e. the default install) you can take a consistent backup using the standard ec2-create-snapshot without pausing your database writes.

I assume you are referring to this script: https://github.com/alestic/ec2-consistent-snapshot. It looks like this script always does a db.fsyncLock() to try to quiesce write, which may be overly pessimistic if your data + journal files are on a single EC2 volume.


If you are using MongoDB 3.0 with the WiredTiger storage engine, there is an important caveat that hasn't been added to the EC2 instructions yet: using db.fsyncLock() for backups is not currently supported for the WiredTiger storage engine as there is no guarantee the data files will not change. The documentation for filesystem/snapshot backups is currently being updated with more specific instructions for WiredTiger: DOCS-5710.

There's also an open improvement (currently targeted for the MongoDB 3.2 production release) that you can watch/upvote: SERVER-18899.

Regards,
Stephen 

Ranjeet Kumar

unread,
Jul 20, 2015, 9:33:37 AM7/20/15
to mongod...@googlegroups.com


On Sunday, July 19, 2015 at 11:45:10 PM UTC+5:30, Ranjeet Kumar wrote:
I want to take snapshot of mongodb server in AMAZON using ec2-consistent snapshot. if any one do that then please help me.Thanks in Advance...


 HI Stephen,

while using ec2-create-snapshot there is need to  run   db.fsyncLock()  in Mongo Shell. but i want to do snapshot frequently by the script. so ec2-create-snapshot will not stop or pause Mongodb so how cam we take snapshot consistently without any data loss.But in ec2-consistent-snapshot uses xfs filesystem for freeze data directory.But i am not able to use ec2-consistent-snapshot because of perl compatibility with mongodb.
Reply all
Reply to author
Forward
0 new messages