Mysql

Percona:備份準備不起作用(“無法打開 ./xtrabackup_logfile”)

  • July 20, 2016

我通過(感謝本指南)使用 PerconaXtrabackup 工具創建了 MySQL 備份:

innobackupex --user=backupmysqluser --password=xyz --compress --stream=xbstream ./ > /var/backups/db/firstBackup.db

它成功創建了熱備份。現在我想測試它的恢復,所以,首先,我解壓它:

cd /var/backups/db
mkdir decompressed
xbstream -x -C decompressed

現在我試著準備它:

innobackupex --apply-log /var/backups/db/decompressed/

結果是這個錯誤:

160719 20:06:28 innobackupex: Starting the apply-log operation

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

innobackupex version 2.4.3 based on MySQL server 5.7.11 Linux (x86_64) (revision id: 6a46905)
xtrabackup: cd to /var/backups/db/decompressed
xtrabackup: This target seems to be not prepared yet.
InnoDB: Number of pools: 1
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 ./xtrabackup_logfile. will try to find.
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 ./xtrabackup_logfile.
xtrabackup: Error: xtrabackup_init_temp_log() failed.

這很奇怪,因為decompressed文件夾中沒有 xtrabackup_logfile,但有一個名為的文件xtrabackup_logfile.qp

我做錯了什麼?

如果 Xtrabackup 文件仍有.qp副檔名,則您尚未解壓縮它們。

嘗試在目前文件夾中使用它:

sudo innobackeupex --decompress --parallel=4

where4代表您要使用的執行緒數。

另外,為了事後清理:

sudo find ${DEST_DIR}/ -name "*.qp" -delete

引用自:https://dba.stackexchange.com/questions/144309