Backup streaming with Mariabackup

Recently one of my friend had the requirement to configure the slave with MariaDB 10.4 . He planned to stream the backup from the standalone master to slave node and configure the replication . He was familiar with the Percona Xtrabackup and this is the first time he is working on the Mariabackup streaming .

While scheduling the streaming Mariabackup he was experienced with the below error .

Error Logs :

02] 2019-11-15 19:41:25 Streaming ./mysql/innodb_table_stats.ibd

[02] 2019-11-15 19:41:25         …done

[05] 2019-11-15 19:41:25 Streaming ./mysql/innodb_index_stats.ibd

[01] 2019-11-15 19:41:25 Streaming ./mysql/transaction_registry.ibd

[01] 2019-11-15 19:41:25         …done

[04] 2019-11-15 19:41:25 Streaming ./mysql/gtid_slave_pos.ibd

[04] 2019-11-15 19:41:25         …done

[06] 2019-11-15 19:41:25 Streaming ./jesus/g.ibd

[06] 2019-11-15 19:41:25         …done

[05] 2019-11-15 19:41:25         …done

bash: xbstream: command not found

mariabackup: Error writing file ‘UNKNOWN’ (Errcode: 32 “Broken pipe”)

[00] 2019-11-15 19:41:26 xb_stream_write_data() failed.

mariabackup: Error writing file ‘UNKNOWN’ (Errcode: 32 “Broken pipe”)

[03] 2019-11-15 19:41:26 mariabackup: xtrabackup_copy_datafile() failed.

[00] FATAL ERROR: 2019-11-15 19:41:26 failed to copy datafile.

Then he reached me about this issue . While going through the logs, I identified that the error says,

bash: xbstream: command not found

I suggested him to use the mbstream for extract the files from xbstream archive as Mariabackup is using the mbstream for extract the archive . The complete details has been provided in Mariabackup official website .

Then all works as expected . So the complete streaming Mariabackup command is ,

mariabackup –user=’stream’ –password=”Jesus@7sakthI” –parallel=6 –backup –stream=xbstream | ssh <remote_user@remote_host> “cat – | mbstream -x -C /mariaBackup”

Backup completion logs :

00] 2019-11-15 19:57:57 mariabackup: The latest check point (for incremental): ‘144398’

mariabackup: Stopping log copying thread.[00] 2019-11-15 19:57:57 >> log scanned up to (144407)

[00] 2019-11-15 19:57:57 >> log scanned up to (144407)

[00] 2019-11-15 19:57:57 Executing BACKUP STAGE END

[00] 2019-11-15 19:57:57 All tables unlocked

[00] 2019-11-15 19:57:57 Streaming ib_buffer_pool to <STDOUT>

[00] 2019-11-15 19:57:57         …done

[00] 2019-11-15 19:57:57 Backup created in directory ‘/mariaBackup/xtrabackup_backupfiles/’

[00] 2019-11-15 19:57:57 Streaming backup-my.cnf

[00] 2019-11-15 19:57:57         …done

[00] 2019-11-15 19:57:57 Streaming xtrabackup_info

[00] 2019-11-15 19:57:57         …done

[00] 2019-11-15 19:57:57 Redo log (from LSN 144398 to 144407) was copied.

[00] 2019-11-15 19:57:57 completed OK!

Why I am writing about this ?

During the analysis, I have searched about the Mariabackup streaming blogs . But, there is no such blog explaining the Mariabackup streaming with the exact command and details. So, I just wanted to write about this . Hope this helps someone, who is new for Mariabackup .

One thought on “Backup streaming with Mariabackup

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at WordPress.com
Get started
%d bloggers like this: