How to Create a New (or Repair a Broken) GTID-Based Slave with Percona XtraBackup

May 9, 2013
Author
Miguel Angel Nieto
Share this Post:

Percona XtraBackup 2.0.7 has been published with support for GTID based replication. As promised, here is the step-by-step guide on how to create a new GTID based slave (or repair a broken one) using XtraBackup. The process is pretty straightforward.

1- Take a backup from any server on the replication environment, master or slave:

In the destination folder there will be a file with the name xtrabackup_binlog_info:

Now it contains both, binary log coordinates and GTID information.

That information is also printed by innobackupex after backup is taken:

2- Apply the logs to the backup:

3- Move the backup to the destination server and put the content on the mysql’s datadir. Follow the usual restore procedure, for example remember to change the permissions to mysql:mysql.

4- Start the new slave from that GTID position:

In case your source has applied event from different servers, your GTID executed will be compounded by a list of gtid sets separated by comma: [SOURCE_ID1]:[ID1],[SOURCE_ID2]:[ID2] . In this case you need to specify all of them on the above step.

5- Check the replication status:

We can see that the slave has retrieved a new transaction with number 5, so transactions from 1 to 5 are already on this slave.

That’s all, we have created a new slave in our GTID based replication environment.

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved