0

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.

2 Answers 2

1

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.

1

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...

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.