One of the major contributing factors to the success of MySQL is
the ease and simplicity of its replication. Read-slaves for
scaleout and backup-slaves for noninterrupting backups are the
norm in any MySQL installation I have seen in the last two
years.
So how does replication work? And how shall it be expanded in the
future?
What is available?
The binlog written by MySQL currently logs all statements
changing the tablespace. It is a serialization of all tablespace
changes. The binlog position, expressed as (binlog name, offset),
is a database global timestamp - a timestamp expressed in
seconds.fraction does not work for any precision at all, because
on a multi-core machine multiple things can happen
concurrently.
If you want to make a consistent full backup of the database, the
database must not change during the backup. That is, it must be
possible to associate one and exactly …
MySQL Toolkit distribution 620 updates documentation and test suites, includes some major bug fixes and functionality changes, and adds one new tool to the toolkit. This article is mostly a changelog, with some added notes.
Many of the tools have matured and I just needed to make the documentation top-notch, but there's still a lot to be done on the crucial checksumming and syncing tools. Time is in short supply for me right now, though. In fact, I actually finished this release on June 22, but wasn't able to release it till just tonight!
When seeing that the MySQL Proxy was released, I decided to try to experiment with it since I see strong potential with this tool, both for replication and for other uses (recall that I'm a replication guy, so this is my primary focus). I'm actually on vacation, but this will of course not stop me from tinkering with things (I know, I'm just a hopeless case in this aspect ;) ).
After reporting a minor bug, I managed to build and run it with some sample scripts. I'm using Kubuntu Feisty, and had some initial problems, but it was actually pretty straightforward. I'll repeat the steps anyway, in case anybody else have problems.
- Get the source from the repository svn co http://svn.mysql.com/svnpublic/mysql-proxy/ mysql-proxy
- Make sure you have all packages necessary. Several of the packages …
On the MySQL Conference & Expo 2007, I had the chance of meeting up with Paul (the author of PBXT) and Mikael. We briefly touched the topic of the BLOB Streaming Protocol that Paul is working on, which I find really neat. On the way back home, I traveled with Anders Karlsson (one of MySQL:s Sales Engineers), who is responsible for the BLOB Locator worklog and he described the concepts from his viewpoint.
Since I work with replication, these things got me thinking on what the impact is for replication and how it affects usability, efficiency, and scale-out. Being a RESTful guy, I started thinking about URIs both when Paul …
[Read more]My last post on the replication poll was apparently lost from Planet MySQL. If you're interested, I commented on the replication poll, our future plans, and how they were affected by the poll.
We've been running replication poll and we've got some answers, so I thought I would comment a little on the results of the poll and what our future plans with respect to replication is as a result of the feedback. As I commented in the previous post, there are some items that require a significant development effort, but the feedback we got helps us to prioritize.
The top five items from the poll above stands out, so I thought that I would comment on each of them in turn. The results of the poll were (when this post were written):
| Online check that Master and Slave tables are consistent | 45.4% |
| Multi-source replication: replicating from … |
New alpha release 1.0-pre4 of the MySQL Master-Master Replication Manager. This release has lots of major fixes and I’m glad to announce first sponsored port of mmm to non-linux platform - it has been ported to Solaris 10. So, here are our changes in this version:
- Real checks timeouts - I’ve found and fixed lots of problems in checks timeout code and now if you specified in your mmm_mon.conf, that some check should timeout in 5 sec, it would timeout correctly on all supported platforms.
- External third-party tools using - On all supported non-linux platforms mmm will use system binaries for fping and arp_ping so porting to another platforms would be much easier.
- Agent …
...is something that you influence what it will be.
The problem with replication is that we have so many things that we want to do, but we are not that many people. What we do is what everybody does when the to-do list is to long: prioritize. Since the replication features are developed for you (yes, you), we have added a quickpoll on the http://dev.mysql.com/ where you can pick the three most important replication features that you would like to see us focus on next (after the 5.1 GA).
Do you think that on-line checks for table consistency is for weenies that cannot write a simple little script to do that? Please tell us that.
Do you prefer to live on the edge and think that semi-synchronous replication is for safety junkies? Well, we'll be glad to hear your opinion.
Do you think that the YouTube …
[Read more]MySQL Master-Master Replication Manager version 1.0-pre3 has been released today. Changes list is really short now:
- Major fix in multiple clusters support - now you can use many clusters with one monitoring node (details are in mmmd_mon man page)
- Man pages for mmmd_mon, mmmd_agent and mmm_control scripts
- Startup scripts added/fixed for mmmd_mon and mmmd_agent
- Installation script now requires iproute package to be installed on server.
As always, if you have any questions/suggestions, post them here or in mmm-devel mail list.
The first version of this code failed to work on 5.1 so here is a
version that does:
if(DATABASE_REPLICATION_CHECK)
{
$result = mysql_query("show slave status;");
$row = mysql_fetch_assoc($result);
if( ($row['Slave_IO_Running']!='Yes') || ($row['Slave_SQL_Running']!='Yes') )
{
$fp = fopen('tmp/halt', 'w+');
fclose($fp);
header('Location: index.php');
}
}
Remember to add something like:
if(file_exists('tmp/halt')) exit('Unable to complete request at this time');
at the start of your app execution so as to stop users entering
data that can cause all kinds of living nightmares when it comes
to patching the data together.
--
Copyright 2006-2008 Andrew Rose [rose.andrew@gmail.com] [andrewrose.co.uk]