Archive for the ‘xtrabackup_manager xbm xtrabackup mysql’ Category

Support for XtraBackup 2.0 in XtraBackup Manager coming soon…

Апрель 17th, 2012
Hi Folks,

Just a quick note to let you know that I am planning to add support to XtraBackup Manager to work with XtraBackup 2.0 series releases fairly soon.

Using the XtraBackup 2.0 series will mean that XtraBackup Manager will no longer need to stage the incremental backups to a location on the remote host before copying them back to the XtraBackup Manager storage.

This can be a remarkable efficiency saving for systems with a lot of page changes between backups.

I will also be trying to address some of the feedback/requests that I have received in the Google Code Issues section.

Please check out the project in Google Code here, if you have not already. Feedback and contributions are welcomed!

http://code.google.com/p/xtrabackup-manager/

Cheers,
Lachlan

PlanetMySQL Voting: Vote UP / Vote DOWN

XtraBackup Manager — Job Control, Better Debugging and some little fixes…

Февраль 8th, 2012
Hi Everyone,

Just a quick note to let you know that I've just finished up adding some new features to XtraBackup Manager.

You can now get better visibility into what is going on inside XtraBackup Manager with the "xbm status" command.

It will allow you to see which backup jobs are running and also those which may be waiting to start, due to the maximum number of concurrent backup tasks already running.

It looks/works as follows:

[xbm@localhost ~]$ xbm status

XtraBackup Manager v0.8 - Copyright 2011-2012 Marin Software

Currently Running Backups:

+--------+-----------+-------------+---------------------+-------------------+------+
| Job ID |   Host    | Backup Name |     Start Time      |      Status       | PID  |
+--------+-----------+-------------+---------------------+-------------------+------+
| 14     | localhost | test-backup | 2012-02-07 14:19:19 | Performing Backup | 2525 |
+--------+-----------+-------------+---------------------+-------------------+------+

Note: I have to thank a tiny little BSD-licensed project I found on Google Code called PHP text table for saving me the need to reinvent the wheel in providing this very mysql command-line client-styled table output.


In addition to seeing which jobs are running/queued, if there is a backup job you would like to abort for some reason, then you can now simply use the "xbm kill" command with a Job ID taken from the "xbm status" output:

[xbm@localhost ~]$ xbm kill 14

XtraBackup Manager v0.8 - Copyright 2011-2012 Marin Software

Action: Backup Job ID 14 was killed.

The backup job itself will log an event at the ERROR level, like:

2012-02-07 14:19:30 -0800 [ERROR] : [ The backup job was killed by an administrator. Aborting... ]
2012-02-07 14:19:30 -0800 [INFO] : [ Cleaning up files... ]
2012-02-07 14:19:30 -0800 [INFO] : [ Released lock on port 10000. ]
2012-02-07 14:19:31 -0800 [ERROR] : [ Exiting after the backup job was killed... ]

I'm still not 100% on whether an aborted backup message should be considered an "Error" level event or an "Info" level event. My thinking is that I'd prefer to know if a job was aborted, so I figure putting it at the ERROR level will ensure it is always logged.

Now speaking quickly of the log levels -- it is now useful to increase your logging level in config.php from INFO to DEBUG.

You will see the exact commands used for running backups by XtraBackup Manager, which can be useful when troubleshooting XBM-related issues.

It will enable logging like the below -- Note: The password is _actually_ masked when writing the command to the log. You're welcome ;-)

2012-02-07 14:19:19 -0800 [INFO] : [ Staging an INCREMENTAL xtrabackup snapshot of /var/lib/mysql via ssh: mysql@localhost to /tmp/xbm-3592510/deltas... ]
2012-02-07 14:19:19 -0800 [DEBUG] : [ Attempting to run the incremental backup with command:
ssh -o StrictHostKeyChecking=no -p 22 mysql@localhost 'cd /tmp/xbm-3592510 ; innobackupex --ibbackup=xtrabackup --slave-info --incremental-lsn=2325647 /tmp/xbm-3592510/deltas --user=root --safe-slave-backup --password=XXXXXXX --no-timestamp --incremental --throttle=0 1>&2 '
]

Aside from the above, some other small fixes were made, including ensuring that all temporary files created on the database host that you're backing up are created in the defined "staging_tmpdir" -- This is a parameter that is set at the host level in XtraBackup Manager.

eg. shell> xbm host edit hostname staging_tmpdir /path/to/use

I encourage you to check out the XtraBackup Manager Project and open issues with any problems you encounter or other feedback.

Cheers,
Lachlan

PlanetMySQL Voting: Vote UP / Vote DOWN

XtraBackup Manager Pre-Release v0.8 — Try it out today!

Январь 6th, 2012
Aloha Everybody!

I'm happy to announce XtraBackup Manager Pre-Release v0.8!

Now that XtraBackup 1.6.4 is released and I have completed some of my final show-stopper bug fixes, I feel that XtraBackup Manager is now in a state ready for more general consumption.

I have yet to package up tarballs, but the Quick Start Guide in the Project Wiki contains all the steps you should need to get up and running from the svn trunk.

There is also some great detailed documentation, including diagrams of all of the different Backup Strategies here.

So please, check out the Project and take it for a spin -- if you have problems or questions, join the discussion on the XtraBackup Manager Google Group!

Thanks and Happy 2012!!

Note: Release notes for XtraBackup v0.8 can be found here.

Lachlan

PlanetMySQL Voting: Vote UP / Vote DOWN

XtraBackup Manager — XtraBackup Throttling

Декабрь 2nd, 2011
Hello again!

This week I have been spending some time adding support for throttling to XtraBackup Manager as it has been considered a pre-requisite for us using the tool against our production databases.

In order to add support for throttling, the first thing I did was to look into what kind of means are available to throttle.

It seems there are two methods, both of which are mentioned in Percona's docs or blogs.

#1. Use the --throttle=N parameter. You can give this to innobackupex or to xtrabackup directly. According to the documentation this will limit xtrabackup to use N IOPs/sec when running in --backup mode.

For local machine backups this means N total read/write IOPS/sec and for incrementals this simply means N read IOPS/sec. When using streaming mode --throttle does not take effect (see #2).

#2. Use a nifty tool called "pv" (Pipe Viewer). It has a few features, but most notably it can be use as a simple rate limiter in your pipeline. An example:

shell> cat myFile | pv -q -L10m > myFileCopy

The above will limit the speed at which the file is "cat" into myFileCopy to 10 megabytes a second. Assuming of course the IO subsystem can reach at least that speed.

The best application for pv is to place it somewhere in the pipeline of your streaming backups to limit the rate at which things can flow through the pipeline.

Eg.

shell> innobackupex --stream | pv -q -L10m | nc targetHost 10000

The above will stream through pv and limit the maximum throughput to 10 megabytes/second.

So now understanding what rate limiting methods are available, I needed to consider in what ways XtraBackup Manager uses XtraBackup and the best way to implement the throttling.

I know that:

a) XtraBackup Manager always uses streaming mode when it takes a full backup, so the only option to use there is #2, pv.

b) When performing an incremental backup, XtraBackup Manager will always have xtrabackup stage the deltas locally, before using netcat (nc) to shuttle the data back over the network to the backup host for storage. In this case, limiting using pv is not really useful, because xtrabackup is going to chew up as much IO as it can while calculating the deltas, so we need to opt for the --throttle option on xtrabackup.

So once I understood that I'll need to actually implement throttling in two ways in XtraBackup Manager, I thought about how I would present it to the user for configuration.

I personally find it a bit annoying and confusing that I have to think in two units of measurement for different situations, so I wanted to see if I could insulate the user from that.

My aim was to see if I could present the user with a single configurable for the throttle on a backup task. After all, you don't care what type of backup is going on, you just want to say "Don't use more IO than this much…".

So in order to achieve this, I needed to understand the relationship between the two options as well as the characteristics of IO in both cases.

From my understanding, if you are taking a full backup, you are simply streaming each file sequentially - so we are talking about sequential reads here.

If we are talking about incrementals, we basically give xtrabackup a log sequence number and say "check all the pages and copy ones with a log sequence number above the one we gave" -- so we're finding the pages that have been changed since the given log sequence number.

In this case, it should also be a sequential read, as we're scanning pages end to end, and just checking the log sequence number.

So in both cases it seems we're talking about sequential reads.

When using pv, we're already dealing in a term that is easy to understand and fairly non-subjective. A rate limit in megabytes/sec of sequential read is straight forward.

Now when we're dealing with the --throttle option and thinking in IOPS we have some more to think about. Firstly, how big is an IOP?

Since I'm no good at reading C source code, I opted for the black box method of investigation and simply took an idle database server and started running xtrabackup against it with various --throttle values, while watching iostat on the data mount.

Here are some results:

Throttle value vs Observed disk throughput MB/sec

1:3 MB/sec
2:4 MB/sec
3:5 MB/sec
4:6 MB/sec
5:7 MB/sec

Interestingly the pattern I observe is: throughput = N+2

My best interpretation after even attempting a little digging into xtrabackup.c is that on this idle system we are limiting xtrabackup to 1 x 1MB IOP per second to scan the InnoDB data files, plus we burn 2MB per second to scan/copy the InnoDB log so that it can be applied later.

Now the catch 22 in this whole thing is that I'm observing this on an idle system, so this 2MB per second of log IO would increase if there is more log activity -- surely on a busy system you would need to read more than 2MB of logs every second to keep up.

The catch part? If I actually make the system busy, I can no longer determine where all the different IO in iostat is coming from, so I can't determine how much IO xtrabackup is now using. I'm sure there is a better way to instrument that per process, but unfortunately it extends beyond my personal skill set right now.

In blogging this, I'm hoping someone reading this can help with ideas or clarification...

So coming back to how I should implement the throttling -- I'm fairly sure that IOPS are 1MB in xtrabackup and pv also allows me to throttle in MB/sec, so I should be able to give one simple "throttle" configurable to the XtraBackup Manager user and tell them it limits in MB/sec.

The question then becomes, should I adjust the value I pass to --throttle for XtraBackup to account for this "at least 2MB used for log scanning"?

I decided I wanted to try to be clever and go ahead and adjust it -- so the value passed to XtraBackup for --throttle is now adjusted -2. If the adjustment gives a throttle value less than 1, it is simply given as 1.

None of this is set in stone -- I'm still testing and experimenting, but I'm curious to know your thoughts.

Can anyone shed light on what xtrabackup is doing ?

Should I bother adjusting this value or not ?

Cheers,
Lachlan

PlanetMySQL Voting: Vote UP / Vote DOWN

XtraBackup Manager — Exciting progress!

Ноябрь 22nd, 2011
Hi Folks,

Just another quick update.

I've been working really hard these past couple of weeks on getting what I'm hoping is some great documentation happening for XtraBackup Manager.

There is still more work to be done, but I'm really pleased with how it's coming along.

Stay tuned… awesome things are coming :)

Meanwhile, to those of you who celebrate Thanksgiving this week -- have a safe and happy holiday, however you choose to spend it!

Cheers,
Lachlan

PlanetMySQL Voting: Vote UP / Vote DOWN

XtraBackup Manager — What have I been up to!?!

Сентябрь 24th, 2011
Howdy all,

Just a quick update in the world of XtraBackup Manager development. In the last couple of weeks I have not been doing a great deal of work on XtraBackup Manager itself, but rather doing a lot of testing of XtraBackup Manager and implicitly XtraBackup along with it.

I hit upon some bugs that were basically roadblocks in the way that we intend to use XtraBackup and I'm sure issues that other folks will run into eventually once adoption of XtraBackup increases even more...

I have been working with Percona and SkySQL Support, as well as dabbling in some of the code myself to get fixes for these issues.

The main issues we hit were:

* tar4ibd crashes on certain InnoDB data files (unable to use streaming backups at all) - This was a regression in pre-release build of xtrabackup-1.6.3, For now "fixed" by using an older tar4ibd binary from stable 1.6.2 release.

* innobackupex would not capture MySQL slave position unless using FLUSH TABLES WITH READ LOCK and performing a full backup. Now slave position can be captured in incrementals or full backups without locks, provided that --safe-slave-backup is specified.

* Tables getting both DROP/CREATE or TRUNCATE during backup can cause assertion failure - SkySQL contributed a fix via Monty Program which I am ready to test now.

* Xtrabackup apply-log can crash when attempting to create temporary tables if the temp dir does not exist - Should be fixed very soon in xtrabackup-1.6.3 release.


When I decided to embark on the project for XtraBackup Manager, I was happy to think that finally I'll be able to give something back to the community in the tool that I make. It seems what I didn't consider was that in being such a heavy integrator with XtraBackup that I'd also be contributing some good QA and perhaps improvements to XtraBackup itself.

As an aside, I also found a couple of little issues in Shlomi's online alter table in the OpenArk toolkit and submitted patches for that -- so I've felt very contributive lately.

So what lies ahead?

More testing of XtraBackup and XtraBackup Manager as well as finishing off the command-line configurator.

Then we will be preparing to start eating my dog food and run XBM in production!

That's it for now...

Have a great weekend all!

Cheers,
Lachlan

PlanetMySQL Voting: Vote UP / Vote DOWN

XtraBackup Manager — Command-line Configurator Preview!

Сентябрь 2nd, 2011
Over the past two weeks I have been working on XtraBackup Manager as much as I can and I'm pleased to say that the command-line configurator is coming along very nicely!

There is now a generic "xbm" command that will be the way to manage hosts, storage volumes and backup schedules as well as doing restores, etc.

So far I have built the volume and host management in and will begin work on the backup schedules next!

Once this command-line interface is complete, I'll work to document it on the project wiki on Google Code and it should be ready for public consumption.

Here is a little preview of how it looks in action - forgive the ugly wrapping…



xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

Error: Context missing.

Usage: xbm <context> <action> <args> ...

Contexts and actions may be one of the following:

volume [add|list|edit|delete] <args>             -- Manage Backup Volumes
host [add|list|edit|delete] <args>               -- Manage Hosts to Backup
backup [add|list|edit|delete] <args>             -- Manage Scheduled Backup Tasks
snapshot [list|delete]                           -- Manage Backup Snapshots
restore [local|remote] <args>                    -- Restore Backups

You may specify only a context, or a context and action to get help on its relevant arguments.



xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm volumes    

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

Error: Action missing.

Usage: xbm volumes <action> <args> ...

Actions may be one of the following:

  add <name> <path>                      -- Add a New Backup Volume
  list                                   -- List available Backup Volumes
  edit <name> <parameter> <value>        -- Edit a Backup Volume to set <parameter> to <value>
  delete <name>                          -- Delete a Backup Volume

You may specify an action without parameters to get help on its relevant arguments.

xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm volumes list

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

-- Listing all Backup Volumes --

Name: Storage Array 1   Path: /backup/xbm
Name: Test /backup      Path: /backup


xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm volumes add MyVolume /tmp

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

Action: New volume created with name/path: MyVolume -- /tmp




PlanetMySQL Voting: Vote UP / Vote DOWN

XtraBackup Manager — Movement on the home front…

Август 24th, 2011
It has been a while since I have posted any updates on the XtraBackup Manager front and I apologise for that. Between taking some time off for vacation (how dare I!?) and various different tasks at work snagging my focus away from XBM, I really haven't had much time to work on it.

(Un)fortunately last week we encountered a DB failure that would have been much faster and less painful to recover from had we had XtraBackup Manager finished and in place. While it was a pretty rough week for us DBAs working on addressing the failure, the silver lining is that we now have a concrete example to point to for the importance of the XtraBackup Manager project.

The silver lining in the long story cut short is that I now have the support I need to focus most of my time on XBM again.

So what have I been working on?

I have added support for materialzed backups to the "Continuous Incremental" backup strategy.

I have proceeded with actually running XBM against a few sample hosts with various schedules/settings to see what issues I may encounter.

I have posted a rough design outline in the Google Code wiki for the command-line interface for configuration and started on coding it.

My plan is to follow a similar design to the way the "zfs" command works on (Open)Solaris/Nexenta. 

You can see the design doc here:


Once the CLI configurator is done, I'll proceed with some heavy documentation. After that point XBM should be pretty much ready for mass consumption in an evaluation capacity.

I have learned a lot about PHP and OO in the process of developing XBM, which has been fun, but I know code wise it isn't as elegant as it could be.

As I said when I started the project, I am not really a developer, so the internals of XBM probably aren't the cleanest code ever, but I'm doing my best while focussing on actually forging ahead to get it functional rather than getting too bogged down in how well the internals adhere to best OO design practise.

I'm hoping to get some more folks trying it out once the configurator and docs are up to snuff.

Stay tuned!

Lachlan

PlanetMySQL Voting: Vote UP / Vote DOWN