GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Innobackupex incremental backup not work

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Innobackupex incremental backup not work

    Hi
    I have a problem on restoring myincremental backup.

    I did Following:
    First, I make full backup in day one:
    innobackupex -user=root -password=123 --no-timestamp mysqlbackup/incremental/base
    innobackupex -user=root -password=123 --apply-log --redo-only mysqlbackup/incremental/base

    then after some changes in day two I make a incremental in day two:
    innobackupex -user=root -password=123 --no-timestamp --incremental mysqlbackup/incremental/inc01 --incremental-basedir=mysqlbackup/incremental/base
    innobackupex -user=root -password=123 --apply-log mysqlbackup/incremental/base --incremental-basedir=mysqlbackup/incremental/inc01
    innobackupex --apply-log mysqlbackup/incremental/base

    And, restored it in day 3:
    /etc/init.d/mysqld stop
    mv /var/lib/mysql/ /var/lib/mysql-old
    innobackupex -user=root -password=123 --copy-back mysqlbackup/incremental/base
    chown -R mysql:mysql /var/lib/mysql/
    /etc/init.d/mysqld start

    But i were wondered when I see, the changes of day two (incremental backup) not applied to backup.
    Does anyone know what the problem is?
    Thanks in advance
    morteza.



    Software and versions
    CentOS 6.2
    Mysql 5.1
    xtrabackup : last version from percona repository ,last weak

  • #2
    Hi Morteza,

    I have tested locally and it works fine for me. There is only one change in steps. While applying incremental backup to the base backup, you are using this.

    innobackupex -user=root -password=123 --apply-log mysqlbackup/incremental/base --incremental-basedir=mysqlbackup/incremental/inc01

    and I'm using this.

    innobackupex -user=root -password=123 --apply-log --redo-only mysqlbackup/incremental/base --incremental-dir=mysqlbackup/incremental/inc01

    Reference: http://www.percona.com/doc/percona-xtrabackup/howtos/recipes _ibkx_inc.html

    Can you try again with above step and check? thanks.

    Comment


    • #3
      Hi niljoshi and thanks for replying.

      i applied new changes, but when i run:
      innobackupex -user=root -password=123 --apply-log --redo-only mysqlbackup/incremental/base --incremental-dir=mysqlbackup/incremental/inc01
      it error!!
      ------------------------------------------------------------ ----
      the error content is:
      InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
      and Percona Inc 2009-2012. All Rights Reserved.

      This software is published under
      the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

      IMPORTANT: Please check that the apply-log run completes successfully.
      At the end of a successful apply-log run innobackupex
      prints "completed OK!".



      120920 13:22:46 innobackupex: Starting ibbackup with command: xtrabackup_55 --defaults-file="/root/mysqlbackup/incremental/base/backup-my.cnf " --defaults-group="mysqld" --prepare --target-dir=/root/mysqlbackup/incremental/base --apply-log-only --incremental-dir=mysqlbackup/incremental/inc01

      xtrabackup_55 version 2.0.2 for Percona Server 5.5.16 Linux (x86_64) (revision id: 461)
      incremental backup from 2725276 is enabled.
      xtrabackup: cd to /root/mysqlbackup/incremental/base
      xtrabackup: This target seems to be already prepared.
      120920 13:22:46 InnoDB: Operating system error number 2 in a file operation.
      InnoDB: The error means the system cannot find the path specified.
      xtrabackup: Warning: cannot open mysqlbackup/incremental/inc01/xtrabackup_logfile. will try to find.
      120920 13:22:46 InnoDB: Operating system error number 2 in a file operation.
      InnoDB: The error means the system cannot find the path specified.
      xtrabackup: Fatal error: cannot find mysqlbackup/incremental/inc01/xtrabackup_logfile.
      xtrabackup: Error: xtrabackup_init_temp_log() failed.
      innobackupex: Error:
      innobackupex: ibbackup failed at /usr/bin/innobackupex line 374.


      ------------------------------------------------------------ ----
      ------------------------------------------------------------ ----
      the directory of mysqlbackup/incremental/inc01 contains below files:
      mysql [dir]
      mydb [dir]
      backup-my.cnf
      ibdata1.delta
      ibdata1.meta
      xtrabackup_binary
      xtrabackup_binlog_info
      xtrabackup_checkpoints
      xtrabackup_logfile


      thanks.
      morteza

      Comment


      • #4
        Hi Morteza,

        xtrabackup: Fatal error: cannot find mysqlbackup/incremental/inc01/xtrabackup_logfile.

        As per the above error, your incremental backup is not done properly and thats why innobackupex can't able to get xtrabackup_logfile. Can you check inc1 folder (mysqlbackup/incremental/inc01)?

        There must be files like below.


        shell:~/backup_test/incremental/inc1$ lltotal 2560drwxr-xr-x 6 root root 4096 Sep 18 11:26 ./drwxrwxr-x 4 nilnandan nilnandan 4096 Sep 18 11:15 ../-rw-r--r-- 1 root root 260 Sep 18 11:15 backup-my.cnf-rw-r----- 1 root root 409600 Sep 18 11:15 ibdata1.delta-rw-r----- 1 root root 31 Sep 18 11:15 ibdata1.metadrwxr-xr-x 2 root root 16384 Sep 18 11:16 mysql/drwx------ 2 root root 4096 Sep 18 11:16 nil/drwx------ 2 root root 4096 Sep 18 11:16 nil_test/drwxr-xr-x 2 root root 4096 Sep 18 11:16 performance_schema/-rw-r--r-- 1 root root 13 Sep 18 11:16 xtrabackup_binary-rw-r--r-- 1 root root 4 Sep 18 11:16 xtrabackup_binlog_info-rw-r----- 1 root root 84 Sep 18 11:16 xtrabackup_checkpoints-rw-r----- 1 root root 2097152 Sep 18 11:22 xtrabackup_logfileshell:~/backup_test/incremental/inc1$

        Comment


        • #5
          Hi

          there is xtrabackup_logfile in (mysqlbackup/incremental/inc01) !!!!!!!!


          total 116-rw-r--r-- 1 root root 260 Sep 20 13:17 backup-my.cnfdrwxr-xr-x 2 root root 4096 Sep 20 13:17 mydb-rw-r----- 1 root root 81920 Sep 20 13:17 ibdata1.delta-rw-r----- 1 root root 31 Sep 20 13:17 ibdata1.metadrwxr-xr-x 2 root root 4096 Sep 20 13:17 mysqldrwxr-xr-x 2 root root 4096 Sep 20 13:17 test-rw-r--r-- 1 root root 13 Sep 20 13:17 xtrabackup_binary-rw-r--r-- 1 root root 24 Sep 20 13:17 xtrabackup_binlog_info-rw-r----- 1 root root 81 Sep 20 13:17 xtrabackup_checkpoints-rw-r----- 1 root root 2560 Sep 20 13:17 xtrabackup_logfile

          Comment


          • #6
            Hi,

            I guess, now only this remaining is to check path and give full path of dir to innobackex utility.
            As per given error log, innobackupex is going to check below path.

            xtrabackup: cd to /root/mysqlbackup/incremental/base

            Is it right path of mysqlbackup dir? Can you again try to run innobackupex with full path?


            xtrabackup: cd to /root/mysqlbackup/incremental/base

            Comment


            • #7
              Hi and thanks a lot
              I changed all path to full path and It Worked finely

              I have another question:
              Assume, i get 3 incrementals backup (inc01,inc02, inc03).
              Do I can remove this folders before restoration?

              Best Regards
              Morteza

              Comment


              • #8
                Hi Morteza,

                If you have applied those changes in base dir then yes you can remove it otherwise by removing those inc folders, you will get inconsistent backup as you'll not have incremental changes for apply on base dir.

                Comment


                • #9
                  Thanks a lot

                  Comment


                  • #10
                    Hi irmorteza,

                    I just share shell script incremental backup shell script.

                    script name: percona_incremental.sh


                    pls upload to your home dir and change variable "DIR_BACKUP"

                    chmod +x /home/percona_incremental.sh

                    sh /home/percona_incremental.sh backup

                    and for restore

                    sh sh /home/percona_incremental.sh restore

                    I hope this script usefull for You.

                    Thank You

                    Comment


                    • #11
                      Hi gozigomilis and thank you for sharing shell.

                      It's PERFECT and very easy to use.

                      Best.
                      Morteza

                      Comment

                      Working...
                      X