Skip to main content

Posts

Showing posts with the label MySQL Enterprise Backup

Throttling MySQL Enterprise Backup with cgroups

Today I encountered a situation where MySQL Enterprise Backup caused to much load on the I/O subsystem of the server to cause the application to be so slow that it wasn't usable any longer. So I wanted to limit the mysqlbackup process so it wouldn't cause any more issues. The mysqlbackup command has settings to for the number of read, write and process threads. The defaults are 1 read, 1 write and 6 process threads. So that isn't really useful for throttling as I was using the defaults. Using the ionice utility wouldn't work as that requires the CFG I/O scheduler. I found a solution in this blog post . It is to use cgroups on Linux. I had used cgroups before to test how a galera setup works when one of the three servers had a much slower CPU. # mkdir /cgroup/blkio # mount -t cgroup -o blkio non /cgroup/blkio # cgcreate -g blkio:/mysqlbackup # ls -lh /dev/mapper/vgdb01-lvdb01 lrwxrwxrwx 1 root root 7 Sep 26 14:22 /dev/mapper/vgdb01-lvdb01 -> ../dm-2 # ls -lh /...

The new cloud backup option of MySQL Enterprise Backup

MySQL Enterprise Backup 3.10 support backups to the cloud. The only supported cloud service is Amazon S3. When the cloud destination is used mysqlbackup will upload the backup as an image file. You can specify all options on the commandline: mysqlbackup --cloud-service=s3 --cloud-aws-region=eu-west-1 \ --cloud-access-key-id=AKIAJLGCPXEGVHCQD27B \ --cloud-secret-access-key=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 \ --cloud-bucket=meb_myserver --cloud-object-key=firstbackup --cloud-trace=0 \ --backup-dir=/tmp/firstbackup --backup-image=- --with-timestamp backup-to-image But you can also put the settings in the my.cnf [mysqlbackup_cloud] cloud-service=s3 cloud-aws-region=eu-west-1 cloud-access-key-id=AKIAJLGCPXEGVHCQD27B cloud-secret-access-key=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 cloud-bucket=meb_myserver cloud-trace=0 backup-dir=/data/cloudbackup backup-image=- with-timestamp The with-timestamp option is important as the backup won't start if the backup-dir already...

Single database backup and restore with MEB

I was recently asked about if MySQL Enterprise Backup would be able to restore single databases. My initial answer was that this was complicated, but might be doable with the Transportable Table Space (TTS) option. But first let's go back to the basics. A common way of working with mysqldump is to get a list of databases and then loop through the databases and dump the data and schema to a SQL file. But both backups and restores will take a lot of time if the size of the database grows. And it's a luke-warm backup at best instead of a hot backup. So that's why we have MySQL Enterprise Backup. MySQL Enterprise Backup allows you to make a hot backup of InnoDB tables by copying the datafiles while watching the InnoDB redo log files. On disk the data from the InnoDB storage engine consists of a system tablespace (one of more ibdataX files), the redo log files (iblogfileX) and zero or more table-specific tablespace files (*.ibd). The data dictionary data is located in ...