Re: a question about mongodb backup using lvm snapshot

252 views
Skip to first unread message

Kay

unread,
Nov 8, 2012, 2:59:08 PM11/8/12
to mongod...@googlegroups.com
Hi Jinxuan Hou --

As I understand the question, then by default, the 'journal commit interval'  is 100 millisecond (unless you have overridden the 'journal commit interval' value or if you issue getLastError command).  As such, there may be ~100 millisecond window during which data durability is as risk.  Also, if you are using Amazon EBS, refer to the section in the manual.

Hope this answers your question.

Regards,

Kay


On Monday, October 22, 2012 10:34:10 PM UTC-4, Jinxuan Hou wrote:
Hi, i have a doubt about mongodb backup using lvm snapshot.

In the manual document(http://docs.mongodb.org/manual/administration/backups/), in the Backup With Journaling section it says that if you enable journal you can backup your database in following steps:
1.Create Snapshot
lvcreate --size 100M --snapshot --name mdb-snap01 /dev/vg0/mongodb
2.Archive Snapshots
umount /dev/vg0/mdb-snap01
dd if=/dev/vg0/mdb-snap01 | tar -czf mdb-snap01.tar.gz
3.Restore Snapshot
lvcreate --size 1G --name mdb-new vg0
tar -xzf mdb-snap01.tar.gz | dd of=/dev/vg0/mdb-new
mount /dev/vg0/mdb-new /srv/mongodb
4.Remote Backup Storage
umount /dev/vg0/mdb-snap01
dd if=/dev/vg0/mdb-snap01 | ssh user...@example.com tar -czf /opt/backup/mdb-snap01.tar.gz
lvcreate --size 1G --name mdb-new vg0
ssh user...@example.com tar -xzf /opt/backup/mdb-snap01.tar.gz | dd of=/dev/vg0/mdb-new
mount /dev/vg0/mdb-new /srv/mongodb
there  is not lock fsync operations necessary.

just as (http://www.mongodb.org/display/DOCS/Backups)said:As long as all files are snapshotted at the same point in time, you don't need to lock+fsync

but when taking lvm snapshot, everything are writen to the Journal log ,but the data is stealing in the file system buffer or the OS buffer is that ok for we to recover 
our data to a consistent point .(especially when the sln No.s of  Journal log and Filesystem snapshot are not consistent)

looking forward for your answer.

thank you very much .
 
Reply all
Reply to author
Forward
0 new messages