<?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>Admins Goodies &#187; mysql-replication</title>
	<atom:link href="http://adminsgoodies.com/tag/mysql-replication/feed/" rel="self" type="application/rss+xml" />
	<link>http://adminsgoodies.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Mon, 20 May 2013 16:34:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>How to check if MySQL replication is using SSL</title>
		<link>http://adminsgoodies.com/how-to-check-if-mysql-replication-is-using-ssl/</link>
		<comments>http://adminsgoodies.com/how-to-check-if-mysql-replication-is-using-ssl/#comments</comments>
		<pubDate>Fri, 21 Dec 2012 17:36:43 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[mariadb]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-replication]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/how-to-check-if-mysql-replication-is-using-ssl/</guid>
		<description><![CDATA[I have a MySQL (actually mariaDB) install that I just started replicating to another server. I want to ensure that I&#8217;ve setup SSL correctly. The SSL portion of SHOW SLAVE STATUS looks like: Master_SSL_Allowed: Yes Master_SSL_CA_File: /etc/mysql/newcerts/ca-cert.pem Master_SSL_CA_Path: /etc/mysql/newcerts/ Master_SSL_Cert: /etc/mysql/newcerts/client-cert.pem Master_SSL_Cipher: Master_SSL_Key: /etc/mysql/newcerts/client-key.pem Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Is this typical or show that replication is using SSL? Is there something else I can check to ensure it&#8217;s using SSL? The slave is successfully replicating. [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I have a MySQL (actually mariaDB) install that I just started replicating to another server.  I want to ensure that I&#8217;ve setup SSL correctly.  The SSL portion of <code>SHOW SLAVE STATUS</code> looks like:</p>
<pre class="prettyprint"><code>Master_SSL_Allowed: Yes
Master_SSL_CA_File: /etc/mysql/newcerts/ca-cert.pem
Master_SSL_CA_Path: /etc/mysql/newcerts/
Master_SSL_Cert: /etc/mysql/newcerts/client-cert.pem
Master_SSL_Cipher:
Master_SSL_Key: /etc/mysql/newcerts/client-key.pem
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
</code></pre>
<p>Is this typical or show that replication is using SSL?  Is there something else I can check to ensure it&#8217;s using SSL?  The slave is successfully replicating.</p>
<div class="author">Asked by <a href="http://serverfault.com/users/120793/tubaguy50035" target="_blank">tubaguy50035</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>Inspect the relevant traffic with tcpdump/wireshark.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/120028/rackandboneman" target="_blank">rackandboneman</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/460044/how-to-check-if-mysql-replication-is-using-ssl" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/how-to-check-if-mysql-replication-is-using-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL master-slave lag replication</title>
		<link>http://adminsgoodies.com/mysql-master-slave-lag-replication/</link>
		<comments>http://adminsgoodies.com/mysql-master-slave-lag-replication/#comments</comments>
		<pubDate>Wed, 21 Nov 2012 17:36:16 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-replication]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/mysql-master-slave-lag-replication/</guid>
		<description><![CDATA[Our company is using TokuDB on production and we are having a lot of problems trying to mitigate lag on our slave. Is very strange, because we&#8217;re talking about very few rows&#8230; but with a few data it gets lagged. Slave is a read-only DB. For more information, we are using: CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (4 cores) RAM: 16Gb HDD: 2Tb ST2000DM001 (EXT4 filesystem) Here you can see some I/O performance outputs. [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>Our company is using <code>TokuDB</code> on production and we are having a lot of problems trying to mitigate lag on our slave. Is very strange, because we&#8217;re talking about very few rows&#8230; but with a few data it gets lagged.</p>
<p>Slave is a read-only DB.</p>
<p>For more information, we are using:</p>
<p><strong>CPU</strong>: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (4 cores)</p>
<p><strong>RAM</strong>: 16Gb</p>
<p><strong>HDD</strong>: 2Tb ST2000DM001 (EXT4 filesystem)</p>
<p>Here you can see some I/O performance outputs. I paste it outside of this post, because I think that of this way it will easier for reading.</p>
<p><code>iostat -x 1</code> output, when we have a lag situation<br />
<a href="http://paste.laravel.com/bjv" rel="nofollow">http://paste.laravel.com/bjv</a></p>
<p><code>fio</code>, for disk I/O:<br />
<a href="http://paste.laravel.com/bjG" rel="nofollow">http://paste.laravel.com/bjG</a></p>
<p>We did a few disk tweaks, extracted from Steven Corona&#8217;s book <a href="http://www.scalingphpbook.com" rel="nofollow">http://www.scalingphpbook.com</a>:</p>
<ul>
<li>Changed I/O scheduler to <code>noop</code>.</li>
<li>Turned off file system access times, <code>noatime</code> and <code>nodiratime</code> in <code>/etc/fstab</code></li>
<li>Increased the number of open files, in <code>/etc/security/limits.conf</code>:</li>
</ul>
<blockquote>
<pre><code>* soft  nofile  999999
* hard  nofile  999999
</code></pre>
</blockquote>
<p>Some tweaks we have made in config:</p>
<p>MASTER</p>
<pre><code># * Query Cache Configuration
query_cache_limit               = 0
query_cache_size                = 0
query_cache_type                = 0
innodb_file_per_table           = 1innodb_file_format              = barracuda
innodb_flush_method             = O_DIRECT
innodb_flush_log_at_trx_commit  = 1
innodb_log_file_size            = 128Minnodb_buffer_pool_size         = 13500M
innodb_read_io_threads          = 16
innodb_write_io_threads         = 16
innodb_io_capacity              = 180
innodb_thread_concurrency       = 4
</code></pre>
<p>SLAVE</p>
<pre><code># * Query Cache Configuration
query_cache_limit               = 0
query_cache_size                = 0
query_cache_type                = 0
innodb_file_per_table           = 1innodb_file_format              = barracuda
innodb_flush_method             = O_DIRECT
innodb_flush_log_at_trx_commit  = 2
sync_binlog                     = 1innodb_log_file_size            = 128M
innodb_buffer_pool_size         = 13500M
innodb_read_io_threads          = 16
innodb_write_io_threads         = 16innodb_io_capacity              = 180
innodb_thread_concurrency       = 4
</code></pre>
<div class="author">Asked by <a href="http://serverfault.com/users/125497/javiermartinez" target="_blank">JavierMartinez</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>I think this is already solved, due to @symcbean&#8217;s help.</p>
<p>I disabled barriers, set data=ordered, used async commit and checksums. Finally, we migrated to MariaDB, but still having TokuDB</p>
<p>I forget to mention that we also set <code>tokudb_cache_size = 8G</code>, as TokuDB recommends, 50% of physical memory</p>
<div class="author">Answered by <a href="http://serverfault.com/users/125497/javiermartinez" target="_blank">JavierMartinez</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/450048/mysql-master-slave-lag-replication" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/mysql-master-slave-lag-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL master-master replication between database running on 3 different server</title>
		<link>http://adminsgoodies.com/mysql-master-master-replication-between-database-running-on-3-different-server/</link>
		<comments>http://adminsgoodies.com/mysql-master-master-replication-between-database-running-on-3-different-server/#comments</comments>
		<pubDate>Tue, 20 Nov 2012 17:35:49 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[master-master]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-replication]]></category>
		<category><![CDATA[recovery]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/mysql-master-master-replication-between-database-running-on-3-different-server/</guid>
		<description><![CDATA[I am trying to implement a master-master replication between 3 MySQL Databases running on 3 different servers. I implemented master-master replication for 2 servers, but can&#8217;t figure out how can I implement if for 3 different MySQL Servers. Does anyone know how to accomplish this? Asked by Mahendra You have to set it up as a ring &#8212; A is the master for B, B is the master for C, and C is the master [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I am trying to implement a master-master replication between 3 MySQL Databases running on 3 different servers.</p>
<p>I implemented master-master replication for 2 servers, but can&#8217;t figure out how can I implement if for 3 different MySQL Servers.</p>
<p>Does anyone know how to accomplish this?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/75484/mahendra" target="_blank">Mahendra</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>You have to set it up as a ring &#8212; A is the master for B, B is the master for C, and C is the master for A. And don&#8217;t forget to set the <code>log_slave_updates</code> option so that they will pass on upstream changes, and set <code>replicate-same-server-id</code> to 0 so that the updates won&#8217;t go round and round the ring for ever.</p>
<p>Read <a href="http://onlamp.com/pub/a/onlamp/2006/04/20/advanced-mysql-replication.html" rel="nofollow">this article</a> &#8212; the ring configuration is described on page 2.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/28731/mike-scott" target="_blank">Mike Scott</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/372291/mysql-master-master-replication-between-database-running-on-3-different-server" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/mysql-master-master-replication-between-database-running-on-3-different-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replicate between mysql 5.0.xx community and enterprise edition over ssh</title>
		<link>http://adminsgoodies.com/replicate-between-mysql-5-0-xx-community-and-enterprise-edition-over-ssh/</link>
		<comments>http://adminsgoodies.com/replicate-between-mysql-5-0-xx-community-and-enterprise-edition-over-ssh/#comments</comments>
		<pubDate>Wed, 26 Sep 2012 16:33:44 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-replication]]></category>
		<category><![CDATA[mysql5]]></category>
		<category><![CDATA[ssh-tunnel]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/replicate-between-mysql-5-0-xx-community-and-enterprise-edition-over-ssh/</guid>
		<description><![CDATA[I&#8217;m trying to setup a mysql replication over an SSH tunnel. The odd thing about this setup is that I have one master with mysql 5.0.60sp1-enterprise-gpl-log and one slave with mysql 5.0.67-community-log. Could it be so that it&#8217;s not possible to replicate between community and enterprise edition? As you can see in my log below, it&#8217;s possible to login on the remote server with the mysql client. But the replication get &#8220;Can&#8217;t connect to MySQL [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I&#8217;m trying to setup a mysql replication over an SSH tunnel. The odd thing about this setup is that I have one master with mysql 5.0.60sp1-enterprise-gpl-log and one slave with mysql 5.0.67-community-log. Could it be so that it&#8217;s not possible to replicate between community and enterprise edition?</p>
<p>As you can see in my log below, it&#8217;s possible to login on the remote server with the mysql client. But the replication get &#8220;Can&#8217;t connect to MySQL server on &#8217;127.0.0.1&#8242; (13)&#8221;</p>
<p>Is it any log file I have forgotten to look in, to get more info?</p>
<pre><code>[root@mysql1-av ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 73
Server version: 5.0.67-community-log MySQL Community Edition (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
</code></pre>
<p>The version of the slave mysql</p>
<pre><code>[root@mysql1-av ~]# autossh -f -M 20001 -L 3307:10.200.200.200:3306 dali@www.ourbounceserver.com -N[root@mysql1-av ~]# mysql -h127.0.0.1 --port 3307 -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5189
Server version: 5.0.60sp1-enterprise-gpl-log MySQL Enterprise Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql&gt; Aborted
</code></pre>
<p>Login to the master mysql with the mysql client over the ssh tunnel.</p>
<pre><code>[root@mysql1-av ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.0.67-community-log MySQL Community Edition (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql&gt; change master to master_host='127.0.0.1', MASTER_PORT=3307, master_user='xxxx', master_password='xxxx', master_log_file='bin.000001';
Query OK, 0 rows affected (0.00 sec)mysql&gt; start slave;
Query OK, 0 rows affected (0.00 sec)mysql&gt; show slave status \G
*************************** 1. row ***************************
             Slave_IO_State: Connecting to master
                Master_Host: 127.0.0.1
                Master_User: replNSG
                Master_Port: 3307
              Connect_Retry: 60
            Master_Log_File: bin.000001
        Read_Master_Log_Pos: 4
             Relay_Log_File: relay.000001
              Relay_Log_Pos: 98
      Relay_Master_Log_File: bin.000001
           Slave_IO_Running: No
          Slave_SQL_Running: Yes
            Replicate_Do_DB: 
        Replicate_Ignore_DB: 
         Replicate_Do_Table: 
     Replicate_Ignore_Table: 
    Replicate_Wild_Do_Table: 
Replicate_Wild_Ignore_Table: 
                 Last_Errno: 0
                 Last_Error: 
               Skip_Counter: 0
        Exec_Master_Log_Pos: 4
            Relay_Log_Space: 98
            Until_Condition: None
             Until_Log_File: 
              Until_Log_Pos: 0
         Master_SSL_Allowed: No
         Master_SSL_CA_File: 
         Master_SSL_CA_Path: 
            Master_SSL_Cert: 
          Master_SSL_Cipher: 
             Master_SSL_Key: 
      Seconds_Behind_Master: NULL
1 row in set (0.00 sec)
</code></pre>
<p>Start the replication, but it breaks on IO.</p>
<pre><code>[root@mysql1-av ~]# tail /var/log/mysqld.log
120921 22:17:59 [Note] Slave I/O thread killed while connecting to master
120921 22:17:59 [Note] Slave I/O thread exiting, read up to log 'bin.000001', position 4
120921 22:17:59 [Note] Error reading relay log event: slave SQL thread was killed
120921 22:29:36 [Note] Slave SQL thread initialized, starting replication in log 'bin.000001' at position 4, relay log '/var/lib/mysql/relay.000001' position: 4
120921 22:29:36 [ERROR] Slave I/O thread: error connecting to master 'xxxx@127.0.0.1:3307': Error: 'Can't connect to MySQL server on '127.0.0.1' (13)'  errno: 2003  retry-time: 60  retries: 86400
</code></pre>
<p>Because it can&#8217;t connect to the master server.</p>
<div class="author">Asked by <a href="http://serverfault.com/users/64308/arlukin" target="_blank">Arlukin</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>I have now solved the problem. It&#8217;s a bug in the mysql replication command &#8220;change master&#8221; and the argument &#8220;MASTER_PORT=3307&#8243;. It doesn&#8217;t care about that argument, and always uses port 3306. </p>
<blockquote>
<p>When using a MySQL 5.0.18 slave, if the master is listening on any port other than 3306, replication fails even when master_port is set to the correct listening port on the master.</p>
</blockquote>
<p><a href="http://bugs.mysql.com/bug.php?id=17105" rel="nofollow">http://bugs.mysql.com/bug.php?id=17105</a></p>
<div class="author">Answered by <a href="http://serverfault.com/users/64308/arlukin" target="_blank">Arlukin</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/430770/replicate-between-mysql-5-0-xx-community-and-enterprise-edition-over-ssh" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/replicate-between-mysql-5-0-xx-community-and-enterprise-edition-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL replicate multiple places</title>
		<link>http://adminsgoodies.com/mysql-replicate-multiple-places/</link>
		<comments>http://adminsgoodies.com/mysql-replicate-multiple-places/#comments</comments>
		<pubDate>Mon, 24 Sep 2012 16:33:31 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[centos6]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-replication]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[windows-7]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/mysql-replicate-multiple-places/</guid>
		<description><![CDATA[Very trick task to find a good title for this question, but here goes the q: I have a few development machines, where I develop my PHP applications on, and testing via a local webserver. This works out pretty well for each machine. However, I would like to replicate the DB from my machines to a central location. So, to sum up: DEV1 -&#62; CENTRAL DEV2 -&#62; CENTRAL DEV3 -&#62; CENTRAL CENTRAL -&#62; DEV1 CENTRAL [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>Very trick task to find a good title for this question, but here goes the q:</p>
<p>I have a few development machines, where I develop my PHP applications on, and testing via a local webserver.</p>
<p>This works out pretty well for each machine. However, I would like to replicate the DB from my machines to a central location.</p>
<p>So, to sum up:</p>
<p>DEV1 -&gt; CENTRAL<br />
DEV2 -&gt; CENTRAL<br />
DEV3 -&gt; CENTRAL<br />
CENTRAL -&gt; DEV1<br />
CENTRAL -&gt; DEV2<br />
CENTRAL -&gt; DEV3  </p>
<p>I hope this makes sense, as I cannot find an easy way to tell it.</p>
<p>Basically, it is a 2-way replication, where all 4 databases contain the same info, and each of them can be updated locally, to then be pushed out to the others.</p>
<p>Is this actually doable?</p>
<p>All my dev machines are running Windows 7, and my central DB server is running CentOS 6.</p>
<div class="author">Asked by <a href="http://serverfault.com/users/125925/frederik-nielsen" target="_blank">Frederik Nielsen</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>You could go with Percona XtraDB Cluster</p>
<p>I am currently evaluating it and I think it is brilliantly designed for MultiMaster writes. It can use mysqldump (default), rsync, and xtrabackup (preferred) for initializing new Cluster node. You have total freedom and power. This may be the greatest cliche of all time but <a href="http://youtu.be/n9zo5b6QXTo" rel="nofollow">WITH GREAT POWER, THEIR MUST ALSO ALWAYS BE GREAT RESPONSIBILITY (19:16 &#8211; 19:25 of the Video)</a>.</p>
<p>I discussed this as one of many options for cross-datacenter replication in the DBA StackExchange : <a href="http://dba.stackexchange.com/questions/22788/best-solution-for-cross-datacenter-mysql-master-slave-replication/22790#22790">http://dba.stackexchange.com/questions/22788/best-solution-for-cross-datacenter-mysql-master-slave-replication/22790#22790</a></p>
<div class="author">Answered by <a href="http://serverfault.com/users/69271/rolandomysqldba" target="_blank">RolandoMySQLDBA</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/424496/mysql-replicate-multiple-places" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/mysql-replicate-multiple-places/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Percona XtraDB Cluster &#8211; Node Won&#8217;t Join</title>
		<link>http://adminsgoodies.com/percona-xtradb-cluster-node-wont-join/</link>
		<comments>http://adminsgoodies.com/percona-xtradb-cluster-node-wont-join/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 16:33:29 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[mysql-replication]]></category>
		<category><![CDATA[percona-xtradb-cluster]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/percona-xtradb-cluster-node-wont-join/</guid>
		<description><![CDATA[I am trying to add a node to a new cluster but am met with the following log entries: 120915 16:47:32 [Warning] WSREP: error executing 'SET GLOBAL innodb_disallow_writes=1': 1193 (Unknown system variable 'innodb_disallow_writes'). Was mysqld built with --with-innodb-disallow-writes ? 120915 16:47:32 [ERROR] WSREP: Failed to disallow InnoDB writes rsync: open "mysql/dummy.bak" (in rsync_sst) failed: Permission denied (13) rsync: open "test/dummy.bak" (in rsync_sst) failed: Permission denied (13) rsync error: some files/attrs were not transferred (see previous [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I am trying to add a node to a new cluster but am met with the following log entries:</p>
<pre><code>120915 16:47:32 [Warning] WSREP: error executing 'SET GLOBAL innodb_disallow_writes=1': 1193 (Unknown system variable 'innodb_disallow_writes'). Was mysqld built with --with-innodb-disallow-writes ?
120915 16:47:32 [ERROR] WSREP: Failed to disallow InnoDB writes
    rsync: open "mysql/dummy.bak" (in rsync_sst) failed: Permission denied (13)
    rsync: open "test/dummy.bak" (in rsync_sst) failed: Permission denied (13)
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
    rsync returned code 23:
120915 16:47:45 [ERROR] WSREP: Failed to read from: wsrep_sst_rsync 'donor' '10.194.110.201:4444/rsync_sst' 'wsrep_sst:wspass' '/usr/local/mysql-5.5/data/' '/etc/my.cnf' 'b334d89c-ff6c-11e1-0800-ba5125ffffff' '2' '0'
120915 16:47:45 [Warning] WSREP: error executing 'SET GLOBAL innodb_disallow_writes=0': 1193 (Unknown system variable 'innodb_disallow_writes'). Was mysqld built with --with-innodb-disallow-writes ?
120915 16:47:45 [ERROR] WSREP: Failed to disallow InnoDB writes
120915 16:47:45 [Note] WSREP: Provider resumed.
120915 16:47:45 [ERROR] WSREP: Process completed with error: wsrep_sst_rsync 'donor' '10.1.1.2:4444/rsync_sst' 'wsrep_sst:wspass' '/usr/local/mysql-5.5/data/' '/etc/my.cnf' 'b334d89c-ff6c-11e1-0800-ba5125ffffff' '2' '0': 255 (Unknown error 255)
120915 16:47:45 [Warning] WSREP: 0 (master): State transfer to 1 (slave1) failed: -1 (Operation not permitted)
</code></pre>
<p>My node1 (<code>gcomm://</code>) starts and shows 1 node in cluster. I updated node2 to point to node1, restart, and the following appears consistently, causing MySQL to crash. </p>
<p>It looks like part of the issue may be related to <code>rsync</code> failing allong with <code>Unknown error 255</code>. </p>
<p>My node1 is <code>10.1.1.1</code> and listening on <code>3306</code> and <code>4567</code> (by default).</p>
<p><strong>Update</strong>: I changed SST type to <code>mysqldump</code> and it started working. But since then, performance has been very poor:</p>
<pre><code>mysql&gt; show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ERROR:
Can't connect to the servermysql&gt; show databases;
No connection. Trying to reconnect...
Connection id:    1
Current database: *** NONE ***ERROR 1317 (70100): Query execution was interrupted
mysql&gt; show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    7
Current database: *** NONE ***+--------------------+
| Database           |
+--------------------+
| information_schema |
| Text               |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)mysql&gt;
</code></pre>
<p>Also, this is located in <code>.err</code></p>
<pre><code>19:41:41 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/key_buffer_size=33554432
read_buffer_size=2097152
max_used_connections=0
max_threads=100
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1058026 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.120919 15:42:33 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.5/data
120919 15:42:33 [Note] Flashcache bypass: disabled
120919 15:42:33 [Note] Flashcache setup error is : ioctl failed120919 15:42:33 InnoDB: The InnoDB memory heap is disabled
120919 15:42:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120919 15:42:33 InnoDB: Compressed tables use zlib 1.2.3.4
120919 15:42:33 InnoDB: Using Linux native AIO
120919 15:42:33 InnoDB: Initializing buffer pool, size = 2.0G
120919 15:42:34 InnoDB: Completed initialization of buffer pool
120919 15:42:34 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
120919 15:42:34  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
120919 15:42:34  InnoDB: Assertion failure in thread 140700858599232 in file fsp0fsp.c line 2938
InnoDB: Failing assertion: space != 0
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/usr/local/mysql-5.5/bin/mysqld(my_print_stacktrace+0x29)[0x786eb9]
/usr/local/mysql-5.5/bin/mysqld(handle_fatal_signal+0x367)[0x678597]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f97d479ecb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35)[0x7f97d3e0e445]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b)[0x7f97d3e11bab]
/usr/local/mysql-5.5/bin/mysqld[0x8b5f02]
/usr/local/mysql-5.5/bin/mysqld[0x8b63b5]
/usr/local/mysql-5.5/bin/mysqld[0x84db6f]
/usr/local/mysql-5.5/bin/mysqld[0x884f39]
/usr/local/mysql-5.5/bin/mysqld[0x8857bf]
/usr/local/mysql-5.5/bin/mysqld[0x82a9d5]
/usr/local/mysql-5.5/bin/mysqld[0x7ed3b9]
/usr/local/mysql-5.5/bin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x41)[0x67a721]
/usr/local/mysql-5.5/bin/mysqld[0x593c35]
/usr/local/mysql-5.5/bin/mysqld(_Z11plugin_initPiPPci+0x829)[0x597b69]
/usr/local/mysql-5.5/bin/mysqld[0x51a8d7]
/usr/local/mysql-5.5/bin/mysqld(_Z11mysqld_mainiPPc+0x953)[0x51f1a3]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f97d3df976d]
/usr/local/mysql-5.5/bin/mysqld[0x515e45]
You may download the Percona Server operations manual by visiting
http://www.percona.com/software/percona-server/. You may find information
in the manual which will help you identify the cause of the crash.
</code></pre>
<div class="author">Asked by <a href="http://serverfault.com/users/124174/sixeightzero" target="_blank">sixeightzero</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<blockquote>
<p><code>120915 16:47:32 [Warning] WSREP: error executing 'SET GLOBAL<br />
  innodb_disallow_writes=1': 1193 (Unknown system variable<br />
  'innodb_disallow_writes'). Was mysqld built with<br />
  --with-innodb-disallow-writes ?</code></p>
<p><code>120915 16:47:32 [ERROR] WSREP: Failed to disallow InnoDB writes</code></p>
</blockquote>
<p>Although the <a href="http://dev.mysql.com/doc/refman/5.5/en/mysqlbug.html" rel="nofollow"><code>mysqlbug</code></a> is obsolete in 5.5, it still can be used to get the compile options. Make sure that you see <code>-DWITH_INNODB_DISALLOW_WRITES</code> in the <code>Compilation info (used):</code> line:</p>
<p><code>Compilation info (used): CC='/usr/bin/gcc44'  CFLAGS='-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel28.1    -DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048 -DWITH_INNODB_DISALLOW_WRITES...</code></p>
<blockquote>
<pre><code>rsync: open "mysql/dummy.bak" (in rsync_sst) failed: Permission denied (13)
rsync: open "test/dummy.bak" (in rsync_sst) failed: Permission denied (13)
</code></pre>
</blockquote>
<p>What are permissions of these files?</p>
<blockquote>
<p><strong>Update</strong>: I changed SST type to <code>mysqldump</code> and it started working.</p>
</blockquote>
<p>Quite strange. Don&#8217;t you get <code>Unknown system variable 'innodb_disallow_writes'</code>?</p>
<blockquote>
<p>Also, this is located in <code>.err</code></p>
<pre><code>19:41:41 UTC - mysqld got signal 6 ;
This could be because you hit a bug...
</code></pre>
</blockquote>
<p>Could you please post some lines above this? Have you tried to use <code>xtrabackup</code> method?</p>
<div class="author">Answered by <a href="http://serverfault.com/users/59925/quanta" target="_blank">quanta</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/430002/percona-xtradb-cluster-node-wont-join" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/percona-xtradb-cluster-node-wont-join/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuild mysql slave from scratch</title>
		<link>http://adminsgoodies.com/rebuild-mysql-slave-from-scratch/</link>
		<comments>http://adminsgoodies.com/rebuild-mysql-slave-from-scratch/#comments</comments>
		<pubDate>Sat, 01 Sep 2012 16:33:41 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-replication]]></category>
		<category><![CDATA[mysql5]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/rebuild-mysql-slave-from-scratch/</guid>
		<description><![CDATA[I&#8217;m having a master/slave mysql setup. This night I had some problems with the master. I needed to recreate all databases again because they were corrupt. Now I stopped my mysql slave but want to start it again and rebuild everything from scratch. Is there a way to do this? Without locking the master&#8230; I also think the binlog file should be reset. So everything is clean again. Any ideas? Asked by Ward Loockx if [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I&#8217;m having a master/slave mysql setup. This night I had some problems with the master. I needed to recreate all databases again because they were corrupt.</p>
<p>Now I stopped my mysql slave but want to start it again and rebuild everything from scratch. Is there a way to do this? Without locking the master&#8230; </p>
<p>I also think the binlog file should be reset. So everything is clean again.</p>
<p>Any ideas?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/125482/ward-loockx" target="_blank">Ward Loockx</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>if you use innodb engine on the master &#8211; just use mysqldump with <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_lock-tables" rel="nofollow">&#8211;skip-lock-tables</a>, <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction" rel="nofollow">&#8211;single-transaction</a> and   <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_master-data" rel="nofollow">&#8211;master-data=2</a> switches. </p>
<p>if your slave is only logically corrupted &#8211; try <a href="http://www.percona.com/doc/percona-toolkit/2.1/pt-table-sync.html" rel="nofollow">pt-table-sync</a> with lock=0 option</p>
<div class="author">Answered by <a href="http://serverfault.com/users/2413/pqd" target="_blank">pQd</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/423497/rebuild-mysql-slave-from-scratch" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/rebuild-mysql-slave-from-scratch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL slave server from dumps</title>
		<link>http://adminsgoodies.com/mysql-slave-server-from-dumps/</link>
		<comments>http://adminsgoodies.com/mysql-slave-server-from-dumps/#comments</comments>
		<pubDate>Sat, 09 Jun 2012 16:33:34 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[mysql-replication]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/mysql-slave-server-from-dumps/</guid>
		<description><![CDATA[I&#8217;ve created a slave server from live machine which is acting as a master now. I use the following procedure to create it: mysqldump --opt -Q -B --master-data=2 --all-databases &#62; dump.sql then I imported this dump on the new machine, applied the &#8220;CHANGE MASTER TO&#8230;&#8221; directive with a log file/position from the dump. Please note that I have around 8000 databases and I didn&#8217;t stop the master while the dumps were running. The replication works [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I&#8217;ve created a slave server from live machine which is acting as a master now.<br />
I use the following procedure to create it:</p>
<pre><code>mysqldump --opt -Q -B --master-data=2 --all-databases &gt; dump.sql
</code></pre>
<ul>
<li>then I imported this dump on the new machine, applied the &#8220;CHANGE MASTER TO&#8230;&#8221; directive with a log file/position from the dump.</li>
</ul>
<p>Please note that I have around 8000 databases and I didn&#8217;t stop the master while the dumps were running.</p>
<p>The replication works fine but is this a properly method for creating a slave server? I&#8217;m planning to promote this slave to a master (different location) so I would like to make sure that there is a 100% data consistency between the servers.</p>
<p>I&#8217;ve found <a href="http://www.elevatedcode.com/articles/2008/03/02/creating-a-mysql-slave-from-a-running-master/" rel="nofollow">this</a> article where it says:</p>
<blockquote>
<p>The naive approach is just to use mysqldump to export a copy of the<br />
  master and load it on the slave server. This works if you only have<br />
  one database. With multiple database, you&#8217;ll end up with inconsistent<br />
  data. Mysqldump will dump data from each database on the server in a<br />
  different transaction. That means that your export will have data from<br />
  a different point in time for each database.</p>
</blockquote>
<p>Thank you</p>
<div class="author">Asked by <a href="http://serverfault.com/users/120102/htf" target="_blank">HTF</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>The method you&#8217;re using (specifically the <code>--master-data=2</code> option) should be enough to get you a consistent dump, since <code>--master-data</code> implies <code>--lock-all-tables</code> (and the resulting offences against database performance that are implied).  The caveats specified in the <code>mysqldump</code>(1) manpage for the <code>--lock-all-tables</code> option should be observed.</p>
<p>I would suggest that the article you cite was either written prior to the availability of <code>--lock-all-tables</code> (or it&#8217;s implicit activation with <code>--master-data</code>) or was written by someone incapable or unwilling to read documentation.  You may wish to query the author to determine which is the case.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/1375/womble" target="_blank">womble</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/397126/mysql-slave-server-from-dumps" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/mysql-slave-server-from-dumps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RDS slave (read replica) not replication</title>
		<link>http://adminsgoodies.com/rds-slave-read-replica-not-replication/</link>
		<comments>http://adminsgoodies.com/rds-slave-read-replica-not-replication/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 16:33:26 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[amazon-ec2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-replication]]></category>
		<category><![CDATA[rds]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/rds-slave-read-replica-not-replication/</guid>
		<description><![CDATA[It appears overnight our Master RDS mysql server went offline for 3-4 minutes. When it came back online the replication was broken. On the slave, issuing SHOW SLAVE STATUS\G; &#8220;Got fatal error 1236 from master when reading data from binary log: &#8216;Client requested master to start replication from impossible position&#8217;&#8221; In AWS monitoring, slave lag shows &#8220;-1.0&#8243;. Is there a way to get the slave replication restarted, or should I just create a new slave? [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>It appears overnight our Master RDS mysql server went offline for 3-4 minutes. When it came back online the replication was broken.</p>
<p>On the slave, issuing SHOW SLAVE STATUS\G;</p>
<p>&#8220;Got fatal error 1236 from master when reading data from binary log: &#8216;Client requested master to start replication from impossible position&#8217;&#8221;</p>
<p>In AWS monitoring, slave lag shows &#8220;-1.0&#8243;. </p>
<p>Is there a way to get the slave replication restarted, or should I just create a new slave?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/59465/jaredsten" target="_blank">jaredsten</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>There&#8217;s really no harm in just spooling up a new slave, so I&#8217;d go that route.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/584/ceejayoz" target="_blank">ceejayoz</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/396080/rds-slave-read-replica-not-replication" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/rds-slave-read-replica-not-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql relay log corrupted, How to recover?</title>
		<link>http://adminsgoodies.com/mysql-relay-log-corrupted-how-to-recover/</link>
		<comments>http://adminsgoodies.com/mysql-relay-log-corrupted-how-to-recover/#comments</comments>
		<pubDate>Mon, 21 May 2012 12:33:34 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[mysql-replication]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/mysql-relay-log-corrupted-how-to-recover/</guid>
		<description><![CDATA[I am running with one master and two slaves in a chain. ie Master--&#62;Primary Slave--&#62;Secondary Slave. The relay log of primary slave got corrupted. How can I recreate the relay log of primary slave without making any changes to the Primary Slave --&#62; Secondary Slave replication? Asked by arn If it&#8217;s the relay log (rather than the master bin log) which got corrupted, then STOP SLAVE (on both slaves) SHOW SLAVE STATUS on the failing [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I am running with one master and two slaves in a chain. ie </p>
<pre><code>Master--&gt;Primary Slave--&gt;Secondary Slave. 
</code></pre>
<p>The relay log of primary slave got corrupted.</p>
<p>How can I recreate the relay log of primary slave without making any changes to the <code>Primary Slave --&gt; Secondary Slave</code>  replication?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/121758/arn" target="_blank">arn</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>If it&#8217;s the relay log (rather than the master bin log) which got corrupted, then</p>
<ol>
<li>STOP SLAVE (on both slaves)</li>
<li>SHOW SLAVE STATUS on the failing machine to get the current log file and position</li>
<li>RESET SLAVE on the faling machine</li>
<li>CHANGE MASTER TO MASTER_LOG_FILE=&#8217;filename from step 2&#8242;, MASTER_LOG_POS=&#8217;position from step 2&#8242;</li>
<li>START SLAVE on both slaves</li>
</ol>
<div class="author">Answered by <a href="http://serverfault.com/users/35483/symcbean" target="_blank">symcbean</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/390985/mysql-relay-log-corrupted-how-to-recover" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/mysql-relay-log-corrupted-how-to-recover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
