On Mon, May 13, 2013 at 12:08 PM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
I have a hunch that what you are really asking is how to take a backup of the master server and restore this on a new server to provision a new slave?
That's right, I'm thinking about taking backup and restoring.
My intention for this was to use the existing facilities for such backup/restore, like mysqldump and XtraDB.
I didn't check with the 10.0.2, but in 10.0.0 XtraDB didn't compile. Does it compile now?
If you take a mysqldump or XtraDB backup of the master, there are facilities to get the current binlog position (filename/offset) in a non-blocking way. You can then convert that into a GTID position with BINLOG_GTID_POS(filename, offset). Finally, on the new slave, you SET GLOBAL gtid_pos to the correct value. This is how I planned slave provisioning to work.
You should not think of somehow copying around <log-bin>.state on its own without the binlog files, this will not work. Of course, a full consistent filesystem copy of everything (datadir and binlogs), like tar file of a stopped server or LVM snapshot or whatever, is ok.
We are taking backup by the full consistent filesystem copy of datadir. Copying binlogs seem to be overkill because they can be huge and the only info that matters in there is information to restore gtid_pos. Somehow I thought that additional copying or <log-bin>.state will be enough for MariaDB to restore that state. If it's not then I guess we'll just need to extract the gtid_pos while taking backup and then force-set it during the restore. This should work, right? Thanks, Pavel