Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

M|18 PolarDB: A Shared-storage Solution for InnoDB

160 views

Published on

M|18 PolarDB: A Shared-storage Solution for InnoDB

Published in: Data & Analytics
  • Be the first to comment

M|18 PolarDB: A Shared-storage Solution for InnoDB

  1. 1. Planning for disaster recovery, online and offline Monday, February 26 Operations 4:00 pm - 4:50 pm Jens Bollmann, Instructor/Consultant
  2. 2. ● Consulting worldwide – Performance Tuning – High Availability – Architecture – Security ● Instructor – All MariaDB curriculum – Certification preparation
  3. 3. ● Restore needed ● Do we need backup YES ● Redundancy in our system ensures security UNF NOT – Human error – Murphy's laws
  4. 4. ● Backup – Cold, Warm, Hot ● Test Backup – Restore is verified ● Time → SLA – Tracking possible – Location / redundant
  5. 5. Cold Backup Shutdown server Copy – tarball – snapshot (LVM, SAN) ● Pros – Fast – Binary – Exact copy ● Cons – Downtime sh> rsync datadir backupserver:backupdir sh> tar czf datadir.tgz backupdir sh> lvsnapshot dataLVM
  6. 6. Warm backup Server allows reads 1. mysqldump 2. mydumper # seek on github ● Pros – Fast – All storage engines – Textual → portable ● Cons – Slow – More diskspace – FLUSH TABLES sh> mysqldump -A -F -–master-data=2 > backupdir sh> mydumper -t 8 …
  7. 7. Hot Hot copy of datadir Prepare backup / run crash recovery Formerly xtrabackup ● Pros – Fast – Binary log sync → PITR – Exact copy ● Cons – Not portable sh> mariabackup –-backup -–targetdir=backupdir --user=buser --password=bpwd sh> # stable from MariaDB 10.2.10+, MariaDB 10.1.26+ sh> mariabackup –-prepare -–targetdir=backupdir --user=buser –password=bpwd sh> cd <datadir> ; rm -fr * sh> mariabackup --copy-back -–targetdir=backupdir --user=buser –password=bpwd sh> chown -R mysql:mysql <datadir> sh> sudo yum install MariaDB-backup
  8. 8. Ensure binary logging is enabled Enable Binlog Sync Backup with Binlog Have a Copy of your Binlogs in a Secure Place [mysqld] log-bin=binlog binlog-annotate-row-events binlog-format=ROW expire-logs-days=14 # two weeks !BackupPolicy my.cnf /etc/my.cnf.d/server.cnf b0 binlog.000001 binlog.000003binlog.000002 DROP DATABASE world Backup synced with binlog --stop-position=n --start-position=n+1
  9. 9. Advanced backup strategies Replication based backup Cluster based backup Cloud based backup
  10. 10. Replication based backup No load on Master Additional investment mariadb> stop slave; # perform backup (cold,warm or hot) – mark down position or copy master.info # and binlog files mariadb> start slave;
  11. 11. Cluster based backup No impact on cluster performance Isolate one node for backup from application layer access e.g. using MaxScale RWSPLIT- service maxadmin> set server galera2 maintenance # perform backup maxadmin> clear server galera2 maintenance
  12. 12. Cloud based backup Data location ? 2 geo locations recommended Data ownership Some legal issues Evaluate costs
  13. 13. Live demo of Backup 1 mysqldump
  14. 14. Live demo of Backup 2 Restore from dump
  15. 15. Live demo of Backup 3 mariabackup
  16. 16. Live demo of Backup 4 mariabackup with Enterprise cluster
  17. 17. Live demo of Backup 5 Recovery of mariabackup with Enterprise cluster
  18. 18. Thank you! https://mariadb.com/ jens@mariadb.com ● Mail me ● Get certified

×