V
V
VMCLOUD2014-08-27 13:01:06
MySQL
VMCLOUD, 2014-08-27 13:01:06

Transferring MySQL from InnoDB to another server without a long shutdown?

Actually a subject. There is a base, about 200Gb.
You need to drag it from server to server without long stops. There is a variant with rsync with a working source database, after rsync stops the source database and then catches up with the difference again with the same rsync.
Something like rsync -az [email protected]:/var/lib/mysql/ /var/lib/mysql/
Does this method have the right to life, or are there pitfalls?! With postgres, this goes with a bang!
Or maybe it's easier to raise the last lady on the recipient server, and set up master master replication with the source server and then stupidly switch frontends after full data consistency?!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Melkij, 2014-08-27
@melkij

Since a small stop of the service is acceptable (about a couple of minutes), then no master-master!
0) Raise the master-slave replica (the existing server is the master, the new one is the slave)
1) when the slave caught up with the master, stop the service (if the site - hang up the "log in in a couple of minutes" stub)
2) disassemble the replica
3) edit the service configs so that it addressed to the new server
4) turn on the service.
A couple of years ago, at work with our system administrator, this is how they migrated. No problems on the first try and a simple couple of minutes in total.

S
Sergey Petrikov, 2014-08-27
@RicoX

Both options work, rsync is just faster.

K
Konstantin Samilko, 2015-05-28
@kuroneco

Take a binary dump using innobackupex from the master.
Run it on your other server as a slave.
Push the slave into read only through a global variable.
When the slave catches up with the master, switch to the slave (it will not break, since nothing will be written).
Turn off replication, turn off read only.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question