Not the answer you need?
Register and ask your own question!

i [Failed] How to setup a slave for replication ... please help

ibrahimibrahim EntrantCurrent User Role Beginner
Hello all

i have tried to go step by step following the Percona Backup 2.4 Documentation
"How to setup a slave for replication in 6 simple steps with Percona XtraBackup "

i have completed steps 1,2 and 3
(both the Master and the slave are having the same my.cnf (Slave server-id = 2), they are binary log enabled, and the slave can mysql to the master, and it has a full prepared backup)

once i go to step 4 and start mysqld on the Slave , i got
user@pc-1:~$ sudo service mysql start
 * Starting MariaDB database server mysqld                               [fail]

This is how my datadir looks like
user@pc-1:~$ ll /var/lib/mysql
total 1138896
drwxr-xr-x      6 mysql mysql              4096 Feb 15 02:59 ./
drwxr-xr-x     45 root  root           4096 Feb 15 00:48 ../
drwxrwxr-x      2 mysql mysql         90112 Feb 15 02:19 1bd3e0294da19198/
-rwxrwxr-x      1 mysql mysql         16384 Feb 15 02:59 aria_log.00000001*
-rwxrwxr-x      1 mysql mysql            52 Feb 15 02:59 aria_log_control*
-rwxrwxr-x      1 mysql mysql      79691776 Feb 15 02:59 ibdata1*
-rwxrwxr-x      1 mysql mysql     536870912 Feb 15 02:59 ib_logfile0*
-rwxrwxr-x      1 mysql mysql     536870912 Feb 15 02:18 ib_logfile1*
-rwxrwxr-x      1 mysql mysql      12582912 Feb 15 02:19 ibtmp1*
drwxrwxr-x      2 mysql mysql          4096 Feb 15 02:19 mysql/
-rw-rw----      1 mysql mysql           404 Feb 15 02:59 mysql-slow.log
drwxrwxr-x      2 mysql mysql          4096 Feb 15 02:19 performance_schema/
-rwxrwxr-x      1 mysql mysql            38 Feb 15 02:18 xtrabackup_binlog_pos_innodb*
-rwxrwxr-x      1 mysql mysql           558 Feb 15 02:19 xtrabackup_info*


I have faced similar issue when i followed " The Backup Cycle - Full Backups" https://www.percona.com/doc/percona-xtrabackup/LATEST/backup_scenarios/full_backup.html
, i was able to fix this by (manually ) copying the binary log file mysql-bin.00000x that the xtrabackup_binlog_pos_innodb points to, from the /tmp/mysql/ to /var/lib/mysql...
i found that xtrabackup doesn't copy the binary log itself... should i copy them too when i use replication... or i have missed something that makes the xtrabackup copies the binary log files automatically.

my extrabackup version is
user@pc-1:~$ xtrabackup --version
xtrabackup version 2.3.10 based on MySQL server 5.6.24 Linux (i686) (revision id: bd0d4403f36)


Please help !

Comments

  • Michael CoburnMichael Coburn Principal Architect, Percona Percona Staff Role
    Hi ibrahim ,

    You are running MariaDB? You should probably look at using MariaDB Backup instead of Percona XtraBackup: https://mariadb.com/kb/en/library/mariadb-backup-overview/

    Also neither of these two backup tools will copy binary logs for you. What you should do going forward:
    1. Install mariabackup
    2. Take a fresh backup from your MariaDB master
    3. restore this backup on your MariaDB slave
    4. configure replication using the binary log coordinates (there is no need to copy binary logs, replication will do this for you)
    Hope this helps!
  • ibrahimibrahim Entrant Current User Role Beginner
    Thank you Michael Coburn
    i will try to use MariaDB backup instead ...
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.