[lxc-users] Online container backup
Narcis Garcia
informatica at actiu.net
Thu Jun 11 07:07:09 UTC 2015
Why is a snapshot better with database services?
(time matter apart)
El 11/06/15 a les 08:58, Fajar A. Nugraha ha escrit:
> On Thu, Jun 11, 2015 at 1:51 PM, Narcis Garcia <informatica at actiu.net
> <mailto:informatica at actiu.net>> wrote:
>
> Debian 8 in a single and tratitional ext4 partition.
> My idea is that the backup is a complete container export, to be
> restored in another box if necessary.
>
>
>
> I highly recommend you switch to btrfs or zfs (I use zfs)
>
>
>
> Is there some newer LXC repository for Debian as ppa:ubuntu-lxc/daily ?
>
>
>
> You have to ask debian folks for that. AFAIK building from source should
> give you the same functionality though.
>
>
>
> At this moment, my procedure is:
> $ lxc-stop -n MyGuest
> $ tar -cjf /var/backups/MyGuest.tar.bz2 /var/lib/lxc/MyGuest
> $ lxc-start -n MyGuest
> but container unavailability is too long.
>
>
> exactly. With zfs it's simply "zfs snapshot data/lxc/guest at backup-1",
> which often takes less than 1 second (and it doesn't block container IO)
>
>
>
> Another procedure, but without stopping container:
> $ cp -aPx /var/lib/lxc/MyGuest /tmp/MyGuest
> $ tar -cjf /var/backups/MyGuest.tar.bz2 /tmp/MyGuest
>
>
>
> Dangerous. If you have mysql (or another db) running on the container,
> you may be unable to start the it from backup later due to it
> complaining being corrupt.
>
> --
> Fajar
>
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
More information about the lxc-users
mailing list