Take a streaming backup¶
Percona XtraBackup supports streaming mode. Streaming mode sends a backup to
STDOUT in the xbstream format instead of copying the files to the backup directory.
This method allows you to use other programs to filter the output of the backup, providing greater flexibility for storage of the backup. For example, compression is achieved by piping the output to a compression utility. One of the benefits of streaming backups and using Unix pipes is that the backups can be automatically encrypted.
To use the streaming feature, you must use the
providing the format of the stream (
xbstream ) and where to store
the temporary files:
$ xtrabackup --stream=xbstream --target-dir=/tmp
xtrabackup uses xbstream to stream all of the data files to
STDOUT, in a
xbstream format. After it finishes streaming all of the data files
STDOUT, it stops xtrabackup and streams the saved log file too.
When compression is enabled, xtrabackup compresses the output data, except for the metadata, using the specified compression algorithm. Read about the supported compression algorithms in the Create a compressed backup document.
Using xbstream as a stream option, backups can be copied and compressed in parallel. This option can significantly improve the speed of the backup process. In case backups were both compressed and encrypted, they must be decrypted before they are uncompressed.
|Stream the backup into an archived named
|Stream the backup into a compressed archive named
|Encrypt the backup||
|Unpack the backup to the current directory||
|Send the backup compressed directly to another host and unpack it||
|Send the backup to another server using
||On the destination host:
On the source host:
|Send the backup to another server using a one-liner||
|Throttle the throughput to 10MB/sec using the pipe viewer tool||
|Checksum the backup during the streaming||On the destination host:
On the source host:
Compare the checksums on the source host:
Compare the checksums on the destination host:
|Parallel compression with parallel copying backup||
The streamed backup must be prepared before restoration. Streaming mode does not prepare the backup.