Create slave form XtraBackup

Hi All,

I’m just trying to get the procedure straight for creating a slave replica of my primary database.

I currently have a single Percona Server with XtraBackup running daily.

Should I be able to;

  1. Take my last full, create an incremental with it (or just use last nights copy)
  2. Prepare the backup
  3. copy across to the slave server
  4. Configure the db as a slave, start the db and stop the slave process
  5. Set
    MASTER_LOG_FILE = ‘xxxx’,
    MASTER_LOG_POS = xxxx;
  6. Start the slave process
  7. Check slave replication status

Does that seem sane ?

Anything I am missing or should be aware of ?

Is this documented anywhere that I can follow (a search did not return anything useful)

Thanks :slight_smile:


Hi, upex:how_to_recipes

There are a couple of examples where you can combine #1 and #3 from your procedures. After the backup, you can do the prepare from the slave.

I presume by #4 you mean to configure replication from the my.cnf file? I’d suggest doing this with CHANGE MASTER TO from the mysql console to prevent conflicts/confusion with the configuration.

In short you will be doing:

  1. Backup and copy to remote (see recipes above)
  2. Prepare the backup (see recipes)
  3. Start MySQL on slave
  4. Configure replication on slave with CHANGE MASTER TO
  5. Start slave
  6. Monitor replication

Great, thanks :slight_smile:

Worked fine, with this procedure, slave replication came straight up from last nights backup and all looking good.