[lxc-users] LXD move, how to reduce downtime without live migration
anrdaemon at yandex.ru
Wed May 3 17:11:02 UTC 2017
Greetings, Fajar A. Nugraha!
>>> 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.
Yes, on a filesystem level. No on application level. Exception is when
application makes sure that its writes are consistent, like databases do.
>> 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.
The app behaves correctly, in its own right.
With best regards,
Wednesday, May 3, 2017 20:08:05
Sorry for my terrible english...
More information about the lxc-users