<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Checking MySQL Replication	</title>
	<atom:link href="https://www.brandonchecketts.com/archives/checking-mysql-replication/feed" rel="self" type="application/rss+xml" />
	<link>https://www.brandonchecketts.com/archives/checking-mysql-replication</link>
	<description>Web Programming, Linux System Administation, and Entrepreneurship in Athens Georgia</description>
	<lastBuildDate>Tue, 30 Sep 2008 18:10:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>
		By: Brandon Checketts &#187; Blog Archive &#187; Fixing a Corrupt MySQL Relay Log		</title>
		<link>https://www.brandonchecketts.com/archives/checking-mysql-replication/comment-page-1#comment-1052</link>

		<dc:creator><![CDATA[Brandon Checketts &#187; Blog Archive &#187; Fixing a Corrupt MySQL Relay Log]]></dc:creator>
		<pubDate>Tue, 30 Sep 2008 18:10:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=190#comment-1052</guid>

					<description><![CDATA[[...] had to fix this several times in the past couple days. If that keeps up, I may add this fix to my Replication checking-script until I&#8217;m able to upgrade to a version of MySQL that contains this [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] had to fix this several times in the past couple days. If that keeps up, I may add this fix to my Replication checking-script until I&#8217;m able to upgrade to a version of MySQL that contains this [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Brandon		</title>
		<link>https://www.brandonchecketts.com/archives/checking-mysql-replication/comment-page-1#comment-1026</link>

		<dc:creator><![CDATA[Brandon]]></dc:creator>
		<pubDate>Thu, 14 Aug 2008 20:32:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=190#comment-1026</guid>

					<description><![CDATA[Here is the same basic script written in Perl (because I found a machine that had a completely broken PHP installation that I didn&#039;t want to troubleshoot at the time)

&lt;pre&gt;
#!/usr/bin/perl

$user = &#039;someuser&#039;;
$pass = &#039;somepassword&#039;;
$host = &#039;localhost&#039;;

$threshold = 600;

use DBI;
use Data::Dumper;

$dbh = DBI-&gt;connect(&quot;DBI:mysql:mysql&quot;, $user, $pass
                   ) &#124;&#124; die &quot;Could not connect to database: $DBI::errstr&quot;;


$sth = $dbh-&gt;prepare(&#039;SHOW SLAVE STATUS&#039;);
$sth-&gt;execute();
$result = $sth-&gt;fetchrow_hashref();

if (!$result-&gt;{&#039;Seconds_Behind_Master&#039;}) {
        print &quot;MySQL replication seems to be broken.    Here is the output of SHOW SLAVE STATUS\n&quot;;
        print Dumper($result);
}

if ($result-&gt;{&#039;Seconds_Behind_Master&#039;} &#062;= $threshold) {
        $minutes = $result-&gt;{&#039;Seconds_Behind_Master&#039;} / 60;
        printf(&quot;ERROR: MySQL Slave is %i minutes behind the master server\n&quot;, $minutes);
}


exit;
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>Here is the same basic script written in Perl (because I found a machine that had a completely broken PHP installation that I didn&#8217;t want to troubleshoot at the time)</p>
<pre>
#!/usr/bin/perl

$user = 'someuser';
$pass = 'somepassword';
$host = 'localhost';

$threshold = 600;

use DBI;
use Data::Dumper;

$dbh = DBI->connect("DBI:mysql:mysql", $user, $pass
                   ) || die "Could not connect to database: $DBI::errstr";


$sth = $dbh->prepare('SHOW SLAVE STATUS');
$sth->execute();
$result = $sth->fetchrow_hashref();

if (!$result->{'Seconds_Behind_Master'}) {
        print "MySQL replication seems to be broken.    Here is the output of SHOW SLAVE STATUS\n";
        print Dumper($result);
}

if ($result->{'Seconds_Behind_Master'} &gt;= $threshold) {
        $minutes = $result->{'Seconds_Behind_Master'} / 60;
        printf("ERROR: MySQL Slave is %i minutes behind the master server\n", $minutes);
}


exit;
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Brandon Checketts &#187; Blog Archive &#187; Compression for MySQL Replication		</title>
		<link>https://www.brandonchecketts.com/archives/checking-mysql-replication/comment-page-1#comment-985</link>

		<dc:creator><![CDATA[Brandon Checketts &#187; Blog Archive &#187; Compression for MySQL Replication]]></dc:creator>
		<pubDate>Sat, 26 Jul 2008 00:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=190#comment-985</guid>

					<description><![CDATA[[...] noticed today that the slave server was falling behind the master and had trouble keeping up. I noticed that there was a sizable amount of bandwidth between the two [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] noticed today that the slave server was falling behind the master and had trouble keeping up. I noticed that there was a sizable amount of bandwidth between the two [&#8230;]</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
