Monday, December 1. 2008
Some days ago, I released version 0.11 of mylvmbackup a Perl script that performs consistent backups of a MySQL server by using LVM filesystem snapshots. The source archive as well as a generic RPM can be found on the project home page, packages for many Linux distributions are available on the openSUSE Build service.
This release includes some new functionality as well as numerous bug fixes and improvements, most notably:
- Added support for using rsnap as a backup backend (Matt Lohier)
- The documentation is now maintained in POD style instead of asciidoc (Matthew Boehm)
- Support using non-GNU tar and additional compression methods (e.g. bzip2, lzma) (Alexander Skwar)
- Code cleanups, improved error handling and logging
I would like to thank all the contributors for their support! More details about the changes in this release, directly from the ChangeLog:
- Added new option "--quiet" that suppresses informal logging output (warnings and errors will still be printed/logged)
- Applied patch from "kjetilho" that makes mylvmbackup more robust and paranoid when it comes to handling errors/failures (Bug #298175) Now the script aborts cleanly in case of any error.
- Fixed error handling in case of a failed DB connection (patch submitted by Matthew Boehm, Bug #280989)
- Merged changes from Alexander Skwar: Fix for Bug #278478 and implemented Blueprint "Improve the tar backup backend of mylvmbackup"
- Fixed Bug #271671: "overloading parameters does not work" by removing the default values for host and port from the configuration file and removing the unnecessary check for passing both host and socket at the same time. Updated documentation and configuration file comments accordingly.
- Applied patch suggested by "Jonas" to fix Bug #267944: "backup returns successfully when snapshot creation fails"
- Code cleanup: moved flushing of tables in a separate subroutine flush_tables()
- Code cleanup: moved log messages into the respective subroutines
- Code cleanup: use return values of subroutines instead of updating global variables
- Improved some log messages to explain what was DONE or FAILED
- Code cleanup: build up long command strings in a $command variable before passing it to system()
- Renamed subroutine create_snapshot() to create_lvm_snapshot()
- Merged patch from Matthew Boehm: Removed old asciidoc documentation in favor of POD style. This removes the dependency on the external program a2x for creating documentation and uses the 'built-in' pod2html and pod2man instead. Updated the Makefile to accommodate the change.
- Applied patch from Matthew Boehm to make the backup file name suffix configurable via a "--suffix" option. Updated the man page accordingly.
- Applied patch from Matt Lohier to support rsnap as a backup backend
- Moved the list of contributors from the man page into a separate CREDITS file, added missing names
Enjoy!
Saturday, September 20. 2008
I am happy to announce that mylvmbackup version 0.10 has been released.
You can download the updated package from the project home page or via the openSUSE Build Service.
This version fixes some bugs and includes new functionality:
- Applied patch from Marc Haber: added option --keep_snapshot that will skip the removal of the backup snapshot before terminating the script. Providing the option --backuptype=none will now skip creating a backup using the builtin backup modules. Both options provide more flexibility when using hooks for performing the actual backup tasks or when the snapshot is considered to be the actual backup.
- Added two new hooks: "backupsuccess" and "backupfailure" which are called respectively upon success of failure of the backup operation (Bug #264089)
- Make sure that binaries are being found ($PATH may not include /sbin when called from cron), added missing entry for "lvs" to mylvmbackup.conf (Bug #255703)
- Updated documentation
Tuesday, September 16. 2008
This is more of an "behind the scenes" update and I hope that you won't see any (negative) changes on the PlanetMySQL front page or the RSS feeds: I just finished and commited the conversion of the backend script that performs the parsing and aggregation of feeds from requiring MagpieRSS to SimplePie.
This will provide better support for a wider range of feed types and should also fix a few quirks, e.g. that some postings (for example the one from Kevin Burton) only showed up as an "A" in the Planet's RSS feed. It hopefully also fixes a weirdness with time zones that some people were reporting, but this requires further investigation.
The size and complexity of the script was reduced significantly because of this change - SimplePie is a breeze to use in comparison to MagpieRSS and it's very well-documented. The developers provide some more reasons and a comparison on why you should also make this switch!
And in case you notice anything broken or weird on PlanetMySQL that might be related to the change, please let me know! This change was an important step for future improvements of the site.
Wednesday, August 13. 2008
I recently added two new packages to my repository on the openSUSE Build Service:
- Maatkit is a collection of essential command-line utilities for MySQL. Each is completely stand-alone, without dependencies other than core Perl and the DBI drivers needed to connect to MySQL, and doesn't need to be "installed" - you can just execute the scripts. This makes the tools easy to use on systems where you can't install anything extra, such as customer sites or ISPs.
- protobuf - Protocol Buffers - Google's data interchange format. Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats.
The protobuf package is required, if you want to compile drizzle. Packages are available for openSUSE, Fedora and Mandriva Linux. Feedback is welcome!
Friday, July 11. 2008
I am happy to announce that a new version (0.9) of mylvmbackup has been released. This is the first release since the source code has been moved from Subversion to Bazaar and is now hosted on Launchpad.net. I would like to thank Robin H. Johnson and Patrick Hahn for providing the patches that contributed to this new release!
mylvmbackup is a tool for quickly creating backups of MySQL server's data files. To perform a backup, mylvmbackup obtains a read lock on all tables and flushes all server caches to disk, makes an LVM snapshot of the volume containing the MySQL data directory, and unlocks the tables again. The snapshot process takes only a small amount of time. When it is done, the server can continue normal operations, while the actual file backup proceeds.
From the ChangeLog:
- Applied patch from Patrick Hahn: provide an option to call external scripts/applications (hooks) at various stages of the backup process. See the man page for instructions
- Added options "--skip_hooks" to disable the execution of hooks and "--hooksdir" to define the location for these (default is /usr/share/mylvmbackup)
- Updated documentation: added new options and instructions on how to use hooks
- Applied patch from Robin H. Johnson: Full support for an rsync:// service as the backup destination. If you include any path fragments with the rsync module name, they must already exist!
- Updated documentation to reflect these changes
- Updated TODO
You can download a source tarball or RPM from the project home page. Additional packages for various Linux distributions can be obtained from the openSUSE Build Service. Packages for Gentoo and Debian should appear shortly, too.
Enjoy! Please let me know how mylvmbackup works for you, either by posting to our mailing list or by submitting a bug report. Thanks!
Wednesday, July 2. 2008
Last weekend I finally found some time to upload pictures that I had taken during various events that I attended in the past few months. So here are my impressions from the following events:
These are probably the last pictures that I have taken with my trusty old Pentax Optio S4 - I just received my new camera, a Canon PowerShot A720 IS. I have just started to toy around with it, but the first results look promising! The Pentax served me well for several years - I've taken 9745 pictures with it. But it had a few deficiencies, particularly the slow startup and flash recharge time and the bad quality of pictures indoors bothered me for quite a while. But it is very small and handy and the metal housing makes it quite sturdy.

The first picture taken with my new camera: a picture of the old one.

And probably the last picture taken using the old camera: my new Canon.
Wednesday, April 16. 2008
FYI, I changed two parameters on Planet MySQL to accomodate the current flood of postings coming from the MySQL Conference attendees: we now display the last 25 posts (instead of 10) on the front page, the RSS feed now includes the latest 100 posts (instead of 50). This should make sure that posts actually make it to the front page for at least some time, before they fall off again.
Please keep up the good blogging!
Friday, April 11. 2008
I am happy to announce the release of mylvmbackup version 0.8. mylvmbackup is a tool for quickly creating backups of a MySQL server's data files. To perform a backup, mylvmbackup obtains a read lock on all tables and flushes all server caches to disk, makes an LVM snapshot of the volume containing the MySQL data directory, and unlocks the tables again. The snapshot process takes only a small amount of time. When it is done, the server can continue normal operations, while the actual file backup proceeds.
Below is the list of changes since version 0.6. You may wonder what happened to version 0.7 - it had a rather short life cycle as I was informed about a bug that I fixed quickly before I made a wider release announcement of 0.7.
- Fixed a bug in the InnoDB recovery function: the second mysqld process clobbered the socket file of the primary MySQL instance (thanks to Alain Hoang for reporting this)
- Updated the man page, noted some other limitations of the InnoDB recovery function
- Bug fix: use the correct mysqld parameter to provide an alternative PID file (--pid-file instead of --pidfile) - thanks to Guillaume Boddaert and Jim Wilson for reporting this!
- Added option "--skip_mycnf" to skip including a copy of the MySQL configuration file in the backup, added a safety check that the file actually exists prior to backing it up.
Updated package are available from the home page and via the openSUSE Build Service as usual. Updated packages for Debian/Ubuntu and Gentoo Linux should also be available shortly. Enjoy!
Speaking of LVM snapshot backups: I will be giving a talk about this subject at our MySQL Conference 2008 in Santa Clara, CA next week. If you are curious about how MySQL can be backed up using this technology, please consider to stop by!
Thursday, February 14. 2008
Yesterday, Drupal 6.0 was officially released - check out this screencast to get a 29-minute tour on the new features in this release.
We'd like to congratulate the Drupal Developer Team and Community for reaching this milestone and are happy that the MySQL Server continues to serve well as the database backend for this awesome content management platform!
I had the pleasure of evaluating and reviewing a previous release of Drupal for the Open Source Content Management System Award from Packt Publishing and it has been one of my favourites.
Keep up the good work!
Sunday, October 28. 2007
Version 0.6 of mylvmbackup, a script to perform backups of a MySQL server using Linux LVM snapshots, has now been released.
In addition to various code cleanups and documentation improvements, many new features have been added to this version. I'd like to specially thank Robin H. Johnson from the Gentoo project for contributing many of the improvements to this release!
- Added a new rsync backup type. This is very useful if you want to use mylvmbackup to create the initial state for your slave servers. Instead of creating a .tar.gz archive, the data directory is copied into a timestamped archive directory. (Robin)
- Added support for a trailing argument to tar, which can be used for excluding files. (Robin)
- Separated out the suffix of the tarball (Preperation for rsync and users that want to use bzip2 or no compression on the tarball.) (Robin)
- While the backup is performed, a temporary suffix at the end of the tar backup file name (or the rsync target directory name) now indicates that it is incomplete. (Robin)
- The my.cnf configuration file is now included in the backup. (Robin)
- Added the ability to run an extra FLUSH TABLES on busy databases where lvcreate might take a long time (and may overrun the interactivity timeout on the connection, losing the lock). (Robin)
- Added option "--pidfile" to provide an alternative PID file location for the second server instance that is started to perform the InnoDB recovery on the snapshot prior to backing it up (Otherwise it may default to using the same pid file location that the running server uses and safe_mysqld will abort) - thanks to Kristian Köhntopp for making me aware of this problem.
- Before discarding the snapshot LV, the output of "lvs <snapshot>" is now printed out for diagnostics. It contains useful information like "how much percent of the backing store was used", which helps tuning the size of the snapshot LV.
- Added option "--skip-flush-tables" that performs the snapshot without flushing the tables to disk beforehand (which is not supported by InnoDB tables anyway) - this would save time, as the flushing can take a while, depending on the buffer sizes. (Thanks to Peter Zaitsev for the suggestion)
Version 0.6 is now available for download from http://www.lenzg.net/mylvmbackup/ (source tarball and RPM). I also provide RPM packagages for a number of additional platforms via my home:LenzGr repository on the fabolous openSUSE Build Service.
Enjoy! Feedback, patches and suggestions are welcome - please consider joining the mylvmbackup mailing list to discuss your experiences with this tool.
Sunday, October 21. 2007
This certainly took longer than expected, but here are some pictures that I took during our MySQL Developer Meeting in Heidelberg, Germany last month. Enjoy!
Thursday, July 26. 2007
JFYI, I recently updated several packages in my home:LenzGr and the devel:tools:scm repositories of the openSUSE Build Service: Enjoy! And Kudos to the folks that develop and maintain the build service, this is a great service to the Community.
Thursday, July 5. 2007
Just a quick heads-up - I just commited a change to the Planet MySQL code that slightly modifies how the RSS feed is being created: now the author name is put in front of each posting's title, similar to how many other feed aggregators mark the different articles. I hope you find this change useful, let me know if you experience any problems or have any other suggestions for improvements. Thanks!
Wednesday, July 4. 2007
Today, I again spent about an hour to revert changes made by spambots on various MySQL Forge Wiki pages. As I was really sick of this, I now installed a new plugin: reCAPTCHA - this will hopefully raise the bar for spambots to create new user accounts automatically for spamming the Wiki. If you are a registered user already, you will probably not notice the change - by default, CAPTCHAs are only displayed on the following events: - New user registration
- Anonymous edits that contain new external links
- Brute-force password cracking
Let's hope it helps! Please let me know if you still experience spam problems on the Wiki.
Wednesday, May 9. 2007
Eric Bergen from Proven Scaling (which I had the pleasure to meet in person during the MySQL Conference & Expo in Santa Clara last month) was kind enough to send me a patch for the mylmbackup tool, which justifies a new release: Attached is a patch file for mylvmbackup that adds the ability to use lvm version 2 and perform innodb recovery on the snapshot prior to creating a tar ball. The option is named --innodb-recover.
I've also fixed a bug with default value handling for command line options. In version 0.4 if a config file was specified default values in the script were all changed to blank. This means that the config file had to supply values for every variable instead of just the values that need to be changed from default.
This is a very useful addition, as it significantly reduces the time required to recover a MySQL server from a snapshot backup. Thank you, Eric! Note that you need to use LVM2, as LVM1 does not support the required writing to snapshot volumes. Version 0.5 is now available for download from the mylvmbackup project page. I also would like to announce that I have set up a dedicated mailing list for this tool: if you want to discuss the usage/future of mylvmbackup, propose patches or ask for
help, there now is a mailinglist, hosted on
FreeLists.org. To subscribe, either enter
your email address on the
mylvmbackup list information page
or send an email with the subject "subscribe" to
mylvmbackup-request@freelists.org.
The list is archived here. See you there!
|