MySQL Server Version:
Server version: 5.7.10-log MySQL Community Server (GPL)
Percona xtrabackup Version:
Innobackupex version 2.4.2 Linux (x86_64) (revision id:8e86a84)
Description
[Master]: Represents a statement executed on the master library [slave]: Represents a statement executed on the slave library
--Perform a master library full-ready
[Master]innobackupex--parallel=4/data/backup/full--no-timestamp
--Attach the log to the backup [Master]innobackupex--apply-log--parallel=4/data/backup/full--no-timestamp
--Create the replication user [master]create user ' repl ' @ ' 172.25.21.% ' identified by ' repl ';
--Grant Copy user replication permissions [master]grant replication Slave on * * to ' repl ' @ ' 172.25.21.% ';
--Compress the backed up data [Master]tar-cvzf full.tar.gz full/
--Transfer data to Slave library [master]scp full.tar.gz [Email protected]:/data/backup/
--Unzip the backup data transferred from the main library.
[Slave]tar xzvf/data/backup/full.tar.gz
--Test whether users created with the main library can connect to the main library [SLAVE]MYSQL-H172.25.21.11-UREPL-PREPL
--View information for binary log in backup data [Slave]cat/data/backup/full/xtrabackup_binlog_info mysql-bin.000002 66379412
--Perform a backup restore operation [Slave]innobackupex--copy-back/data/backup/full
--Modify the permissions of the recovered data file directory [Slave]chown-r mysql:mysql/data/mysql_data1
--Start slave library [Slave]service mysqld start
--Log into the slave library and execute the following statement to turn on synchronization
Change Master to
Master_host= ' 172.25.21.11 ',
Master_user= ' Repl ',
Master_password= ' Repl ',
master_port=3306,
Master_log_file= ' mysql-bin.000002 ',
master_log_pos=66379412;
Start slave;
show slave status\g;
Create a MySQL slave library using Percona xtrabackup