<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>[ themattreid ] &#187; Replication</title>
	<atom:link href="http://themattreid.com/wordpress/category/replication/feed/" rel="self" type="application/rss+xml" />
	<link>http://themattreid.com/wordpress</link>
	<description>MySQL DBA &#124; Linux&#039;er</description>
	<lastBuildDate>Sat, 07 Jan 2012 00:22:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A common replication error</title>
		<link>http://themattreid.com/wordpress/2009/01/28/a-common-replication-error/</link>
		<comments>http://themattreid.com/wordpress/2009/01/28/a-common-replication-error/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 16:54:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Replication]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[slave errors]]></category>

		<guid isPermaLink="false">http://themattreid.com/wordpress/?p=97</guid>
		<description><![CDATA[<p>I&#8217;ll keep this short. Let&#8217;s say you run &#8220;mysqlshow slave status\G&#8221; and you see the following error:<br />
<code><br />
Last_Error: Error 'Unknown or incorrect time zone: 'Etc/UTC'' on query. Default database: 'db_name'. Query: 'INSERT INTO table SET column = CONVERT_TZ('2009-01-24', '-8:00', '+00:00')'<br />
</code><br />
It&#8217;s a simple fix. Exit out of MySQL and run the following command &#8211; this works on Redhat, I&#8217;ve not tried it on other flavors.<br />
<code><br />
shellmysql_tzinfo_to_sql /usr/share/zoneinfo&#124;mysql -u root -p<br />
</code><br />
Log back into &#8230; <a href="http://themattreid.com/wordpress/2009/01/28/a-common-replication-error/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll keep this short. Let&#8217;s say you run &#8220;mysql> show slave status\G&#8221; and you see the following error:<br />
<code><br />
Last_Error: Error 'Unknown or incorrect time zone: 'Etc/UTC'' on query. Default database: 'db_name'. Query: 'INSERT INTO table SET column = CONVERT_TZ('2009-01-24', '-8:00', '+00:00')'<br />
</code><br />
It&#8217;s a simple fix. Exit out of MySQL and run the following command &#8211; this works on Redhat, I&#8217;ve not tried it on other flavors.<br />
<code><br />
shell> mysql_tzinfo_to_sql /usr/share/zoneinfo|mysql -u root -p<br />
</code><br />
Log back into MySQL and run the following.<br />
<code><br />
mysql> stop slave;<br />
mysql> start slave;<br />
mysql> show slave status\G;<br />
</code><br />
The error should be gone and the slave should be catching up to the master now. Problem solved. </p>
]]></content:encoded>
			<wfw:commentRss>http://themattreid.com/wordpress/2009/01/28/a-common-replication-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For the love of god please use the following on high traffic servers</title>
		<link>http://themattreid.com/wordpress/2008/02/20/for-the-love-of-god-please-use-the-following-on-high-traffic-servers/</link>
		<comments>http://themattreid.com/wordpress/2008/02/20/for-the-love-of-god-please-use-the-following-on-high-traffic-servers/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 00:20:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://themattreid.com/wordpress/?p=45</guid>
		<description><![CDATA[<p>Let&#8217;s begin by assuming you have a server that runs MySQL and lots and lots of traffic flows through it everyday, let&#8217;s say&#8230; something like 50% of the size of the partition that the mysql binary logs are written to is on, then we will assume the binary log is turned on. Then we assume that expire_logs_days is not set.</p>
<p>What happens? Nagios/etc alerts that the partition is reaching a usage threshold because &#8211; low &#8230; <a href="http://themattreid.com/wordpress/2008/02/20/for-the-love-of-god-please-use-the-following-on-high-traffic-servers/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s begin by assuming you have a server that runs MySQL and lots and lots of traffic flows through it everyday, let&#8217;s say&#8230; something like 50% of the size of the partition that the mysql binary logs are written to is on, then we will assume the binary log is turned on. Then we assume that expire_logs_days is not set.</p>
<p>What happens? Nagios/etc alerts that the partition is reaching a usage threshold because &#8211; low and behold the binary logs are filling up the partition. Tuning this variable is also important. It may need to be set to as low as 1 day, in which case I would say we need a bigger partition for binary logs, but setting it so low can cause replication problems if the slave(s) gets behind more than 1 day &#8211; god help us if it does &#8211; then those binary logs that the slave is reading are no longer available, and rebuilding replication will be next on the task list. (or using maatkit)</p>
<p>While I&#8217;m at it here are some good ones for relieving tension. By no means is this a full list but some things on the top of my head at the moment.</p>
<p><code><br />
expire_logs_days = x<br />
myisam_recover<br />
skip_bdb<br />
sql_mode = NO_AUTO_CREATE_USER<br />
max_binlog_size = x<br />
long_query_time = x<br />
log_slow_queries<br />
log_warnings<br />
transaction-isolation=REPEATABLE-READ (or SERIALIZABLE)<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://themattreid.com/wordpress/2008/02/20/for-the-love-of-god-please-use-the-following-on-high-traffic-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LOAD INFILE &#8211; temporary file creation on slave servers</title>
		<link>http://themattreid.com/wordpress/2008/01/25/load-infile-temporary-file-creation-on-slave-servers/</link>
		<comments>http://themattreid.com/wordpress/2008/01/25/load-infile-temporary-file-creation-on-slave-servers/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 18:20:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://themattreid.com/wordpress/?p=30</guid>
		<description><![CDATA[<p>Had a customer issue come through right before I left for the day. Hadn&#8217;t seen this happen before and google was not too helpful.</p>
<p><strong>Problem:</strong> We had the tmp-dir set as /var/tmp which was on it&#8217;s own partition of 5GB. This is a relatively small database of about 15GB. Customer has some replication slaves setup and was running a LOAD DATA INFILE on the master. File was about 12GB, so the slave creates a SQL-DATA-1024-512.data &#8230; <a href="http://themattreid.com/wordpress/2008/01/25/load-infile-temporary-file-creation-on-slave-servers/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>Had a customer issue come through right before I left for the day. Hadn&#8217;t seen this happen before and google was not too helpful.</p>
<p><strong>Problem:</strong> We had the tmp-dir set as /var/tmp which was on it&#8217;s own partition of 5GB. This is a relatively small database of about 15GB. Customer has some replication slaves setup and was running a LOAD DATA INFILE on the master. File was about 12GB, so the slave creates a SQL-DATA-1024-512.data file in the tmp directory to buffer that INFILE command coming from the master. Well, eventually that filled up the /var/tmp partition.</p>
<p><strong>Solution</strong>: stop the server, change the tmp-dir=/bigger-partition, move the file to the new tmp location, restart cluster, all good.</p>
<p><strong>Prevention</strong>: Make sure your tmp-dir setting is on a large enough partition to hold your temporary files, and make sure if you&#8217;re going to load a data file on the master that&#8217;s bigger than your slave tmp-dir that it will halt the Slave_SQL_thread once the partition fills up and you&#8217;ll have a headache on your hands.</p>
]]></content:encoded>
			<wfw:commentRss>http://themattreid.com/wordpress/2008/01/25/load-infile-temporary-file-creation-on-slave-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

