Top Banner
MySQL Enterprise Backup Percona Xtrabackup Mariabackup Juan Pablo Arruti, Iwo Panowicz Percona
35

Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

Jun 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

MySQL Enterprise BackupPercona Xtrabackup

MariabackupJuan Pablo Arruti, Iwo Panowicz

Percona

Page 2: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

2

Backups● There are two types of people, those who take backups

and those who will be taking them in the future● Database backups:

○ Logical backups■ mysqldump, mysqlpump, mydumper

○ Physical backups■ MEB, Percona Xtrabackup, Mariabackup

○ Binlogs■ point-in-time recovery

Page 3: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

3

Backups● At Percona, we recommend customers use all three

ways of taking a backup of their database● Schrödinger’s restore:

○ The condition of any backup is unknown until restore is attempted

○ You never known before trying● Always test backups:

○ pt-table-checksum

Page 4: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

4

Backups● There are two types of people, those who take backups

and those who will be taking them in the future● Database backups:

○ Logical backups■ mysqldump, mysqlpump, mydumper

○ Physical backups■ MEB, Percona Xtrabackup, Mariabackup

○ Binlogs■ point-in-time recovery

Page 5: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

5

Percona Xtrabackup● The Percona XtraBackup tool provides a method of

performing a hot backup of your MySQL data while the system is running

● Percona XtraBackup allows you to backup your database while in production, without impacting uptime or data changes

Page 6: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

6

Percona Xtrabackup● Opensource● Supports InnoDB and MyRocks● Blocking support for MyISAM● Full & incremental backups● Partial backups● Compression● Encryption● Streaming

Page 7: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

7

Percona Xtrabackup● Backup stage:

○ PXB backups IBD files while in use○ PXB tracks changes through redo logs

● Prepare stage:○ PXB applies changes from redo logs onto ibd files

● Restore stage:○ After the prepare stage is done, the backup

directory is the new data directory

Page 8: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

8

● XBStream○ To support simultaneous compression and

streaming, a new custom streaming format called xbstream was introduced to Percona XtraBackup in addition to the TAR format

$ xtrabackup --backup --stream=xbstream \ --compress --compress-threads=8 --parallel=8 \ 2>backup.log | ssh newInstance "cat - > file.xbs"

Percona Xtrabackup

Page 9: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

9

Percona Xtrabackup● XBCloud

○ The purpose of xbcloud is to download and upload full or part of xbstream archive from/to cloud

○ xbcloud accepts input via a pipe from xbstream so that it can be invoked as a pipeline with xtrabackup to stream directly to the cloud without needing a local storage

Page 10: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

10

Percona Xtrabackup● XBCloud

○ In addition to Swift, which has been the only option for storing backups in a cloud storage until PXB 2.4.14, xbcloud supports

○ Amazon S3○ MinIO○ Google Cloud Storage○ Any other S3 compatible storages, such as Wasabi

or Digital Ocean Spaces

Page 11: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

11

● XBCloud

$ xtrabackup --backup --stream=xbstream | \xbcloud put \ --storage=s3 \--s3-endpoint='s3-us-west-2.amazonaws.com' \--s3-bucket='mysqlbucketprod' \--parallel=10 \$(date +"%Y%m%d%H%M%S")-full_backup

Percona Xtrabackup

Page 12: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

12

Restore Amazon RDS from Xtrabackup● Overview

○ Take backup from database○ Upload into S3 bucket○ Create new instance from the backup

■ Amazon MySQL RDS■ Amazon Aurora MySQL

Page 13: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

13

Restore Amazon RDS from Xtrabackup● Limitations

○ Supported MySQL 5.6 and 5.7○ Source/Target major versions must match

■ Target minor version must be higher○ Source tables defined within default datadir○ 6 TB database size limit○ Source database can't be encrypted○ User accounts, functions, stored procedures and

time zone info are not imported automatically

Page 14: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

14

Mariabackup● MariaDB is not just a fork of MySQL

○ It continues to diverge much● Percona Xtrabackup became incompatible with

MariaDB features like:○ InnoDB Page Compression○ MariaDB’s implementation of Data-At-Rest

encryption

Page 15: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

15

Mariabackup● Mariabackup should be used with MariaDB● The syntax is the same as PXB, except for

innobackupex○ --innobackupex is available though

Page 16: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

16

MariaDB and Percona Xtrabackup● MariaDB 10.1

○ If instance is using InnoDB Page Compression■ PXB will not work

○ If instance is using Data-at-Rest encryption■ PXB will not work

○ When innodb_page_size is changed from the default value (16KB)■ PXB will not work

Page 17: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

17

MariaDB and Percona Xtrabackup● MariaDB 10.2

○ Same as MariaDB 10.1○ You can hit issues due to the MySQL 5.7 undo log

format incompatibility bug that was fixed in MariaDB 10.2.2■ Backups prepared with XtraBackup may fail to

recover some transactions

Page 18: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

18

MariaDB and Percona Xtrabackup● MariaDB 10.3+

○ PXB is not working

Page 19: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

19

Mariabackup● Mariabackup was originally forked and extended from

PXB 2.3.8 version● It supports feature that PXB was missing for MariaDB● It is also used in Mariadb’s Galera cluster SST● Can be used on Microsoft Windows

Page 20: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

20

Mariabackup● It however lacks of some PXB features:

○ When doing the backup of InnoDB tables, it’s possible to omit the secondary index pages. This will make the backups more compact and this way they will take less space on disk.■ --compact and --rebuild_indexes are

not available in Mariabackup

Page 21: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

21

Mariabackup● It however lacks of some PXB features:

○ Percona XtraBackup has implemented support for encrypted backups. It can be used to encrypt/decrypt local or streaming backup with xbstream option in order to add another layer of protection to the backups.■ --encrypt is not available in Mariabackup

Page 22: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

22

Mariabackupmariabackup --user=root --backup \ --stream=xbstream | openssl \ enc -aes-256-cbc -k mypass

Page 23: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

23

Mariabackup● It however lacks of some PXB features:

○ Support for --stream=tar was removed from Mariabackup in MariaDB 10.1.24

○ xbstream is available, the name was changed to mbstream

○ However, to select this output format when creating a backup, Mariabackup's --stream option still expects the xbstream value

Page 24: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

24

Mariabackup● It however lacks of some PXB features:

○ Percona XtraBackup implemented support for lock-less binary log information in 2.3.2. If possible on the server, PXB can avoid executing LOCK BINLOG FOR BACKUP.

○ Mariabackup does not support lockless binlog

Page 25: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

25

MySQL Enterprise Backup● Overview

○ Online Backup for MySQL Databases○ Replacement of innobackup○ High Performance○ Multi-Platform (Unix, Linux, Windows)○ Licensed software (MySQL Enterprise Edition)○ Cloud Storage Support○ LZ4 compression algorithm

Page 26: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

26

MEB and XtraBackup● Available features in MEB not present in XtraBackup

○ Reports backup progress■ --show-progress

...RPR1 INFO: Progress: 0 of 641 MB; state: Copying system tablespace; compression: -RPR1 INFO: Progress: 183 of 641 MB; state: Copying .ibd files; compression: 95%RPR1 INFO: Progress: 439 of 641 MB; state: Copying .ibd files; compression: 60%RPR1 INFO: Progress: 671 of 671 MB; state: Copying binlogs; compression: 69%...

Page 27: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

27

MEB and XtraBackup● Available features in MEB not present in XtraBackup

○ Performs Offline backups■ --no-connection

Page 28: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

28

MEB and XtraBackup● Available features in MEB not present in XtraBackup

○ Backup to Tape with Oracle Secure Backup■ Single file backup --backup-image=sbt:name■ --sbt-database-name=storage_selector■ --sbt-lib-path=/path/to/libobk.so

Page 29: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

29

MEB and XtraBackup● Available features in MEB not present in XtraBackup

○ Binary and Relay log files backups■ Enabled by default■ Allows Point in Time Recovery■ Limited Auditing■ Avoids pulling again replication events■ --skip-binlog --skip-relaylog

Page 30: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

30

MEB and XtraBackup● Available features in MEB not present in XtraBackup

○ Rename table at restore■ --rename="OLD-NAME to NEW-NAME"■ Transportable Tablespace Backup --use-tts

● Used with Selective Backups

Page 31: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

31

MEB and XtraBackup● Available features in XtraBackup not present in MEB

○ Open Source○ Supports MariaDB, MySQL and Percona Server○ Parallel streaming backups○ Parallel compressed Backups○ Backup locks○ Create AWS RDS instances from backups

Page 32: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

32

MEB and XtraBackup● Available features in XtraBackup not present in MEB

○ Buffer pool state backups○ Individual partitions export○ Data & index file statistics○ InnoDB secondary indexes defragmentation○ rsync support to minimize lock time○ Improved FTWRL handling

Page 33: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

33

Rate My Session

Page 34: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

Questions

Page 35: Percona Xtrabackup Mariabackup MySQL Enterprise Backup › live › 19 › sites › default › files... · MySQL Enterprise Backup Overview Online Backup for MySQL Databases Replacement

Thank you!