<?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>Mon, 19 Jul 2010 23:32:37 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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! -->