WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Xen, LVM and snapshots

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Xen, LVM and snapshots
From: "Fajar A. Nugraha" <fajar@xxxxxxxxx>
Date: Wed, 15 Oct 2008 09:19:25 +0700
Delivery-date: Tue, 14 Oct 2008 19:20:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <48F50571.8060109@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <48F4D377.1060503@xxxxxxxxxxxxxx> <87skqzrodr.fsf@xxxxxxxxxxxxx> <48F4F5C0.20705@xxxxxxxx> <48F50571.8060109@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.16 (X11/20080724)
Morten W. Petersen wrote:
>
> Well, what I was thinking, was to do a sync on the VM, and flush the
> MySQL database and then immediately afterwards, taking a snapshot of the
> system, backup that snapshot and then after backup "releasing"
> (deleting) the snapshot.
>

Since now you're being specific on what you want to backup, you'd be
more likely get a better response ;-)

General backup strategies with mysql :
- using mysqldump : works with all table type/engines, lock tables
during backup
- using innodb hot backup : works with innodb only, online backup possible
- offline backup : shutdown mysql - copy files - startup mysql

Those three methods can get you clean, consistent backup.
Using file system snapshot (whatever the method is) will get you
"consistent", dirty backup.
"consistent", as in it depends on what engine you use (MyIsam tables
will possibly be corrupted).
dirty, as in some recovery method (which can run automatically, BTW) is
needed (either myisamchk or innodb log replay).

Now, considering the above implications, fs snapshot may not be
desirable on certain situations. For example, if you back up a 50GB
MyIsam table with fs snapshot, you'll most likely require several hours
of myisamchk before it can be restored cleanly. On the other hand Innodb
is ACID-compliant, so you can "safely" use fs snapshot with Innodb tables.

> We're stuck with .18 for now, as that's what Debian comes with and we
> try to stick with off-the-shelf packages.
>
> Do you think that's feasible?
>

If you still want snapshot-based backups I'd actually prefer to use zfs
snapshot instead of Linux LVM snapshot. It's more reliable, more
managable, and more efficient.
If you use opensolaris dom0, you can snapshot dom0's zfs volume which
acts as domU's storage.
If you use opensolaris domU (whatever the dom0 is, including Debian),
you can use zfs (either as root or just for data) on domU and create the
snapshot there.
If you use Linux domU, you can use zfs-fuse and have MySQL data files
there. MySQL runs fine on zfs-fuse.

Regards,

Fajar

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users