我正在尝试使用mariabackup使用以下命令将远程mariadb实例(负载下的生产数据库)流式备份到本地计算机:
ssh root@dbserver 'mariabackup --defaults-file=/etc/my.cnf \
--socket=/db/mysql/mysql.sock --user=root --backup --parallel=4 \
--stream=xbstream --tmpdir=/tmp/mysql-backup-tmp' | mbstream -x
但是,在此过程中,出现以下错误消息:
180722 03:17:35 >> log scanned up to (178256886852267)
180722 03:17:36 >> log scanned up to (178256886852796)
180722 03:17:37 >> log scanned up to (178256886857155)
mariabackup: garbage block: 178256886865408,12
180722 03:17:38 >> log scanned up to (178256886865408)
180722 03:17:39 >> log scanned up to (178256886869872)
180722 03:17:40 >> log scanned up to (178256886893932)
此“垃圾块”错误是影响数据完整性的关键问题,还是可以安全地忽略它?
在备份约350GB大小的数据库时,我注意到其中约有5个错误在滚动。
令人鼓舞的是,该过程以“完成确定!”结束讯息:
180722 04:28:01 Finished backing up non-InnoDB tables and files
180722 04:28:01 [01] Streaming aria_log.00000001 to <STDOUT>
180722 04:28:01 [01] ...done
180722 04:28:01 [01] Streaming aria_log_control to <STDOUT>
180722 04:28:01 [01] ...done
180722 04:28:01 [00] Streaming xtrabackup_binlog_info
180722 04:28:01 [00] ...done
180722 04:28:01 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
mariabackup: The latest check point (for incremental): '178257265448382'
180722 04:28:01 >> log scanned up to (178257268268307)
mariabackup: Stopping log copying thread
180722 04:28:01 >> log scanned up to (178257268268307)
180722 04:28:01 Executing UNLOCK TABLES
180722 04:28:01 All tables unlocked
180722 04:28:01 [00] Streaming ib_buffer_pool to <STDOUT>
180722 04:28:01 [00] ...done
180722 04:28:01 Backup created in directory '/root/xtrabackup_backupfiles/'
MySQL binlog position: filename 'mysql-bin.006908', position '871204716', GTID of the last change '0-10-334787449'
180722 04:28:01 [00] Streaming backup-my.cnf
180722 04:28:01 [00] ...done
180722 04:28:01 [00] Streaming xtrabackup_info
180722 04:28:01 [00] ...done
mariabackup: Redo log (from LSN 178256909716559 to 178257268268307) was copied.
180722 04:28:01 completed OK!
我在Centos 7(MariaDB服务器10.3.8-MariaDB Linux(x86_64))上使用了最新的mariadb 10.3.8和mariabackup 10.3.8软件包