Do you know if your production MySQL servers will come back up when restarted? A recent support episode illustrates a number of best practices. The task looked trivial: Update a production MySQL server (replication master) with a configuration tuned and tested on a development server. Clean shutdown, change configuration, restart. Unfortunately, the MySQL daemon did not just ‘come back’, leaving 2 sites offline. Thus begins an illuminating debugging story. First place to look is the daemon error log, which revealed that the server was segfaulting, seemingly at the end of or just after InnoDB recovery. Reverting to the previous configuration did not help, nor did changing the InnoDB recovery mode. Working with the client, we performed a failover to a replication slave, while I got a second opinion from a fellow engineer to work out what had gone wrong on the server. Since debug symbols weren’t shown in the stack trace, we needed …
[Read more]If you're interested in ways to back up stuff, and haven't tried Dar yet, here's an article on using Dar that I've just published on my personal blog. In short, Dar works very much like Tar, but it's got a built-in feature for slicing up archive files which comes handy when you want to distribute backup files across several media, for example DVDs or hard disks.
If you're interested in ways to back up stuff, and haven't tried Dar yet, here's an article on using Dar that I've just published on my personal blog. In short, Dar works very much like Tar, but it's got a built-in feature for slicing up archive files which comes handy when you want to distribute backup files across several media, for example DVDs or hard disks.
If you're interested in ways to back up stuff, and haven't tried Dar yet, here's an article on using Dar that I've just published on my personal blog. In short, Dar works very much like Tar, but it's got a built-in feature for slicing up archive files which comes handy when you want to distribute backup files across several media, for example DVDs or hard disks.
We've written about replication slaves lagging behind masters before, but one of the other side effects of the binary log being serialized, is that it also limits the effectiveness of using it for incremental backup. Let me make up some numbers for the purposes of this example:
- We have 2 Servers in a Master-Slave topology.
- The database size is 100 GB (same tables on each).
- The slave machine barely keeps up with the master (at 90% capacity during peak, 75% during offpeak)
- The peak window is 12 hours, the offpeak window is 12 hours.
Provided that the backup method was raw data files, it shouldn't take much more than 30 minutes to restore 100GB (50MB/s), but to replay one day of binary logs it would take an additional 20 hours ((12 * …
[Read more]
In today’s gp/bp an open door will be kicked in: take your
backups offsite!
I was actually tempted to create a poll to see how many of you do
not have proper backups, and how many of you do not take those
backups offsite. It is a simple piece of advice and relatively
simple to set up. Offsite in this case would ideally be
physically offsite: to a different server in a different building
in a different location. A start however is to take them to a
different server. And don’t make the mistake of thinking a
different VPS on the same physical server is good enough. True,
that will protect you from operating system failure of the guest,
but it will likely not protect you from hardware failure, or
operating system failure on the host OS.
Also, take good care of how you are getting your backups offsite. A normal FTP connection might do the job, but it is hardly secure. Ideally, use SFTP or rsync over ssh to stream your backups …
[Read more]A short time ago I posted how I was Using XtraDB Backup to backup InnoDB. Overall, the blog post was positive, but experiences that others have had (and commented to on that blog post) have made me want to put out another short article about using XtraDB backup.
The first few points remain the same — the backup process is stable, we were able to use the binaries without compiling, and using Innobackupex as the wrapper script, analogous to Innobackup.pl.
However, we did figure out why Xtrabackup had to be run as the mysql user:
Xtrabackup writes to the data dictionary file (ibdata1, for example). We have not examined if it also writes to the data and index files (still ibdata1 by default, or the .ibd files when using innodb_file_per_table). [EDIT: The authors of Xtrabackup have commented below as to why the write occurs: …
[Read more]After a long hiatus, I am happy to announce that mylvmbackup version 0.12 has now been released. This release includes a large number of improvements, minor code cleanups, as well as some new functionality. In particular, I would like to thank Matthew Boehm, Tim Stoop, Baron Schwartz, Ville Skyttä and Ronald Bradford for their contributions.
Some notable highlights from the ChangeLog:
- Removed the absolute path names to external tools (make sure $PATH is correct)
- Added --log-err to the startup options of the recovery instance to avoid cluttering the server's error log
- Added support for hooks written as Perl Modules. (Matthew Boehm)
- Added support for date/time-formatted path names for backupdir and mountdir (Matthew Boehm)
- Backupdir and …
I ran into a very interesting issue with a customer recently. The
customer was storing JPEGs in MySQL (as BLOBs obviously) and was
wanting to setup some additional MySQL slaves. Nothing crazy
there. So I did the normal steps of scheduling a mysqldump with
the --all-databases and --master-data options. Trouble is, the
next day when I start importing the dump, 'mysql' bombed up with
"ERROR at line X: Unknown command '\0'". I used 'sed' to pull out
the lines around the error and didn't really notice anything out
of the ordinary. After a bit of Googling, one suggestion was to
do a simultaneous backup and restore (basically a "mysqldump .. |
mysql -h ..."). In this case, since I was using an existing slave
to do the backups, this was something that was feasible to do.
Unfortunately, the result was the same.
It turns out that 'mysqldump' will not always product a dump that
is always BLOB friendly. To get around this, the '--hex-blob'
option …
This is the 150th edition of Log Buffer, the weekly review of database blogs. Someone accidentally left Dave Edwards‘ cage unlocked, and he escaped, thus leaving me with the pleasurable duty of compiling the 150th weekly Log Buffer.
Many people other than Dave are finding release this week. Giuseppe Maxia explains some details of MySQL’s New Release Model. Andrew Morgan announces a New MySQL Cluster Maintenance Release. Aleksandr Kuzminsky of the MySQL Performance …
[Read more]