web-dev-qa-db-ja.com

Perconaのxtrabackup --apply-logが「すべてのログファイルを同時に作成する必要がある」で失敗する

Xtrabackupファイルへのログの適用が機能しない理由を理解しようとしています。
VMを作成しました。次に、sakilaテストデータベースを作成し、次のコマンドでバックアップしました:

innobackupex --user=bckuser --password=XXXX --no-timestamp --compress /var/lib/mysql/dumps/backup/;

これは正常に完了しました。その後、私はこのコマンドでログを適用したいと思いました:

innobackupex --user=bckuser --password=XXXX --apply-log /var/lib/mysql/dumps/backup/;  

しかし、私は次のエラーを受け取ります:

140912 21:46:19  innobackupex: Starting ibbackup with command: xtrabackup_55  --defaults-file="/var/lib/mysql/dumps/backup/backup-my.cnf"  --defaults-group="mysqld" --prepare --target-dir=/var/lib/mysql/dumps/backup --tmpdir=/tmp

xtrabackup_55 version 2.1.9 for Percona Server 5.5.35 Linux (x86_64) (revision id: 746)
xtrabackup: cd to /var/lib/mysql/dumps/backup
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(8564748)
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
140912 21:46:19 InnoDB: The InnoDB memory heap is disabled
140912 21:46:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140912 21:46:19 InnoDB: Compressed tables use zlib 1.2.3
140912 21:46:19 InnoDB: Initializing buffer pool, size = 100.0M
140912 21:46:19 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
140912 21:46:19  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
140912 21:46:20 InnoDB: Error: all log files must be created at the same time.
140912 21:46:20 InnoDB: All log files must be created also in database creation.
140912 21:46:20 InnoDB: If you want bigger or smaller log files, shut down the
140912 21:46:20 InnoDB: database and make sure there were no errors in shutdown.
140912 21:46:20 InnoDB: Then delete the existing log files. Edit the .cnf file
140912 21:46:20 InnoDB: and start the database again.
xtrabackup: innodb_init(): Error occured.
innobackupex: Error:
innobackupex: ibbackup failed at /usr/bin/innobackupex line 2560.

私はたくさんグーグルしましたが、何が悪いのか分かりません。皆さんは何か考えがありますか?

2
user68293

エラーの少し上のログを確認します。

InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!

それらが見つからないため、新しいinnodbファイルを作成しようとしています。

ログを適用する前にファイルを解凍する必要があります

innobackupex --decompress /...

次に、ログを適用します。

ところで、最初のバックアッププロセスが完了したら、ユーザーとパスワードを指定する必要はありません。

2
jynus