<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to make MySQL replication reliable</title>
	<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/</link>
	<description>Stay curious!</description>
	<pubDate>Wed, 09 Jul 2008 03:14:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Jengates Blog &#187; Blog Archive &#187; links for 2007-09-18</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-13400</link>
		<author>Jengates Blog &#187; Blog Archive &#187; links for 2007-09-18</author>
		<pubDate>Tue, 18 Sep 2007 23:26:28 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-13400</guid>
		<description>[...] How to make MySQL replication reliable at Xaprb [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] How to make MySQL replication reliable at Xaprb [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to calculate table checksums in MySQL at Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-13381</link>
		<author>How to calculate table checksums in MySQL at Xaprb</author>
		<pubDate>Fri, 07 Sep 2007 19:00:23 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-13381</guid>
		<description>[...] are identical &#8212; useful to verify a slave server is in sync with its master (see my article on reliable MySQL replication for more). Fortunately, it&#8217;s easy to calculate a checksum on non-MyISAM tables with user [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] are identical &#8212; useful to verify a slave server is in sync with its master (see my article on reliable MySQL replication for more). Fortunately, it&#8217;s easy to calculate a checksum on non-MyISAM tables with user [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MySQL backups for InnoDB, as an Oracle DBA &#171; from Oracle to MySQL</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-13347</link>
		<author>MySQL backups for InnoDB, as an Oracle DBA &#171; from Oracle to MySQL</author>
		<pubDate>Wed, 29 Aug 2007 20:26:36 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-13347</guid>
		<description>[...] just found this great article from xaprb (?) on &#8220;how to make MySQL replication reliable&#8220;.  Recommended reading!  Thanks, xaprb.   Also, just found related &#8220;MySQL [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] just found this great article from xaprb (?) on &#8220;how to make MySQL replication reliable&#8220;.  Recommended reading!  Thanks, xaprb.   Also, just found related &#8220;MySQL [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-4150</link>
		<author>Xaprb</author>
		<pubDate>Sat, 17 Feb 2007 20:05:09 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-4150</guid>
		<description>&lt;p&gt;I just noticed a function in the manual that will be useful: &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_master-pos-wait" rel="nofollow"&gt;MASTER_POS_WAIT()&lt;/a&gt;.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I just noticed a function in the manual that will be useful: <a href="http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_master-pos-wait" rel="nofollow">MASTER_POS_WAIT()</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NixSYS &#187; Mysql Replication</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-4006</link>
		<author>NixSYS &#187; Mysql Replication</author>
		<pubDate>Fri, 09 Feb 2007 10:15:18 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-4006</guid>
		<description>&lt;p&gt;[...] Daha güvenilir yüksek performanslı mysql replikasyonlarını merak edenler  XAPRB &#8216;nin How to make mysql replication reliable adresinde yer verdiği yazı çok güzel. [...]&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>[&#8230;] Daha güvenilir yüksek performanslı mysql replikasyonlarını merak edenler  XAPRB &#8216;nin How to make mysql replication reliable adresinde yer verdiği yazı çok güzel. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3894</link>
		<author>Xaprb</author>
		<pubDate>Sun, 04 Feb 2007 14:40:03 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3894</guid>
		<description>&lt;p&gt;In fact there are at least two ways to make sure it would work: a) lock on the master, show master status, checksum, show slave status and make sure it's caught up to the master's position; b) show slave status and make sure it's caught up, period.&lt;/p&gt;

&lt;p&gt;I like method a) better, because then even if the slave lags a little bit, you can know a particular table is caught up.  And if necessary you can wait and check back.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>In fact there are at least two ways to make sure it would work: a) lock on the master, show master status, checksum, show slave status and make sure it&#8217;s caught up to the master&#8217;s position; b) show slave status and make sure it&#8217;s caught up, period.</p>
<p>I like method a) better, because then even if the slave lags a little bit, you can know a particular table is caught up.  And if necessary you can wait and check back.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Leith</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3891</link>
		<author>Mark Leith</author>
		<pubDate>Sun, 04 Feb 2007 14:12:50 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3891</guid>
		<description>&lt;p&gt;Indeed, if you are very close you could probably get away with it.. 

It would be great to see something like this on the Forge though, it's something that does get asked for quite often. 

I'm looking at getting this kind of procedure in to the "MySQL Netork Monitoring and Advisory Service" as well, so this can be done in the background and alerted on, hopefully in the coming versions - however something for the Community is certainly needed as well!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Indeed, if you are very close you could probably get away with it.. </p>
<p>It would be great to see something like this on the Forge though, it&#8217;s something that does get asked for quite often. </p>
<p>I&#8217;m looking at getting this kind of procedure in to the &#8220;MySQL Netork Monitoring and Advisory Service&#8221; as well, so this can be done in the background and alerted on, hopefully in the coming versions - however something for the Community is certainly needed as well!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3850</link>
		<author>Xaprb</author>
		<pubDate>Sat, 03 Feb 2007 16:11:43 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3850</guid>
		<description>&lt;p&gt;Hi Mark, thanks for writing in.  After more experience with this, I completely agree.  I have been playing with this and wrote a small script to take checksums with the method I write about a couple articles later.  It occurred to me that I don't even need to go as far as &lt;code&gt;FLUSH TABLES WITH READ LOCK&lt;/code&gt; if the slave is reasonably caught up to the master!  I can just lock each table one at a time on the master, take the checksum there, and then take it again on the slave before unlocking on the master.  In practice this is working out well at my employer.  I may see if I can get permission to release the checksumming script on MySQL Forge.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Hi Mark, thanks for writing in.  After more experience with this, I completely agree.  I have been playing with this and wrote a small script to take checksums with the method I write about a couple articles later.  It occurred to me that I don&#8217;t even need to go as far as <code>FLUSH TABLES WITH READ LOCK</code> if the slave is reasonably caught up to the master!  I can just lock each table one at a time on the master, take the checksum there, and then take it again on the slave before unlocking on the master.  In practice this is working out well at my employer.  I may see if I can get permission to release the checksumming script on MySQL Forge.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Leith</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3849</link>
		<author>Mark Leith</author>
		<pubDate>Sat, 03 Feb 2007 16:04:36 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3849</guid>
		<description>&lt;p&gt;Hi! 

Great article. I had one thing that I wanted to note, to give you a little tip. You say:&lt;/p&gt;

&lt;p&gt;"To take checksums of your master and slave, you’ll obviously have to halt the master and let the slave catch up to it. The safest way I know is to stop the master, let all slaves catch up and then stop them, re-initialize one slave directly from a filesystem snapshot of the master, start the master again, and keep all the slaves stopped — thus ensuring that you have all slaves stopped at a single point in time relative to the master. Then you can compare each of the slaves to the brand-new snapshot from the master."&lt;/p&gt;

&lt;p&gt;Actually, this all seems a little complex, you can in fact do something like:&lt;/p&gt;

&lt;pre&gt;/* On slave(s) */

STOP SLAVE;

/* On master */

FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
/* CHECKSUM or SELECT COUNT(*) on table(s) */
UNLOCK TABLES;

/* On slave(s) */

START SLAVE UNTIL MASTER_LOG_FILE = '&lt;log from master status&gt;', MASTER_LOG_POS = &lt;log pos from master status&gt;;
/* Wait for slave to run to position */
/* CHECKSUM or SELECT COUNT(*) on table(s) */
START SLAVE;&lt;/pre&gt;

&lt;p&gt;This allows you to not shutdown the master (which means you have to restart, warm caches again, etc.), and the same on the slaves as well - whilst still providing a 100% consistency check.&lt;/p&gt;

&lt;p&gt;Cheers &lt;/p&gt;

&lt;p&gt;Mark&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Hi! </p>
<p>Great article. I had one thing that I wanted to note, to give you a little tip. You say:</p>
<p>&#8220;To take checksums of your master and slave, you’ll obviously have to halt the master and let the slave catch up to it. The safest way I know is to stop the master, let all slaves catch up and then stop them, re-initialize one slave directly from a filesystem snapshot of the master, start the master again, and keep all the slaves stopped — thus ensuring that you have all slaves stopped at a single point in time relative to the master. Then you can compare each of the slaves to the brand-new snapshot from the master.&#8221;</p>
<p>Actually, this all seems a little complex, you can in fact do something like:</p>
<pre>/* On slave(s) */

STOP SLAVE;

/* On master */

FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
/* CHECKSUM or SELECT COUNT(*) on table(s) */
UNLOCK TABLES;

/* On slave(s) */

START SLAVE UNTIL MASTER_LOG_FILE = '<log from master status>&#8216;, MASTER_LOG_POS = </log><log pos from master status>;
/* Wait for slave to run to position */
/* CHECKSUM or SELECT COUNT(*) on table(s) */
START SLAVE;</log></pre>
<p>This allows you to not shutdown the master (which means you have to restart, warm caches again, etc.), and the same on the slaves as well - whilst still providing a 100% consistency check.</p>
<p>Cheers </p>
<p>Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3737</link>
		<author>Xaprb</author>
		<pubDate>Thu, 01 Feb 2007 13:53:17 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/#comment-3737</guid>
		<description>&lt;p&gt;Corey, thanks for the tip -- I see CHANGE MASTER TO deletes all relay logs and restarts.  I actually just had a case where the master had run out of disk space, and used this.  Now I know at least one case where the binlog can become corrupt on the master!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Corey, thanks for the tip &#8212; I see CHANGE MASTER TO deletes all relay logs and restarts.  I actually just had a case where the master had run out of disk space, and used this.  Now I know at least one case where the binlog can become corrupt on the master!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
