Hi:
I tried to use Xtrabackup, compress, and streaming. But when I Unpack the backup stream, I got an error message. “xb_stream_read_chunk(): wrong chunk magic at offset 0x0”. It seem like the stream file has some problem.
My machine is Ubuntu 16.04 LTS, Both docker version and installed-in-host version of Xtrabackup 2.4 have the same problem.
$sudo docker run --rm --network dev_rf-quote-net -it -v /home/robin/aurora/rf-quote/docker/dev/db_data:/var/lib/mysql
-v /home/steve/rf-quote-db-backup-comp:/xtrabackup_backupfiles perconalab/percona-xtrabackup
–backup --host=172.12.0.3 --user=root --password=xxx --compress --stream=xbstream
I got a compressed file backup.xbstream. the file size is about 5MB.
then I $vi backup.xbstream
encryption: using gcrypt 1.6.3
200310 08:41:00 version_check Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_group=xtrabackup;host=172.12.0.3;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock’ as ‘root’ (using password: YES).
200310 08:41:00 version_check Connected to MySQL server
200310 08:41:00 version_check Executing a version check against the server…
200310 08:41:00 version_check Done.
200310 08:41:00 Connecting to MySQL server host: 172.12.0.3, user: root, password: set, port: 3306, socket: /var/run/mysqld/mysqld.sock
Using server version 5.7.27
xtrabackup version 2.4.11 based on MySQL server 5.7.19 Linux (x86_64) (revision id: b4e0db5)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /var/lib/mysql
xtrabackup: open files limit requested 0, set to 1048576
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
InnoDB: Number of pools: 1
200310 08:41:00 >> log scanned up to (1980823392)
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID 21 for sys/sys_config, old maximum was 0
200310 08:41:01 [01] Compressing and streaming ./ibdata1
200310 08:41:01 [01] …done
…
// the following is binary.
$xbstream -x < backup.xbstream
The Error Message shows up: “xb_stream_read_chunk(): wrong chunk magic at offset 0x0.”
It seem like the output message is also streamed into the file. Could it be the reason to fail? I don’t know. I don’t know how to fix this issue.
Could anyone help me to fix it?
Thank you in advance.
Steve