SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Backup - Mydumper
Vinoth Kanna RS
Remote DBA
2014-07-13
www.percona.com
Agenda
● Logical Backups
● Backups Locks
● Examples
● Tips
www.percona.com
Logical Backups
● Logical
● Plain text files
● Can be Remote
● Slower on large data-sets
● Sometimes the only option
www.percona.com
Logical Backups
● Tools
● mysqldump
● Mydumper
www.percona.com
Logical Backups
● mysqldump
● General use
● Simple to use
● By default lock tables
● One big output file
● Can be piped to mysql client
www.percona.com
Logical Backups
● mysqldump
● --opt = --add-drop-table --add-locks --create-options
--quick --extended-insert --lock-tables --set-charset
--disable-keys (default)
● --single-transaction (innodb)
● --master-data (FTWRL) for binlog coordinates
● --dump-slave
● --innodb-optimize-keys (PS only feature)
● --triggers (ON) --routines (OFF)
www.percona.com
Logical Backups
● Mydumper
● Faster logical backups as is multithread
● Almost no locking with innodb tables
● Compress on the fly
● Doesn't handle Views, Triggers and Procedures
● Separate files per table, one row per line
www.percona.com
Logical Backups
● Mydumper
● --threads
● --outputdir
● --rows, --chunk-filesize
● --compress
● --less-locking
● --kill-long-queries
● --use-savepoints
www.percona.com
Logical Backups
● Without chunks
Thread 1 Thread 2 Thread 3 Thread 4
0
10
20
30
40
50
60
Table D
Table C
Table B
Table A
Time
www.percona.com
Logical Backups
● With chunks (--rows)
Thread 1 Thread 2 Thread 3 Thread 4
0
5
10
15
20
25
Table D
Table C
Table B
Table A
Time
www.percona.com
Logical Backups
● Mydumper output files
● metadata
Started dump at: 2014-04-18 22:01:30
SHOW MASTER STATUS:
Log: mysql-bin.017436
Pos: 890402821
SHOW SLAVE STATUS:
Host: 192.168.56.101
Log: mysql-bin.017057
Pos: 968001054
Finished dump at: 2014-04-19 03:10:05
www.percona.com
Logical Backups
● Mydumper output files
● database.table.sql
/*!40101 SET NAMES binary*/;
/*!40014 SET FOREIGN_KEY_CHECKS=0*/;
/*!40103 SET TIME_ZONE='+00:00' */;
INSERT INTO `t1` VALUES
(1,"abc"),
(2,"def"),
(4,"abc"),
(5,"abc"),
(6,"abc"),
(7,"abc"),
(8,"abc");
Backup Locks
www.percona.com
Backup Locks
● LOCK TABLE ... READ LOCAL
● Other sessions can read the table but can't write
● LOCAL allows non conflicting INSERTs to MyISAM
● FLUSH TABLES WITH READ LOCK
● Global read lock
● Big issue on busy servers and long running selects
● Requires tables be reopened which can be another bottleneck on busy servers
● metadata locking since 5.5
● No DDLs to tables used in a transaction
www.percona.com
Backup Locks
● mysqldump
● --lock-tables (default)
– LOCK TABLES READ LOCAL
● --lock-all-tables --master-data and --dump-slave
– FLUSH TABLES WITH READ LOCK
● --single-transaction (innodb only)
– START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT
*/
● --skip-lock-tables
– No locks
www.percona.com
Backup Locks
● Mydumper
● Always needs FTWRL to coordinate threads but for a
small time if all tables are innodb
● --less-locking
– LOCK TABLES READ LOCAL for non-innodb
– CONSISTENT SNAPSHOT for innodb
● --use-savepoints
– Reduce metadata locking issues
● --no-locks
– Not ensure a consistent backup
www.percona.com
Backup Locks
● Percona Server 5.6 new locks for backups
● Percona XtraBackup 2.2
● Mysqldump --lock-for-backup --single-transaction
● Mydumper 0.6.2
● LOCK TABLES FOR BACKUP
● Block updates to non-transactional tables
● Block DDL to all tables
Examples
www.percona.com
Using Mydumper
● Full Backup:
● pre mydumper
mysqldump -h x.x.x.x -P -d –single-transaction -R –skip-triggers --ignore-create-
error
● mydumper -h x.x.x.x -–less-locking –-compress -o /backup/dir
post_mydumper
● mysqldump -h x.x.x.x -P xxxx -d –single-transaction -t --ignore-create-error
● Full Restore:
myloader -h x.x.x.x -d /backup/dir -o
www.percona.com
Using Mydumper
● Partial Restore:
cd /backup/dir
mkdir restore
cp -l db.* ./restore/
cp -l metadata ./restore/
myloader -h x.x.x.x -d /backup/dir/restore/ -o
Tips
www.percona.com
Tips
● Use the three types of backups
● Binary for full restores, new slaves
● Logical for partial restores
● Binlog for point in time recovery
● Store on more than one server and off-site
● Test your backups!!!!
● Document restore procedures, script them and test them!!!
Percona Backup Service
www.percona.com
Percona Backup Service
● Managed MySQL backup and recovery combining our best practices
and software tools with your backup servers
● Percona ensures your backups run smoothly and reliably
● Backup data sets are always available
● Percona manages production recovery
● Lower TCO than managing in-house
● Any combination of MySQL server and backup locations
● Flexible backup configurations per customer
● More information at www.percona.com
vinoth.kanna@percona.com
We're Hiring! www.percona.com/about-us/careers/
Thank you - Q&A

Weitere ähnliche Inhalte

Was ist angesagt?

Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...Zarafa
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Tim Lossen
 
Get More Out of MySQL with TokuDB
Get More Out of MySQL with TokuDBGet More Out of MySQL with TokuDB
Get More Out of MySQL with TokuDBTim Callaghan
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupNilnandan Joshi
 
MySQL on AWS RDS
MySQL on AWS RDSMySQL on AWS RDS
MySQL on AWS RDSMydbops
 
TokuDB internals / Лесин Владислав (Percona)
TokuDB internals / Лесин Владислав (Percona)TokuDB internals / Лесин Владислав (Percona)
TokuDB internals / Лесин Владислав (Percona)Ontico
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLAlexei Krasner
 
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevInnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevFuenteovejuna
 
M|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaM|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaMariaDB plc
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performancePostgreSQL-Consulting
 
Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. RedisTim Lossen
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLanandology
 
Backup, restore and repair database in mongo db linux file
Backup, restore and repair database in mongo db linux fileBackup, restore and repair database in mongo db linux file
Backup, restore and repair database in mongo db linux filePrem Regmi
 
Beyond Postgres: Interesting Projects, Tools and forks
Beyond Postgres: Interesting Projects, Tools and forksBeyond Postgres: Interesting Projects, Tools and forks
Beyond Postgres: Interesting Projects, Tools and forksSameer Kumar
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALEPostgreSQL Experts, Inc.
 
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...Mydbops
 
2016 jan-pugs-meetup-v9.5-features
2016 jan-pugs-meetup-v9.5-features2016 jan-pugs-meetup-v9.5-features
2016 jan-pugs-meetup-v9.5-featuresSameer Kumar
 

Was ist angesagt? (20)

Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
 
Percona FT / TokuDB
Percona FT / TokuDBPercona FT / TokuDB
Percona FT / TokuDB
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
 
Get More Out of MySQL with TokuDB
Get More Out of MySQL with TokuDBGet More Out of MySQL with TokuDB
Get More Out of MySQL with TokuDB
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackup
 
MySQL on AWS RDS
MySQL on AWS RDSMySQL on AWS RDS
MySQL on AWS RDS
 
PostgreSQL and MySQL
PostgreSQL and MySQLPostgreSQL and MySQL
PostgreSQL and MySQL
 
TokuDB internals / Лесин Владислав (Percona)
TokuDB internals / Лесин Владислав (Percona)TokuDB internals / Лесин Владислав (Percona)
TokuDB internals / Лесин Владислав (Percona)
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
 
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevInnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter Zaitsev
 
M|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaM|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at Nokia
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. Redis
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
 
How to Monitor MySQL
How to Monitor MySQLHow to Monitor MySQL
How to Monitor MySQL
 
Backup, restore and repair database in mongo db linux file
Backup, restore and repair database in mongo db linux fileBackup, restore and repair database in mongo db linux file
Backup, restore and repair database in mongo db linux file
 
Beyond Postgres: Interesting Projects, Tools and forks
Beyond Postgres: Interesting Projects, Tools and forksBeyond Postgres: Interesting Projects, Tools and forks
Beyond Postgres: Interesting Projects, Tools and forks
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALE
 
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
 
2016 jan-pugs-meetup-v9.5-features
2016 jan-pugs-meetup-v9.5-features2016 jan-pugs-meetup-v9.5-features
2016 jan-pugs-meetup-v9.5-features
 

Ähnlich wie Mydumper Logical Backup Tool

UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningFromDual GmbH
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsFromDual GmbH
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveMarcelo Altmann
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterFromDual GmbH
 
PL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxPL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxVinicius M Grippa
 
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA SolutionsNagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA SolutionsNagios
 
Measuring a 25 and 40Gb/s Data Plane
Measuring a 25 and 40Gb/s Data PlaneMeasuring a 25 and 40Gb/s Data Plane
Measuring a 25 and 40Gb/s Data PlaneOpen-NFP
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The HoodNagios
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsLenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Louis liu
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsLenz Grimmer
 
Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorCommand Prompt., Inc
 
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux AdminsLinuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux AdminsDave Stokes
 
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud TrainingLinux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud TrainingChinaNetCloud
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Valerii Kravchuk
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?FromDual GmbH
 

Ähnlich wie Mydumper Logical Backup Tool (20)

UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL Tuning
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer Perspective
 
MySQL DBA
MySQL DBAMySQL DBA
MySQL DBA
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera Cluster
 
PL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxPL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptx
 
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA SolutionsNagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
 
Measuring a 25 and 40Gb/s Data Plane
Measuring a 25 and 40Gb/s Data PlaneMeasuring a 25 and 40Gb/s Data Plane
Measuring a 25 and 40Gb/s Data Plane
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The Hood
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Go replicator
Go replicatorGo replicator
Go replicator
 
Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL Replicator
 
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux AdminsLinuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
 
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud TrainingLinux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?
 
MySQL and MariaDB Backups
MySQL and MariaDB BackupsMySQL and MariaDB Backups
MySQL and MariaDB Backups
 

Mehr von Karthik .P.R

Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deploymentKarthik .P.R
 
Scaling MySQL using Fabric
Scaling MySQL using FabricScaling MySQL using Fabric
Scaling MySQL using FabricKarthik .P.R
 
MySQL HA Percona cluster @ MySQL Meetup Mumbai
MySQL HA Percona cluster @ MySQL Meetup Mumbai MySQL HA Percona cluster @ MySQL Meetup Mumbai
MySQL HA Percona cluster @ MySQL Meetup Mumbai Karthik .P.R
 
Percona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA'sPercona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA'sKarthik .P.R
 
Mysql from a DBA prespective
Mysql from a DBA prespectiveMysql from a DBA prespective
Mysql from a DBA prespectiveKarthik .P.R
 
MySQL Storage Engines
MySQL Storage EnginesMySQL Storage Engines
MySQL Storage EnginesKarthik .P.R
 
MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)Karthik .P.R
 

Mehr von Karthik .P.R (7)

Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
 
Scaling MySQL using Fabric
Scaling MySQL using FabricScaling MySQL using Fabric
Scaling MySQL using Fabric
 
MySQL HA Percona cluster @ MySQL Meetup Mumbai
MySQL HA Percona cluster @ MySQL Meetup Mumbai MySQL HA Percona cluster @ MySQL Meetup Mumbai
MySQL HA Percona cluster @ MySQL Meetup Mumbai
 
Percona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA'sPercona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA's
 
Mysql from a DBA prespective
Mysql from a DBA prespectiveMysql from a DBA prespective
Mysql from a DBA prespective
 
MySQL Storage Engines
MySQL Storage EnginesMySQL Storage Engines
MySQL Storage Engines
 
MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)
 

Kürzlich hochgeladen

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Kürzlich hochgeladen (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Mydumper Logical Backup Tool

  • 1. Backup - Mydumper Vinoth Kanna RS Remote DBA 2014-07-13
  • 2. www.percona.com Agenda ● Logical Backups ● Backups Locks ● Examples ● Tips
  • 3. www.percona.com Logical Backups ● Logical ● Plain text files ● Can be Remote ● Slower on large data-sets ● Sometimes the only option
  • 5. www.percona.com Logical Backups ● mysqldump ● General use ● Simple to use ● By default lock tables ● One big output file ● Can be piped to mysql client
  • 6. www.percona.com Logical Backups ● mysqldump ● --opt = --add-drop-table --add-locks --create-options --quick --extended-insert --lock-tables --set-charset --disable-keys (default) ● --single-transaction (innodb) ● --master-data (FTWRL) for binlog coordinates ● --dump-slave ● --innodb-optimize-keys (PS only feature) ● --triggers (ON) --routines (OFF)
  • 7. www.percona.com Logical Backups ● Mydumper ● Faster logical backups as is multithread ● Almost no locking with innodb tables ● Compress on the fly ● Doesn't handle Views, Triggers and Procedures ● Separate files per table, one row per line
  • 8. www.percona.com Logical Backups ● Mydumper ● --threads ● --outputdir ● --rows, --chunk-filesize ● --compress ● --less-locking ● --kill-long-queries ● --use-savepoints
  • 9. www.percona.com Logical Backups ● Without chunks Thread 1 Thread 2 Thread 3 Thread 4 0 10 20 30 40 50 60 Table D Table C Table B Table A Time
  • 10. www.percona.com Logical Backups ● With chunks (--rows) Thread 1 Thread 2 Thread 3 Thread 4 0 5 10 15 20 25 Table D Table C Table B Table A Time
  • 11. www.percona.com Logical Backups ● Mydumper output files ● metadata Started dump at: 2014-04-18 22:01:30 SHOW MASTER STATUS: Log: mysql-bin.017436 Pos: 890402821 SHOW SLAVE STATUS: Host: 192.168.56.101 Log: mysql-bin.017057 Pos: 968001054 Finished dump at: 2014-04-19 03:10:05
  • 12. www.percona.com Logical Backups ● Mydumper output files ● database.table.sql /*!40101 SET NAMES binary*/; /*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40103 SET TIME_ZONE='+00:00' */; INSERT INTO `t1` VALUES (1,"abc"), (2,"def"), (4,"abc"), (5,"abc"), (6,"abc"), (7,"abc"), (8,"abc");
  • 14. www.percona.com Backup Locks ● LOCK TABLE ... READ LOCAL ● Other sessions can read the table but can't write ● LOCAL allows non conflicting INSERTs to MyISAM ● FLUSH TABLES WITH READ LOCK ● Global read lock ● Big issue on busy servers and long running selects ● Requires tables be reopened which can be another bottleneck on busy servers ● metadata locking since 5.5 ● No DDLs to tables used in a transaction
  • 15. www.percona.com Backup Locks ● mysqldump ● --lock-tables (default) – LOCK TABLES READ LOCAL ● --lock-all-tables --master-data and --dump-slave – FLUSH TABLES WITH READ LOCK ● --single-transaction (innodb only) – START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT */ ● --skip-lock-tables – No locks
  • 16. www.percona.com Backup Locks ● Mydumper ● Always needs FTWRL to coordinate threads but for a small time if all tables are innodb ● --less-locking – LOCK TABLES READ LOCAL for non-innodb – CONSISTENT SNAPSHOT for innodb ● --use-savepoints – Reduce metadata locking issues ● --no-locks – Not ensure a consistent backup
  • 17. www.percona.com Backup Locks ● Percona Server 5.6 new locks for backups ● Percona XtraBackup 2.2 ● Mysqldump --lock-for-backup --single-transaction ● Mydumper 0.6.2 ● LOCK TABLES FOR BACKUP ● Block updates to non-transactional tables ● Block DDL to all tables
  • 19. www.percona.com Using Mydumper ● Full Backup: ● pre mydumper mysqldump -h x.x.x.x -P -d –single-transaction -R –skip-triggers --ignore-create- error ● mydumper -h x.x.x.x -–less-locking –-compress -o /backup/dir post_mydumper ● mysqldump -h x.x.x.x -P xxxx -d –single-transaction -t --ignore-create-error ● Full Restore: myloader -h x.x.x.x -d /backup/dir -o
  • 20. www.percona.com Using Mydumper ● Partial Restore: cd /backup/dir mkdir restore cp -l db.* ./restore/ cp -l metadata ./restore/ myloader -h x.x.x.x -d /backup/dir/restore/ -o
  • 21. Tips
  • 22. www.percona.com Tips ● Use the three types of backups ● Binary for full restores, new slaves ● Logical for partial restores ● Binlog for point in time recovery ● Store on more than one server and off-site ● Test your backups!!!! ● Document restore procedures, script them and test them!!!
  • 24. www.percona.com Percona Backup Service ● Managed MySQL backup and recovery combining our best practices and software tools with your backup servers ● Percona ensures your backups run smoothly and reliably ● Backup data sets are always available ● Percona manages production recovery ● Lower TCO than managing in-house ● Any combination of MySQL server and backup locations ● Flexible backup configurations per customer ● More information at www.percona.com