[lxc-users] LXD move, how to reduce downtime without live migration

Fajar A. Nugraha list at fajar.net
Tue May 2 02:00:12 UTC 2017

On Mon, May 1, 2017 at 12:49 AM, Andrey Repin <anrdaemon at yandex.ru> wrote:

> Greetings, Spike!
> > thank you for sharing Fajar, this is very helpful. A couple questions:
> > 1. how do you ensure data consistency? I don't think it's safe to take a
> > snap of a mysql container with mysql running for example. Other backup
> > solutions I've used in the past, like bacula for example, allowed you to
> run
> > pre-backup jobs to say make the db readonly or stuff like that. Are you
> doing such a thing with sanoid?
> > 2. related to, if you move lib/lxd, is it safe to snap with lxd running?
> no consistency issues?
> It is never a good idea to snapshot the disk of a running system.

On an ideal world, sure.

In reality, when your options are limited between "shutdown your apps every
night before backups" or "perform storage-level-snapshot which doesn't
interfere with the running system and can be brought to consistent state",
I chose the later.

> Any files opened for writing are unlikely to backup properly.

Filesystem and database journaling is written with that in mind, so they
can safely deal with (e.g.) half-(over)written files.

> It is less of an issue for MySQL and other applications that use journaling
> for their write operations, but on any given live system there's more apps
> that don't expect power interruptions.
If you have one of those apps, I highly recommend you fix it, or find
another one that behave correctly. You don't want to be left out cold when
a real power interruption (or server crash) happens.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170502/08d6ba0b/attachment.html>

More information about the lxc-users mailing list