<?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: MMM (Mysql Master-Master Replication) on EC2</title>
	<atom:link href="http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/feed/" rel="self" type="application/rss+xml" />
	<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/</link>
	<description>Oren Solomianik's Blog</description>
	<lastBuildDate>Tue, 24 Apr 2012 20:08:35 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: raj@</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-18940</link>
		<dc:creator>raj@</dc:creator>
		<pubDate>Sat, 19 Mar 2011 04:58:18 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-18940</guid>
		<description>restart the mysqld deamon and issue the following commands on both the systems 
stop slave
start slave</description>
		<content:encoded><![CDATA[<p>restart the mysqld deamon and issue the following commands on both the systems<br />
stop slave<br />
start slave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pradeep</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-13880</link>
		<dc:creator>pradeep</dc:creator>
		<pubDate>Fri, 22 Oct 2010 08:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-13880</guid>
		<description>Hi! i am new in mysql and trying to establish master master replication in mysql

on first server i have added these lines to mysqld section of my.cnf(mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1)

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-bin=/var/lib/mysql/mysql-bin.log
binlog-do-db=sample1  
binlog-ignore-db=mysql            
binlog-ignore-db=information_schema
binlog-ignore-db=test2
binlog-ignore-db=sample3
binlog-ignore-db=example3
binlog-ignore-db=endpoints
binlog-ignore-db=meetme
binlog-ignore-db=test
binlog-ignore-db=sample2

server-id=1
master-host = 192.xxx.x.xxx
master-user = abc
master-password = abc_pass
master-connect-retry = 60

relay-log = /var/lib/mysql/slave-relay.log
relay-log-index = /var/lib/mysql/slave-relay-log.index

On second server i have added these lines to mysqld section of my.cnf(mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1)

server-id=2

master-host = 192.xxx.x.xxx
master-user = xyz
master-password = xyz_pass
master-connect-retry = 60

relay-log = /var/lib/mysql/slave-relay.log
relay-log-index = /var/lib/mysql/slave-relay-log.index

log-bin = /var/lib/mysql/mysql-bin.log
binlog-do-db = sample1
binlog-ignore-db=mysql
binlog-ignore-db=information_schema
binlog-ignore-db=phpmyadmin

on first server slave status is

*************************** 1. row ***************************
             Slave_IO_State: Connecting to master
                Master_Host: 192.xxx.x.xx
                Master_User: abc
                Master_Port: 3306
              Connect_Retry: 60
            Master_Log_File: mysql-bin.000001
        Read_Master_Log_Pos: 36158
             Relay_Log_File: slave-relay.000001
              Relay_Log_Pos: 98
      Relay_Master_Log_File: mysql-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: 36158
            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)

ERROR: 
No query specified

On second server slave status is

*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: 192.xxx.x.xxx
                  Master_User: xyz
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: 
          Read_Master_Log_Pos: 4
               Relay_Log_File: slave-relay.000003
                Relay_Log_Pos: 4
        Relay_Master_Log_File: 
             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: 5
          Exec_Master_Log_Pos: 0
              Relay_Log_Space: 106
              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
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1045
                Last_IO_Error: error connecting to master &#039;abc@192.xxx.x.xxx:3306&#039; - retry-time: 60  retries: 86400
               Last_SQL_Errno: 0
               Last_SQL_Error: 
1 row in set (0.00 sec)

ERROR: 
No query specified

Do&#039;nt know why Slave_IO_Running is no.

i have tried a lot to start replication but i am still unable to start replication.
i have also commented 
#bind-address           = 127.0.0.1
and
#skip-external-locking

i need your help. Please send your suggestions and solution for this problem.

Thanks in advance.

regards,
pradeep</description>
		<content:encoded><![CDATA[<p>Hi! i am new in mysql and trying to establish master master replication in mysql</p>
<p>on first server i have added these lines to mysqld section of my.cnf(mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1)</p>
<p>datadir=/var/lib/mysql<br />
socket=/var/lib/mysql/mysql.sock<br />
log-bin=/var/lib/mysql/mysql-bin.log<br />
binlog-do-db=sample1<br />
binlog-ignore-db=mysql<br />
binlog-ignore-db=information_schema<br />
binlog-ignore-db=test2<br />
binlog-ignore-db=sample3<br />
binlog-ignore-db=example3<br />
binlog-ignore-db=endpoints<br />
binlog-ignore-db=meetme<br />
binlog-ignore-db=test<br />
binlog-ignore-db=sample2</p>
<p>server-id=1<br />
master-host = 192.xxx.x.xxx<br />
master-user = abc<br />
master-password = abc_pass<br />
master-connect-retry = 60</p>
<p>relay-log = /var/lib/mysql/slave-relay.log<br />
relay-log-index = /var/lib/mysql/slave-relay-log.index</p>
<p>On second server i have added these lines to mysqld section of my.cnf(mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1)</p>
<p>server-id=2</p>
<p>master-host = 192.xxx.x.xxx<br />
master-user = xyz<br />
master-password = xyz_pass<br />
master-connect-retry = 60</p>
<p>relay-log = /var/lib/mysql/slave-relay.log<br />
relay-log-index = /var/lib/mysql/slave-relay-log.index</p>
<p>log-bin = /var/lib/mysql/mysql-bin.log<br />
binlog-do-db = sample1<br />
binlog-ignore-db=mysql<br />
binlog-ignore-db=information_schema<br />
binlog-ignore-db=phpmyadmin</p>
<p>on first server slave status is</p>
<p>*************************** 1. row ***************************<br />
             Slave_IO_State: Connecting to master<br />
                Master_Host: 192.xxx.x.xx<br />
                Master_User: abc<br />
                Master_Port: 3306<br />
              Connect_Retry: 60<br />
            Master_Log_File: mysql-bin.000001<br />
        Read_Master_Log_Pos: 36158<br />
             Relay_Log_File: slave-relay.000001<br />
              Relay_Log_Pos: 98<br />
      Relay_Master_Log_File: mysql-bin.000001<br />
           Slave_IO_Running: No<br />
          Slave_SQL_Running: Yes<br />
            Replicate_Do_DB:<br />
        Replicate_Ignore_DB:<br />
         Replicate_Do_Table:<br />
     Replicate_Ignore_Table:<br />
    Replicate_Wild_Do_Table:<br />
Replicate_Wild_Ignore_Table:<br />
                 Last_Errno: 0<br />
                 Last_Error:<br />
               Skip_Counter: 0<br />
        Exec_Master_Log_Pos: 36158<br />
            Relay_Log_Space: 98<br />
            Until_Condition: None<br />
             Until_Log_File:<br />
              Until_Log_Pos: 0<br />
         Master_SSL_Allowed: No<br />
         Master_SSL_CA_File:<br />
         Master_SSL_CA_Path:<br />
            Master_SSL_Cert:<br />
          Master_SSL_Cipher:<br />
             Master_SSL_Key:<br />
      Seconds_Behind_Master: NULL<br />
1 row in set (0.00 sec)</p>
<p>ERROR:<br />
No query specified</p>
<p>On second server slave status is</p>
<p>*************************** 1. row ***************************<br />
               Slave_IO_State: Connecting to master<br />
                  Master_Host: 192.xxx.x.xxx<br />
                  Master_User: xyz<br />
                  Master_Port: 3306<br />
                Connect_Retry: 60<br />
              Master_Log_File:<br />
          Read_Master_Log_Pos: 4<br />
               Relay_Log_File: slave-relay.000003<br />
                Relay_Log_Pos: 4<br />
        Relay_Master_Log_File:<br />
             Slave_IO_Running: No<br />
            Slave_SQL_Running: Yes<br />
              Replicate_Do_DB:<br />
          Replicate_Ignore_DB:<br />
           Replicate_Do_Table:<br />
       Replicate_Ignore_Table:<br />
      Replicate_Wild_Do_Table:<br />
  Replicate_Wild_Ignore_Table:<br />
                   Last_Errno: 0<br />
                   Last_Error:<br />
                 Skip_Counter: 5<br />
          Exec_Master_Log_Pos: 0<br />
              Relay_Log_Space: 106<br />
              Until_Condition: None<br />
               Until_Log_File:<br />
                Until_Log_Pos: 0<br />
           Master_SSL_Allowed: No<br />
           Master_SSL_CA_File:<br />
           Master_SSL_CA_Path:<br />
              Master_SSL_Cert:<br />
            Master_SSL_Cipher:<br />
               Master_SSL_Key:<br />
        Seconds_Behind_Master: NULL<br />
Master_SSL_Verify_Server_Cert: No<br />
                Last_IO_Errno: 1045<br />
                Last_IO_Error: error connecting to master &#8216;abc@192.xxx.x.xxx:3306&#8242; &#8211; retry-time: 60  retries: 86400<br />
               Last_SQL_Errno: 0<br />
               Last_SQL_Error:<br />
1 row in set (0.00 sec)</p>
<p>ERROR:<br />
No query specified</p>
<p>Do&#8217;nt know why Slave_IO_Running is no.</p>
<p>i have tried a lot to start replication but i am still unable to start replication.<br />
i have also commented<br />
#bind-address           = 127.0.0.1<br />
and<br />
#skip-external-locking</p>
<p>i need your help. Please send your suggestions and solution for this problem.</p>
<p>Thanks in advance.</p>
<p>regards,<br />
pradeep</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2010-04-13 &#171; Bloggitation</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-9450</link>
		<dc:creator>links for 2010-04-13 &#171; Bloggitation</dc:creator>
		<pubDate>Wed, 14 Apr 2010 06:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-9450</guid>
		<description>[...] MMM (Mysql Master-Master Replication) on EC2 (tags: amazon ec2 cluster database mysql sysadmin) [...]</description>
		<content:encoded><![CDATA[<p>[...] MMM (Mysql Master-Master Replication) on EC2 (tags: amazon ec2 cluster database mysql sysadmin) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimeh</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-3836</link>
		<dc:creator>jimeh</dc:creator>
		<pubDate>Wed, 30 Sep 2009 12:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-3836</guid>
		<description>Ah, that makes a lot more sense.

As a final (possibly stupid question). Master-master doesn&#039;t help you scale beyond the capabilities of a single server, but only provides a fallback if the primary server fails, correct?

Master-slave at least increases the read performance by every slave you add, but the write performance it still limited to the slowest machine on the cluster, as all writes need to propagate to each of the slaves too, right?

Please excuse my stupidity, I&#039;m new to MySQL scaling, even though I&#039;ve been tasked to handle it... lol</description>
		<content:encoded><![CDATA[<p>Ah, that makes a lot more sense.</p>
<p>As a final (possibly stupid question). Master-master doesn&#8217;t help you scale beyond the capabilities of a single server, but only provides a fallback if the primary server fails, correct?</p>
<p>Master-slave at least increases the read performance by every slave you add, but the write performance it still limited to the slowest machine on the cluster, as all writes need to propagate to each of the slaves too, right?</p>
<p>Please excuse my stupidity, I&#8217;m new to MySQL scaling, even though I&#8217;ve been tasked to handle it&#8230; lol</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oren</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-3835</link>
		<dc:creator>Oren</dc:creator>
		<pubDate>Wed, 30 Sep 2009 12:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-3835</guid>
		<description>Jim,

The data doesn&#039;t have different primary keys on each server, both masters are also slaves of each other, and at any given point only one master is the active master. A write happens once on the active master, and then replicates to the passive master.

What master-master means in this context, is actually a master-slave topology that can switch roles instantly, without having a complex slave to master promotion.</description>
		<content:encoded><![CDATA[<p>Jim,</p>
<p>The data doesn&#8217;t have different primary keys on each server, both masters are also slaves of each other, and at any given point only one master is the active master. A write happens once on the active master, and then replicates to the passive master.</p>
<p>What master-master means in this context, is actually a master-slave topology that can switch roles instantly, without having a complex slave to master promotion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimeh</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-3834</link>
		<dc:creator>jimeh</dc:creator>
		<pubDate>Wed, 30 Sep 2009 12:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-3834</guid>
		<description>Hmm, I can think of a few issues that could come from having different primary key values for the same data depending on which server you&#039;re connecting to.

And yes, you are right about the fact that you still don&#039;t have control over the IP of the load balancer, but at least the load balancer software is a lot less likely to fail as it&#039;s not doing any heavy work compared to MySQL.

I&#039;m not sure if Haproxy is capable of proxying MySQL requests. I believe its intended for HTTP traffic only. But I&#039;ve read briefly about a load balancer for MySQL called ldirector that might work.

And regarding system load for a software load balancer, I have Haproxy running on a m1.small instance on EC2 at the moment, serving around 130k users per day. Haproxy rarely goes above 1% CPU usage, even during the heaviest traffic times.

And in theory, there should be a lot less traffic going through a MySQL specific load balancer, as the http load balancer I&#039;m running at the moment is stupidly handling both dynamic and static content.</description>
		<content:encoded><![CDATA[<p>Hmm, I can think of a few issues that could come from having different primary key values for the same data depending on which server you&#8217;re connecting to.</p>
<p>And yes, you are right about the fact that you still don&#8217;t have control over the IP of the load balancer, but at least the load balancer software is a lot less likely to fail as it&#8217;s not doing any heavy work compared to MySQL.</p>
<p>I&#8217;m not sure if Haproxy is capable of proxying MySQL requests. I believe its intended for HTTP traffic only. But I&#8217;ve read briefly about a load balancer for MySQL called ldirector that might work.</p>
<p>And regarding system load for a software load balancer, I have Haproxy running on a m1.small instance on EC2 at the moment, serving around 130k users per day. Haproxy rarely goes above 1% CPU usage, even during the heaviest traffic times.</p>
<p>And in theory, there should be a lot less traffic going through a MySQL specific load balancer, as the http load balancer I&#8217;m running at the moment is stupidly handling both dynamic and static content.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oren</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-3830</link>
		<dc:creator>Oren</dc:creator>
		<pubDate>Wed, 30 Sep 2009 11:37:12 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-3830</guid>
		<description>Jim,

You are correct regarding auto increment values. You should keep them separate on each master. For example, if you have 2 masters, you should do the following:

on one of them in my.cnf:
auto_increment_increment=2
auto_increment_offset=1

and on the other:
auto_increment_increment=2
auto_increment_offset=0

This way auto increment values will not collide, one master will use even values, while the other will use odd values.

Regarding IP switching, I am not aware of any way to implement it on EC2. I tried once with OpenVPN but got stuck and never pushed to implement it. You might try some other balancing combinations for MySQL (maybe with HAProxy, LVS, etc.), but the pitfall is always this - you can&#039;t control Virtual IP addresses in the network layer on EC2. You must always fall back to name resolving, with an underlying layer that can make sure switching propagation delay is minimal (and therefore Elastic IPs are out of the question).</description>
		<content:encoded><![CDATA[<p>Jim,</p>
<p>You are correct regarding auto increment values. You should keep them separate on each master. For example, if you have 2 masters, you should do the following:</p>
<p>on one of them in my.cnf:<br />
auto_increment_increment=2<br />
auto_increment_offset=1</p>
<p>and on the other:<br />
auto_increment_increment=2<br />
auto_increment_offset=0</p>
<p>This way auto increment values will not collide, one master will use even values, while the other will use odd values.</p>
<p>Regarding IP switching, I am not aware of any way to implement it on EC2. I tried once with OpenVPN but got stuck and never pushed to implement it. You might try some other balancing combinations for MySQL (maybe with HAProxy, LVS, etc.), but the pitfall is always this &#8211; you can&#8217;t control Virtual IP addresses in the network layer on EC2. You must always fall back to name resolving, with an underlying layer that can make sure switching propagation delay is minimal (and therefore Elastic IPs are out of the question).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimeh</title>
		<link>http://orensol.com/2009/02/01/mmm-mysql-master-master-replication-on-ec2/comment-page-1/#comment-3829</link>
		<dc:creator>jimeh</dc:creator>
		<pubDate>Wed, 30 Sep 2009 11:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://orensol.com/?p=61#comment-3829</guid>
		<description>Hey, I&#039;m building a cluster on EC2, and have just gotten to the point of scaling MySQL. Master-saster replication seems interesting, and a better solution than MySQL Cluster or master-slave.

However, from what I understand, you can&#039;t keep the same auto-increment values on both masters right? Won&#039;t that cause issues when looking up rows based on an auto-incremented id column?

Also, regarding the IP switching, have you considered using a software load balancer? As in you connect to a load balancer machine that proxies all queries to the currently healthy MySQL machine. Switching should be as easy as changing the config file (doable via a script even), and then relaunching the load balancer.</description>
		<content:encoded><![CDATA[<p>Hey, I&#8217;m building a cluster on EC2, and have just gotten to the point of scaling MySQL. Master-saster replication seems interesting, and a better solution than MySQL Cluster or master-slave.</p>
<p>However, from what I understand, you can&#8217;t keep the same auto-increment values on both masters right? Won&#8217;t that cause issues when looking up rows based on an auto-incremented id column?</p>
<p>Also, regarding the IP switching, have you considered using a software load balancer? As in you connect to a load balancer machine that proxies all queries to the currently healthy MySQL machine. Switching should be as easy as changing the config file (doable via a script even), and then relaunching the load balancer.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
