Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have debian box with big database.

I want to do a lot of risky operation with this database.

Its about updating the sofware which works with this db.

I can stop database for 5 min, but not for more time.

Db files is innodb files on lvm logical volume.

When I doing backup, I do it with lvm snapshots.

I am pretty sure, that I need more then one try for updating, something always going bad.

My idea is: What if I do lvm snapshot (with big size), mount it, start another mysql instance and do all risky work on this instance.

If problem occurs, I just remove snapshot and start again.

If all be correct, and all test will be passed (it probably take 1-2 days) - I do backup from second instance, and move it to first instance.

I need something for start second instance without touch my first instance. What I can use?

  • Do debootstrap and chroot?
  • Install kvm ?

I need your advices.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

FreeBSD-like jail for Linux is named LXC (https://wiki.debian.org/LXC). I consider It to fit well here.

You will get dedicated system enviroment with transparently accessible filesystem and negligable performance penalty.

share|improve this answer

The simplest approach to start second mysql instance would be to use separate my.cnf with different data dir, port numbers etc

Than you just mount your snapshot under new data dir and start up mysql with a new my.cnf config file ie:

/usr/sbin/mysqld --defaults-file=/etc/my-blabla.cnf --basedir=/usr --datadir=/data/blabla --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --open-files-limit=1024 --pid-file=/data/blabla/mysql.blabla.pid --socket=/data/blabla/mysql.blabla.sock --port=3307

Something along these lines...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.