<?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>Andrew Morgan's MySQL Cluster Database Blog &#187; MySQL</title>
	<atom:link href="http://www.clusterdb.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clusterdb.com</link>
	<description>MySQL Cluster database &#38; MySQL Replication</description>
	<lastBuildDate>Wed, 01 Feb 2012 18:35:29 +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>What&#8217;s new in MySQL 5.6 Replication &#8211; free webinar</title>
		<link>http://www.clusterdb.com/mysql/whats-new-in-mysql-5-6-replication-free-webinar/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=whats-new-in-mysql-5-6-replication-free-webinar</link>
		<comments>http://www.clusterdb.com/mysql/whats-new-in-mysql-5-6-replication-free-webinar/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 16:51:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[MySQL 5.6]]></category>
		<category><![CDATA[MySQL Replication]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=2172</guid>
		<description><![CDATA[There will be a webinar this Wednesday where you can get the latest information on all of the great new content that has been included in the MySQL 5.6 Development Releases as well as some features that are still being developed. As always, the webinar is free but you need to register here in advance. [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_2174" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/12/Global_Transaction_IDs.png"><img class="size-medium wp-image-2174" title="Global_Transaction_IDs" src="http://www.clusterdb.com/wp-content/uploads/2011/12/Global_Transaction_IDs-300x189.png" alt="" width="300" height="189" /></a><p class="wp-caption-text">Global Transaction IDs - simplifying replication management</p></div>
<p>There will be a webinar this Wednesday where you can get the latest information on all of the great new content that has been included in the MySQL 5.6 Development Releases as well as some features that are still being developed. As always, the webinar is free but you need to <a title="MySQL 5.6 Replication Webinar - register here" href="http://www.mysql.com/news-and-events/web-seminars/display-677.html" target="_blank">register here</a> in advance. Even if you can&#8217;t attend the live event it&#8217;s worth registering so that you get sent the replay.</p>
<p>Some of the topics we&#8217;ll be discussing are:</p>
<ul>
<li>Enhanced data integrity: Global Transactions Identifiers, Crash-Safe Slaves and Replication Event Checksums;</li>
<li>High performance: Multi-Threaded Slaves, Binlog Group Commit and Optimized Row-Based Replication;</li>
<li>Improved flexibility: Time Delayed Replication, Multi-Source Replication, Binlog API and Informational Log Events</li>
</ul>
<div>The event starts on Wednesday, December 14, 2011: 09:00 Pacific time; 17:00 UK; 18:00 CET.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/whats-new-in-mysql-5-6-replication-free-webinar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL HA Solutions &#8211; webinar replay</title>
		<link>http://www.clusterdb.com/mysql/mysql-ha-solutions-webinar-replay/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-ha-solutions-webinar-replay</link>
		<comments>http://www.clusterdb.com/mysql/mysql-ha-solutions-webinar-replay/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 09:48:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[MySQL Replication]]></category>
		<category><![CDATA[Oracle Virtual Machine]]></category>
		<category><![CDATA[webinar]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=2168</guid>
		<description><![CDATA[If you were unable to attend the live webinar (or you want to go back and listen to it again) then it&#8217;s now available to view on-line here. Databases are the center of today’s web and enterprise applications, storing and protecting an organization’s most valuable assets and supporting business-critical applications. Just minutes of downtime can result [...]]]></description>
			<content:encoded><![CDATA[<p>If you were unable to attend the live webinar (or you want to go back and listen to it again) then it&#8217;s now available to <a title="MySQL HA Solutions webinar replay" href="https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&amp;eventid=371281&amp;sessionid=1&amp;key=3BD8C75311563EAB4E28858BFB8EA46E&amp;sourcepage=register" target="_blank">view on-line here</a>.</p>
<p>Databases are the center of today’s web and enterprise applications, storing and protecting an organization’s most valuable assets and supporting business-critical applications. Just minutes of downtime can result in significant lost revenue and dissatisfied customers. Ensuring database highly availability is therefore a top priority for any organization. Tune into this webcast to learn more.</p>
<p>The session discusses:</p>
<ol>
<li>Causes, effect and impact of downtime</li>
<li>Methodologies to map applications to HA solution</li>
<li>Overview of MySQL HA solutions</li>
<li>Operational best practices to ensure business continuity</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/mysql-ha-solutions-webinar-replay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting per-server threshold in MySQL Enterprise Monitor</title>
		<link>http://www.clusterdb.com/mysql/setting-per-server-threshold-in-mysql-enterprise-monitor/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-per-server-threshold-in-mysql-enterprise-monitor</link>
		<comments>http://www.clusterdb.com/mysql/setting-per-server-threshold-in-mysql-enterprise-monitor/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 08:16:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Enterprise Monitor]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=2105</guid>
		<description><![CDATA[I was speaking with a MySQL customer last week and he had a feature request for MEM. He wants different servers to have different threshold values for certain MEM advisor rules and suggests that users be allowed to override the thresholds when scheduling the rule against a server &#8211; just as you can with the [...]]]></description>
			<content:encoded><![CDATA[<p>I was speaking with a MySQL customer last week and he had a feature request for MEM. He wants different servers to have different threshold values for certain MEM advisor rules and suggests that users be allowed to override the thresholds when scheduling the rule against a server &#8211; just as you can with the refresh interval. At the moment they work around this by creating multiple duplicates of the same rule and then set different thresholds in each. This is a good feature request but in the mean-time this post explains an alternate workaround &#8211; having the rules act on thresholds that are defined within the databases of the individual serves.</p>
<h3>Step 1. Create a new threshold table in each MySQL Server</h3>
<p>The table should be created and then a row added for each rule that needs a per-server threshold:</p>
<pre style="padding-left: 30px;"><span style="color: #003366;">mysql&gt; create database clusterdb;use clusterdb;
mysql&gt; CREATE TABLE thresholds (name VARCHAR(50) NOT NULL PRIMARY KEY,
       scale_percentage INT);
mysql&gt; INSERT INTO thresholds VALUES ('connect_usage_excessive',50);</span></pre>
<p>The scale_percentage value will be used in the new MEM rule as a scaling factor for the info, warning and critical threshold levels.<br />
Note that if using MySQL Cluster then you have the option as to whether each MySQL Server in the Cluster has its own set of thresholds (create the table with the InnoDB storage engine) or if they share the same thresholds (create the table with the ndbcluster storage engine).</p>
<h3>Step 2. Add custom data collector(s)</h3>
<p>First of all, check that you have permissions to edit the custom.xml file &#8211; on Windows this will be stored in a location such as C:\Program Files\MySQL\Enterprise\Agent\share\mysql-monitor-agent\items<br />
<div id="attachment_2108" class="wp-caption alignnone" style="width: 507px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/11/custom_xml_permissions.png"><img src="http://www.clusterdb.com/wp-content/uploads/2011/11/custom_xml_permissions.png" alt="" title="custom_xml_permissions" width="497" height="579" class="size-full wp-image-2108" /></a><p class="wp-caption-text">Change permissions for custom.xml if needed</p></div><br />
For each rule that needs a variable threshold, add a new class:</p>
<pre style="padding-left: 30px;"><span style="color: #003366;">&lt;class&gt;
     &lt;namespace&gt;mysql&lt;/namespace&gt;
     &lt;classname&gt;connection_usage_excessive&lt;/classname&gt;
     &lt;query&gt;&lt;![CDATA[SELECT scale_percentage AS
         connection_usage_excessive_scale_percentage
         FROM clusterdb.thresholds
         WHERE name='connect_usage_excessive']]&gt;&lt;/query&gt;
     &lt;attributes&gt;
          &lt;default counter="false" type="INTEGER"/&gt;
     &lt;attribute name="connection_usage_excessive_scale_percentage"/&gt;
     &lt;/attributes&gt;
&lt;/class&gt;
</span></pre>
<p>This custom.xml files should be copied to every server. For this data collector to be picked up by MEM, simply restart the agent(s).</p>
<h3>Step 3. Copy and extend the rule</h3>
<p>From the &#8220;Advisors/Manage Rules&#8221; tab of the MEM browser click on the copy icon next to the rule you want to apply per-server thresholds to and then edit that rule.<br />
<div id="attachment_2107" class="wp-caption alignnone" style="width: 546px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/11/Copy_rule.png"><img src="http://www.clusterdb.com/wp-content/uploads/2011/11/Copy_rule.png" alt="" title="Copy_rule" width="536" height="278" class="size-full wp-image-2107" /></a><p class="wp-caption-text">Create a copy of the advisor rule</p></div><br />
When editing the rule, add a new variable &#8220;%threshold_scale%&#8221; which uses the new data collector you&#8217;ve just created and then in the expression apply that as a percentage to factor the threshold.<br />
<div id="attachment_2109" class="wp-caption alignnone" style="width: 610px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/11/edit_rule.png"><img src="http://www.clusterdb.com/wp-content/uploads/2011/11/edit_rule.png" alt="" title="edit_rule" width="600" class="size-full wp-image-2109" /></a><p class="wp-caption-text">Apply the threshold scaler within the rule</p></div></p>
<h3>Step 4. Schedule the rule</h3>
<p>You can now go ahead and schedule this rule against each of the servers &#8211; and the threshold will automatically be scaled appropriately for each server.<br />
<div id="attachment_2110" class="wp-caption alignnone" style="width: 610px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/11/schedule_rule.png"><img src="http://www.clusterdb.com/wp-content/uploads/2011/11/schedule_rule.png" alt="" title="schedule_rule" width="600"  class="size-full wp-image-2110" /></a><p class="wp-caption-text">Schedule new rule against each server</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/setting-per-server-threshold-in-mysql-enterprise-monitor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL with Windows Server 2008 R2 Failover Clustering</title>
		<link>http://www.clusterdb.com/mysql/mysql-with-windows-server-2008-r2-failover-clustering/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-with-windows-server-2008-r2-failover-clustering</link>
		<comments>http://www.clusterdb.com/mysql/mysql-with-windows-server-2008-r2-failover-clustering/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 12:18:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Cluster]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=1939</guid>
		<description><![CDATA[Oracle has announced support for running MySQL on Windows Server Failover Clustering (WSFC); with so many people developing and deploying MySQL on Windows, this offers a great option to add High Availability to MySQL deployments if you don&#8217;t want to go as far as deploying MySQL Cluster. This post will give a brief overview of [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1941" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/windows-2008-r2-logo1.jpg"><img class="size-medium wp-image-1941" title="windows-2008-r2-logo1" src="http://www.clusterdb.com/wp-content/uploads/2011/09/windows-2008-r2-logo1-300x204.jpg" alt="" width="300" height="204" /></a><p class="wp-caption-text">Windows Server 2008 R2 Failover Clustering</p></div>
<p>Oracle has <a href="http://www.oracle.com/us/corporate/press/485067">announced </a>support for running MySQL on Windows Server Failover Clustering (WSFC); with so many people developing and deploying MySQL on Windows, this offers a great option to add High Availability to MySQL deployments if you don&#8217;t want to go as far as deploying MySQL Cluster.</p>
<p>This post will give a brief overview of how to set things up but for all of the gory details a <a href="http://www.mysql.com/why-mysql/white-papers/mysql_wp_windows_failover_clustering.php" target="_blank">new white paper MySQL with Windows Server 2008 R2 Failover Clustering</a> is available &#8211; please give me any feedback. I will also be presenting on this at a <a href="http://www.mysql.com/news-and-events/web-seminars/display-659.html" target="_blank">free webinar</a> on Thursday 15th September (please <a href="http://www.mysql.com/news-and-events/web-seminars/display-659.html" target="_blank">register in advance</a>) as well at an Oracle OpenWorld session in San Francisco on Tuesday 4th October (Tuesday, 01:15 PM, Marriott Marquis &#8211; Golden Gate C2) &#8211; a good opportunity to get more details and get your questions answered.</p>
<p>It sometimes surprises people just how much MySQL is used on Windows, here are a few of the reasons:</p>
<ul>
<li>Lower TCO
<ul>
<li>90% savings over Microsoft SQL Server</li>
<li>If your a little skeptical about this then try it out for yourself with the <a href="http://mysql.com/tcosavings/ " target="_blank">MySQL TCO Savings Calculator</a></li>
</ul>
</li>
<li>Broad platform support
<ul>
<li>No lock-in</li>
<li>Windows, Linux, MacOS, Solaris</li>
</ul>
</li>
<li>Ease of use and administration
<ul>
<li>&lt; 5 mins to download, install &amp; configure</li>
<li>MySQL Enterprise Monitor &amp; MySQL WorkBench</li>
</ul>
</li>
<li>Reliability
<ul>
<li>24&#215;7 Uptime</li>
<li>Field Proven</li>
</ul>
</li>
<li>Performance and scalability
<ul>
<li>MySQL 5.5 delivered over 500% performance boost on Windows.</li>
</ul>
</li>
<li>Integration into Windows environment
<ul>
<li>ADO.NET, ODBC &amp; Microsoft Access Integration</li>
<li>And now, support for Windows Server Failover Clustering!</li>
</ul>
</li>
</ul>
<div>Probably the most common form of High Availability for MySQL is MySQL (asynchronous or semi-synchronous replication) and the option for the highest levels of availability is <a href="http://www.mysql.com/products/cluster/" target="_blank">MySQL Cluster</a>. We are in the process of rolling out a number of solutions that provide levels of availability somewhere in between MySQL Replication and MySQL Cluster; Oracle VM Template for MySQL Enterprise Edition was the first (<a href="http://www.clusterdb.com/mysql/new-oracle-vm-template-for-mysql-enterprise-edition/" target="_blank">overview</a>, <a href="http://www.clusterdb.com/mysql-cluster/webinar-today-delivering-scalable-and-highly-available-session-management-with-mysql-cluster/" target="_blank">webinar replay</a>, <a href="http://www.clusterdb.com/mysql/white-paper-oracle-vm-template-for-mysql-enterprise-edition/" target="_blank">white paper</a>) and WSFC is the second.</div>
<p>&nbsp;</p>
<h3>Solution Overview</h3>
<div>
<p><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_architrecture.jpg"><img class="alignright size-medium wp-image-1936" title="wfc_architrecture" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_architrecture-210x300.jpg" alt="" width="210" height="300" /></a>MySQL with Windows Failover Clustering requires at least 2 servers within the cluster together with some shared storage (for example FCAL SAN or iSCSI disks). For redundancy, 2 LANs should be used for the cluster to avoid a single point of failure and typically one would be reserved for the heartbeats between the cluster nodes.</p>
<p>The MySQL binaries and data files are stored in the shared storage and Windows Failover Clustering ensures that at most one of the cluster nodes will access those files at any point in time (hence avoiding file corruptions).</p>
<p>Clients connect to the MySQL service through a Virtual IP Address (VIP) and so in the event of failover they experience a brief loss of connection but otherwise do not need to be aware that the failover has happened other than to handle the failure of any in-flight transactions.</p>
<h3><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_network.jpg"><img class="alignright size-medium wp-image-1935" title="wfc_network" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_network-272x300.jpg" alt="" width="272" height="300" /></a>Target Configuration</h3>
<p>This post will briefly step through how to set up and use a cluster and this diagrams shows how this is mapped onto physical hardware and network addresses for the lab used later in this post. In this case, iSCSI is used for the shared storage. Note that ideally there would be an extra subnet for the heartbeat connection between ws1 and ws3.</p>
<p>This is only intended to be an overview and the steps have been simplified refer to the <a href="http://www.mysql.com/why-mysql/white-papers/mysql_wp_windows_failover_clustering.php" target="_blank">white paper</a> for more details on the steps.</p>
<h3>Prerequisites</h3>
<ul>
<li>MySQL 5.5 &amp; InnoDB must be used for the database (note that MyISAM is not crash-safe and so failover may result in a corrupt database)</li>
<li>Windows Server 2008 R2</li>
<li>Redundant network connections between nodes and storage</li>
<li>WSFC cluster validation must pass</li>
<li>iSCSI or FCAL SAN should be used for the shared storage</li>
</ul>
<h3>Step 1 Configure iSCSI in software (optional)</h3>
<div id="attachment_1934" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_iscsi.jpg"><img class="size-medium wp-image-1934" title="wfc_iscsi" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_iscsi-300x103.jpg" alt="" width="300" height="103" /></a><p class="wp-caption-text">Create 2 clustered disks</p></div>
<p>This post does not attempt to describe how to configure a highly available, secure and performant SAN but in order to implement the subsequent steps shared storage is required and so in this step we look at one way of using software to provide iSCSI targets without any iSCSI/SAN hardware (just using the server’s internal disk). This is a reasonable option to experiment with but probably not what you’d want to deploy with for a HA application. If you already have shared storage set up then you can skip this step and use that instead.</p>
<p>As part of this process you&#8217;ll create at least two virtual disks within the iSCSI target; one for the quorum file and one for the MySQL binaries and data files. The quorum file is used by Windows Failover Clustering to avoid “split-brain” behaviour.</p>
<h3>Step 2. Ensure Windows Failover Clustering is enabled</h3>
<div id="attachment_1933" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_feature.jpg"><img class="size-medium wp-image-1933" title="wfc_feature" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_feature-300x228.jpg" alt="" width="300" height="228" /></a><p class="wp-caption-text">Ensure that WSFC is enabled</p></div>
<p>To confirm that Windows Failover Clustering is installed on ws1 and ws3, open the “Features” branch in the Server Manager tool and check if “Failover Cluster Manager” is present.</p>
<p>If Failover Clustering is not installed then it is very simple to add it. Select “Features” within the Service Manager and then click on “Add Features” and then select “Failover Clustering” and then “Next”.</p>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Step 3. Install MySQL as a service on both servers</h3>
<div id="attachment_1932" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_mysql_service.jpg"><img class="size-medium wp-image-1932" title="wfc_mysql_service" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_mysql_service-300x155.jpg" alt="" width="300" height="155" /></a><p class="wp-caption-text">Install MySQL as a Windows Service</p></div>
<p>If MySQL is already installed as a service on both ws1 and ws3 then this step can be skipped.</p>
<p>The installation is very straight-forward using the <a href="http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html" target="_blank">MySQL Windows Installer</a> and selecting the default options is fine.</p>
<p>Within the MySQL installation wizard, sticking with the defaults is fine for this exercise. When you reach the configuration step, check “Create Windows Service”.</p>
<p>The installation and configuration must be performed on both ws1 and ws2, if necessary.</p>
<h3>Step 4. Migrate MySQL binaries &amp; data to shared storage</h3>
<p>If the MySQL Service is running on either ws1 or ws3 then stop it &#8211; open the Task Manager using ctrl-shift-escape, select the “Services” tab and then right-click on the MySQL service and choose “Stop Service”.</p>
<p>As the iSCSI disks were enabled on ws1 you can safely access them in order to copy across the MySQL binaries and data files to the shared disk.</p>
<h3>Step 5. Create Windows Failover Cluster</h3>
<div id="attachment_1931" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_create_cluster.jpg"><img class="size-medium wp-image-1931" title="wfc_create_cluster" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_create_cluster-300x183.jpg" alt="" width="300" height="183" /></a><p class="wp-caption-text">Create the Cluster (without MySQL)</p></div>
<p>From the Server Manager on either ws1 or ws3 navigate to “Features -&gt; Failover Cluster Manager” and then select “Validate a Configuration”. When prompted enter ws1 as one name and then ws3 as the other.</p>
<p>In the “Testing Options” select “Run all tests” and continue. If the tests report any errors then these should be fixed before continuing.</p>
<p>Now that the system has been verified, select “Create a Cluster” and provide the same server names as used in the validation step. In this example, “MySQL” is provided as the “Cluster Name” and then the wizard goes on to create the cluster.</p>
<h3>Step 6. Create Cluster of MySQL Servers within Windows Cluster</h3>
<div id="attachment_1930" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_cluster_mysql.jpg"><img class="size-medium wp-image-1930" title="wfc_cluster_mysql" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_cluster_mysql-300x263.jpg" alt="" width="300" height="263" /></a><p class="wp-caption-text">Cluster the MySQL Service</p></div>
<p>Adding the MySQL service to the new Cluster is very straight-forward. Right-click on “Services and applications” in the Server Manager tree and select “Configure a Service or Application…”. When requested by the subsequent wizard, select “Generic Service” from the list and then “MySQL” from the offered list of services. Our example name was “ClusteredMySQL”. Please choose an appropriate name for your cluster. The wizard will then offer the shared disk that has not already been established as the quorum disk for use with the Clustered service – make sure that it is selected.</p>
<p>Once the wizard finishes, it starts up the MySQL Service. Click on the “ClusteredMySQL” service branch to observe that the service is up and running. You should also make a note of the Virtual IP (VIP) assigned, in this case 192.168.2.18.</p>
<h3>Step 7. Test the cluster</h3>
<p>As described in Step 6, the VIP should be used to connect to the clustered MySQL service:</p>
<pre style="padding-left: 30px;"><span style="color: #333399;">C:\ mysql –u root –h 192.168.2.18 –P3306 –pbob</span></pre>
<p>From there create a database and populate some data.</p>
<pre style="padding-left: 30px;"><span style="color: #333399;">mysql&gt; CREATE DATABASE clusterdb;</span>
<span style="color: #333399;">mysql&gt; USE clusterdb;</span>
<span style="color: #333399;">mysql&gt; CREATE TABLE simples (id int not null primary key) ENGINE=innodb;</span>
<span style="color: #333399;">mysql&gt; INSERT INTO simples VALUES (1);</span>
<span style="color: #333399;">mysql&gt; SELECT * FROM simples;</span>
<span style="color: #333399;">+----+</span>
<span style="color: #333399;">| id |</span>
<span style="color: #333399;">+----+</span>
<span style="color: #333399;">| 1 |</span>
<span style="color: #333399;">+----+</span></pre>
<div id="attachment_1929" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_migrate_service.jpg"><img class="size-medium wp-image-1929" title="wfc_migrate_service" src="http://www.clusterdb.com/wp-content/uploads/2011/09/wfc_migrate_service-300x117.jpg" alt="" width="300" height="117" /></a><p class="wp-caption-text">Migrate MySQL Service Across Cluster</p></div>
<p>The MySQL service was initially created on ws1 but it can be forced to migrate to ws3 by right-clicking on the service and selecting “Move this service or application to another node”.</p>
<p>As the MySQL data is held in the shared storage (which has also been migrated to ws3), it is still available and can still be accessed through the existing mysql client which is connected to the VIP:</p>
<pre style="padding-left: 30px;"><span style="color: #333399;">mysql&gt; select * from simples; </span>
<span class="Apple-style-span" style="color: #333399;">ERROR 2006 (HY000): MySQL server has gone away </span>
<span class="Apple-style-span" style="color: #333399;">No connection. Trying to reconnect... </span>
<span class="Apple-style-span" style="color: #333399;">Connection id: 1 </span>
<span class="Apple-style-span" style="color: #333399;">Current database: clusterdb </span>
<span class="Apple-style-span" style="color: #333399;">+----+ </span>
<span class="Apple-style-span" style="color: #333399;">| id | </span>
<span class="Apple-style-span" style="color: #333399;">+----+ </span>
<span class="Apple-style-span" style="color: #333399;">| 1 | </span>
<span class="Apple-style-span" style="color: #333399;">+----+</span></pre>
<p>Note the error shown above – the mysql client loses the connection to the MySQL service as part of the migration and so it automatically reconnects and complete the query. Any application using MySQL with Windows Failover Cluster should also expect to have to cope with these “glitches” in the connection.</p>
<h3>Conclusion</h3>
<p>More users develop and deploy and MySQL on Windows than any other single platform. Enhancements in MySQL 5.5 increased performance by over 5x compared to previous MySQL releases. With certification for Windows Server Failover Clustering, MySQL can now be deployed to support business critical workloads demanding high availability, enabling organizations to better meet demanding service levels while also reducing TCO and eliminating single vendor lock-in.<br />
Please let me know how you get on by leaving comments on this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/mysql-with-windows-server-2008-r2-failover-clustering/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Webinar: &#8220;Oracle VM Template for MySQL Enterprise Edition&#8221; on Wednesday</title>
		<link>http://www.clusterdb.com/mysql/webinar-oracle-vm-template-for-mysql-enterprise-edition-on/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=webinar-oracle-vm-template-for-mysql-enterprise-edition-on</link>
		<comments>http://www.clusterdb.com/mysql/webinar-oracle-vm-template-for-mysql-enterprise-edition-on/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 09:37:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Oracle Virtual Machine]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=1867</guid>
		<description><![CDATA[Join us for a webinar this Wednesday (13th July) to understand more about the benefits of using the new Oracle VM Template for MySQL Enterprise Edition as well as how to get started with it. As always the webinar is free but please register here. The webinar starts at 9:00 am Pacific (5:00 pm UK, 6:00 [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1863" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/06/MySQL_OVM_HA.jpg"><img class="size-medium wp-image-1863" title="MySQL_OVM_HA" src="http://www.clusterdb.com/wp-content/uploads/2011/06/MySQL_OVM_HA-300x149.jpg" alt="" width="300" height="149" /></a><p class="wp-caption-text">HA Provided by OVM</p></div>
<p>Join us for a webinar this Wednesday (13th July) to understand more about the benefits of using the new Oracle VM Template for MySQL Enterprise Edition as well as how to get started with it. As always the webinar is free but <a href="http://www.mysql.com/news-and-events/web-seminars/display-647.html" target="_blank">please register here</a>. The webinar starts at 9:00 am Pacific (5:00 pm UK, 6:00 pm CET) and even if you can&#8217;t make that time register anyway and you&#8217;ll be sent a link to the charts and replay.</p>
<p>As a reminder, a new white paper is available that goes through some of the details &#8211; if you have time then take a look at this paper before the webinar and then get any of your questions answered. <a href="http://www.mysql.com/why-mysql/white-papers/mysql_wp_oracle-vm-template-for-mee.php">Get the white paper here</a>.</p>
<p>The official description&#8230;</p>
<p><span style="color: #333399;">Virtualization is a key technology to enable data center efficiency and provides the foundation for cloud computing. Integrating MySQL Enterprise Edition with Oracle Linux, the Oracle VM Template is the fastest, easiest and most reliable way to provision virtualized MySQL instances, enabling users to meet the explosive demand for web-based services. This webinar will demonstrate how the Oracle VM Template for MySQL Enterprise Edition ensures rapid deployment and helps eliminate configuration efforts and risks by providing a pre-installed and pre-configured virtualized software image, also taking advantage of Oracle VM’s mechanisms to deliver high availability. The webinar will cover: &#8211; An overview of the technologies packaged into the template &#8211; How to configure and deploy the template &#8211; How to use, modify and save an adapted template that supports specific application requirements By attending the webinar, you will learn how the Oracle VM Template for MySQL Enterprise Edition provides the foundation for a more agile and highly available MySQL environment. This session will be approximately 1 hour in length and will include interactive Q&amp;A throughout. Please join us for this informative webinar!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/webinar-oracle-vm-template-for-mysql-enterprise-edition-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>White Paper &#8211; Oracle VM Template for MySQL Enterprise Edition</title>
		<link>http://www.clusterdb.com/mysql/white-paper-oracle-vm-template-for-mysql-enterprise-edition/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=white-paper-oracle-vm-template-for-mysql-enterprise-edition</link>
		<comments>http://www.clusterdb.com/mysql/white-paper-oracle-vm-template-for-mysql-enterprise-edition/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 15:44:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Oracle Virtual Machine]]></category>
		<category><![CDATA[OVM]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=1861</guid>
		<description><![CDATA[A new white paper is available that steps you though the benefits and the use of the Oracle VM Template for MySQL Enterprise Edition (also see yesterday&#8217;s press announcement). Get the white paper here. As a reminder Oracle Virtual Manager provides a way to add High Availability to your MySQL deployment (this is separate from [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1863" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/06/MySQL_OVM_HA.jpg"><img src="http://www.clusterdb.com/wp-content/uploads/2011/06/MySQL_OVM_HA-300x149.jpg" alt="" title="MySQL_OVM_HA" width="300" height="149" class="size-medium wp-image-1863" /></a><p class="wp-caption-text">HA Provided by OVM</p></div>A new white paper is available that steps you though the benefits and the use of the Oracle VM Template for MySQL Enterprise Edition (also see <a href="http://www.clusterdb.com/mysql/new-oracle-vm-template-for-mysql-enterprise-edition/">yesterday&#8217;s press announcement</a>). <a href="http://www.mysql.com/why-mysql/white-papers/mysql_wp_oracle-vm-template-for-mee.php">Get the white paper here</a>.</p>
<p>As a reminder Oracle Virtual Manager provides a way to add High Availability to your MySQL deployment (this is separate from MySQL Replication and MySQL Cluster). The new OVM template provides a very convenient way to create one or more Virtual Machines that come pre-provisioned with OVM, Oracle Linux and MySQL Enterprise Edition as well as the scripts required to integrate MySQL into OVM&#8217;s HA features.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/white-paper-oracle-vm-template-for-mysql-enterprise-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New &#8211; Oracle VM Template for MySQL Enterprise Edition</title>
		<link>http://www.clusterdb.com/mysql/new-oracle-vm-template-for-mysql-enterprise-edition/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-oracle-vm-template-for-mysql-enterprise-edition</link>
		<comments>http://www.clusterdb.com/mysql/new-oracle-vm-template-for-mysql-enterprise-edition/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 16:19:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Oracle Virtual Machine]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=1848</guid>
		<description><![CDATA[Oracle today announced the release of the &#8220;Oracle VM Template for MySQL Enterprise Edition&#8221; &#8211; you can read the press-release here. There are a couple of ways to look at the benefits: Provides a simple alternate High Availability solution for MySQL (i.e. rather than MySQL Replication or MySQL Cluster &#8211; although you can still set [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1847" class="wp-caption alignright" style="width: 216px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/06/MySQL_OVM_Template.jpg"><img src="http://www.clusterdb.com/wp-content/uploads/2011/06/MySQL_OVM_Template-206x300.jpg" alt="" title="MySQL_OVM_Template" width="206" height="300" class="size-medium wp-image-1847" /></a><p class="wp-caption-text">Oracle VM Template for MySQL Enterprise Edition</p></div>Oracle today announced the release of the &#8220;Oracle VM Template for MySQL Enterprise Edition&#8221; &#8211; you can <a href="http://www.oracle.com/us/corporate/press/421994">read the press-release here</a>. </p>
<p>There are a couple of ways to look at the benefits:</p>
<ul>
<li>Provides a simple alternate High Availability solution for MySQL (i.e. rather than MySQL Replication or MySQL Cluster &#8211; although you can still set up replication to/from a MySQL Server installed this way)</li>
<li>A new, very simple way to get up and running with MySQL Enterprise &#8211; running on a complete stack that Oracle can provide support for</li>
</ul>
<p>
As the focus of this blog is normally MySQL Cluster and Replication, the HA attributes of this solution are probably those of most interest. When you <a href="https://edelivery.oracle.com/oraclevm">download </a>the template and then load it into Oracle Virtual Machine (OVM) Manager and fire it up you get the chance to flag that you want it to be run in a HA mode. What this means is that:</p>
<ul>
<li>If the hardware, virtual machine, operating system or MySQL Server fail then the OVM Manager will recreate the VM on another physical server from the OVM Server Pool</li>
<li>For routine hardware maintenance you can tell OVM Manager to migrate a running VM to another physical server</li>
</ul>
<p>
Note that the data files are actually stored on shared storage under Oracle Cluster File System 2 (OCFS2) which is how a newly instantiated replacement VM can get up and running quickly. As the original hardware (or the MySQL Server instance, OS or VM) could still fail without warning the MySQL Storage Engine must be crash-safe and so this should be used with InnoDB rather than MyISAM.
</p>
<p>The complete software line-up looks like this:</p>
<ul>
<li>Oracle Linux 5 Update 6 with the Unbreakable Enterprise Kernel</li>
<li>Oracle VM 2.2.1</li>
<li>Oracle VM Manager 2.1.5</li>
<li>Oracle Cluster File System 2 (OCFS2)</li>
<li>MySQL Database 5.5.10 (Enterprise Edition) &#8211; InnoDB</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/new-oracle-vm-template-for-mysql-enterprise-edition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dramatically Increased MySQL Cluster JOIN performance with Adaptive Query Localization</title>
		<link>http://www.clusterdb.com/mysql/dramatically-increased-mysql-cluster-join-performance-with-adaptive-query-localization/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dramatically-increased-mysql-cluster-join-performance-with-adaptive-query-localization</link>
		<comments>http://www.clusterdb.com/mysql/dramatically-increased-mysql-cluster-join-performance-with-adaptive-query-localization/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 13:04:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[Adaptive Query Localization]]></category>
		<category><![CDATA[MySQL Cluster 7.2]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=1618</guid>
		<description><![CDATA[Regular readers of this Blog or attendees at the 2010 O&#8217;Reilly MySQL Conference may recall a feature that the MySQL Cluster team were working to speed up JOINs (see Jonas&#8217;s slides from that conference here). The good news is that work has continued since then and it is now part of the new MySQL Cluster [...]]]></description>
			<content:encoded><![CDATA[<p>Regular readers of this Blog or attendees at the 2010 O&#8217;Reilly MySQL Conference may recall a feature that the MySQL Cluster team were working to speed up JOINs (<a href="http://assets.en.oreilly.com/1/event/36/MySQL%20Cluster%20and%20Pushdown-joins%20_In%20Pursuit%20of%20the%20Holy%20Grail_%20Presentation.pdf" target="_blank">see Jonas&#8217;s slides from that conference here</a>). The good news is that work has continued since then and it is now part of the new MySQL Cluster 7.2 Milestone Development Release. This post will step through where to get hold of the binaries and see the benefits for yourself. The examples I try here result in a 25x speedup just by turning the feature on &#8211; I&#8217;ve also seen a 50x speedup on other queries!</p>
<p>We&#8217;re anxious to get feedback on what benefits you see with your application&#8217;s JOINs, please respond to this post.</p>
<h3>What&#8217;s in a name?</h3>
<p>If some of this seems familiar but you don&#8217;t remember hearing the term &#8220;Adaptive Query Localization&#8221; before then you&#8217;re not going crazy &#8211; previous internal names were SPJ (Select Project Join) and Pushed-Down Joins. We just figured that Adaptive Query Localization was more descriptive.</p>
<h3>
<div id="attachment_1626" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/03/Nested-Loop-Join.jpg"><img class="size-medium wp-image-1626" title="Nested Loop Join" src="http://www.clusterdb.com/wp-content/uploads/2011/03/Nested-Loop-Join-300x155.jpg" alt="" width="300" height="155" /></a><p class="wp-caption-text">Classic Nested-Loop-Join</p></div>
<p>What does it do?</h3>
<p>Traditionally, joins have been implemented in the MySQL Server where the query was executed. This is implemented as a nested-loop join; for every row from the first part of the join, a request has to be sent to the data nodes in order to fetch the data for the next level of the join and for every row in that level&#8230;. This method can result in a lot of network messages which slows down the query (as well as wasting resources).</p>
<p>When turned on, Adaptive Query Localization results in the hard work being pushed down to the data nodes where the data is locally accessible. As a bonus, the work is divided amongst the pool of data nodes and so you get parallel execution.</p>
<h3>
<div id="attachment_1627" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/03/NDB-API.jpg"><img class="size-medium wp-image-1627" title="NDB API" src="http://www.clusterdb.com/wp-content/uploads/2011/03/NDB-API-300x188.jpg" alt="" width="300" height="188" /></a><p class="wp-caption-text">NDB API</p></div>
<p>How is it implemented?</h3>
<p>I&#8217;ll leave the real deep and dirty details to others but cover the basic concepts here. All API nodes access the data nodes using the native C++ NDB API, the MySQL Server is one example of an API node (the new <a href="http://www.clusterdb.com/mysql-cluster/scalabale-persistent-ha-nosql-memcache-storage-using-mysql-cluster" target="_blank">Memcached Cluster API</a> is another). This API has been expanded to allowed parameterised or linked queries where the input from one query is dependent on the previous one.</p>
<p>To borrow an example from an excellent <a href="http://messagepassing.blogspot.com/2011/01/low-latency-distributed-parallel-joins.html" target="_blank">post by Frazer Clement</a> on the topic, the classic way to implement a join would be&#8230;</p>
<pre style="font-size: 11px;">SQL > select t1.b, t2.c from t1,t2 where t1.pk=22 and t1.b=t2.pk;
  ndbapi > read column b from t1 where pk = 22;</pre>
<pre style="font-size: 11px;">              [round trip]</pre>
<pre style="font-size: 11px;">           (b = 15)
  ndbapi > read column c from t2 where pk = 15;</pre>
<pre style="font-size: 11px;">              [round trip]</pre>
<pre style="font-size: 11px;">           (c = 30)
           [ return b = 15, c = 30 ]</pre>
<p>Using the new functionality this can be performed with a single network round trip where the second read operation is dependent on the results of the first&#8230;</p>
<pre style="font-size: 11px;">  ndbapi > read column <strong><span style="color: #800000;">@b</span></strong>:=b from t1 where pk = 22;
           read column c from t2 where pk=<span style="color: #800000;"><strong>@b</strong></span>;</pre>
<pre style="font-size: 11px;">              [round trip]</pre>
<pre style="font-size: 11px;">           (b = 15, c = 30)
           [ return b = 15, c = 30 ]</pre>
<div id="attachment_1625" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/03/Optimised-Join.jpg"><img class="size-medium wp-image-1625" title="Optimised Join" src="http://www.clusterdb.com/wp-content/uploads/2011/03/Optimised-Join-300x157.jpg" alt="" width="300" height="157" /></a><p class="wp-caption-text">Effects of Adaptive Query Localization</p></div>
<p>Note that if your application is using the NDB API directly then you can use this same linked query functionality to speed up your queries.</p>
<h3>Where do I get it?</h3>
<p>Download the source or binaries from <a href="http://dev.mysql.com/downloads/cluster/" target="_blank">http://dev.mysql.com/downloads/cluster/</a> (select the sub-tab for the Development Milestone Release).</p>
<h3>How do I use it?</h3>
<p>The first step is to get you Cluster up and running. As the focus of this feature is to reduce the amount of network messaging, it makes sense to perform your tests on multiple machines; if you need pointers on setting Cluster up then check this post on <a title="Deploying MySQL Cluster over multiple hosts" href="http://www.clusterdb.com/mysql-cluster/deploying-mysql-cluster-over-multiple-hosts/" target="_blank">running Cluster over multiple machines</a> (or the <a title="Running MySQL Cluster over multiple Windows servers" href="http://www.clusterdb.com/mysql-cluster/running-mysql-cluster-over-multiple-servers/" target="_blank">Windows version</a>).</p>
<div id="attachment_1636" class="wp-caption alignright" style="width: 310px"><a href="http://www.clusterdb.com/wp-content/uploads/2011/03/System-Configuration.jpg"><img class="size-medium wp-image-1636" title="System Configuration" src="http://www.clusterdb.com/wp-content/uploads/2011/03/System-Configuration-300x158.jpg" alt="" width="300" height="158" /></a><p class="wp-caption-text">System Configuration</p></div>
<p>For my test, I used 2 PCs, each running Fedora 14 with Quad-Core CPU, 8 GBytes of RAM and Gigabit Ethernet connectivity. Each PC was running 2 data nodes (ndbd rather than ndbmtd) and one of the PCs was also running the management node and the MySQL Server running the queries (note that this configuration is not suitable for a HA deployment &#8211; for that run the management node on a third machine and run a MySQL Server on 192.168.1.11).</p>
<p>I&#8217;d hoped to go a step further and have the MySQL Server run on a third machine but hardware problems put paid to that &#8211; the reason that this would have been interesting is that it would have meant more of the messaging would be over the network and so would give a more realistic performance comparison (the speedup factor should have been higher). Another couple of steps that could further improve the speedup:</p>
<ol>
<li>Use multi-threaded data nodes (as more of the work is being done in the data nodes, this should help)</li>
<li>Use machines with more cores</li>
<li>Tune the configuration parameters (I&#8217;m keeping it as simple as possible here)</li>
</ol>
<p>For reference, here is the configuration file used (config.ini):</p>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #333399;"> [ndb_mgmd]</span>
<span style="color: #333399; font-size: 11px;"> hostname=192.168.1.7</span>
<span style="color: #333399; font-size: 11px;"> datadir=/home/billy/mysql/spj/my_cluster/ndb_data</span>
<span style="color: #333399; font-size: 11px;"> NodeId=1</span>

<span style="color: #333399;"> [ndbd default]</span>
<span style="color: #333399;"> noofreplicas=2</span>
<span style="color: #333399;"> DiskPageBufferMemory=4M</span>

<span style="color: #333399;"> [ndbd]</span>
<span style="color: #333399;"> hostname=192.168.1.7</span>
<span style="color: #333399;"> datadir=/home/billy/mysql/spj/my_cluster/ndb_data</span>
<span style="color: #333399;"> NodeId=3</span>

<span style="color: #333399;"> [ndbd]</span>
<span style="color: #333399;"> hostname=192.168.1.11</span>
<span style="color: #333399;"> datadir=/home/billy/mysql/spj/my_cluster/ndb_data</span>
<span style="color: #333399;"> NodeId=4</span>

<span style="color: #333399;"> [ndbd]</span>
<span style="color: #333399;"> hostname=192.168.1.7</span>
<span style="color: #333399;"> datadir=/home/billy/mysql/spj/my_cluster/ndb_data2</span>
<span style="color: #333399;"> NodeId=5</span>

<span style="color: #333399;"> [ndbd]</span>
<span style="color: #333399;"> hostname=192.168.1.11</span>
<span style="color: #333399;"> datadir=/home/billy/mysql/spj/my_cluster/ndb_data2</span>
<span style="color: #333399;"> NodeId=6</span>

<span style="color: #333399;"> [mysqld]</span>
<span style="color: #333399;"> NodeId=50</span></pre>
<p>And for the MySQL Server (my.cnf):</p>
<p style="padding-left: 30px; font-size: 11px;"><span style="color: #333399;">[mysqld]<br />
ndbcluster<br />
datadir=/home/billy/mysql/spj/my_cluster/mysqld_data</span></p>
<p>As a reminder &#8211; here is how you start up such a Cluster:</p>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #333399;">[billy@ws2 my_cluster]$ ndb_mgmd -f conf/config.ini --initial </span>
<span style="color: #333399;">  --configdir=/home/billy/mysql/spj/my_cluster/conf/</span>
<span style="color: #333399;">[billy@ws2 my_cluster]$ ndbd -c 192.168.1.7:1186</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #800000;">[billy@ws1 my_cluster]$ ndbd -c 192.168.1.7:1186</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #333399;">[billy@ws2 my_cluster]$ ndbd -c 192.168.1.7:1186</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #800000;">[billy@ws1 my_cluster]$ ndbd -c 192.168.1.7:1186</span></pre>
<pre style="padding-left: 30px; font-size: 11px;">
<div><span style="color: #333399;">[billy@ws2 my_cluster]$ ndb_mgm -e show # Wait until data nodes are running
</span><span style="color: #333399;">[billy@ws2 my_cluster]$ mysqld --defaults-file=conf/my.cnf&#038;
[billy@ws2 </span><span style="color: #333399;">my_cluster]$ mysql -h 127.0.0.1 -P 3306 -u root</span></div>
</pre>
<p>Three tables that are to be used for the queries and these are created as follows:</p>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> CREATE DATABASE clusterdb; USE clusterdb;</span>
<span style="color: #008000;">mysql> CREATE TABLE residents (id INT NOT NULL PRIMARY KEY, name VARCHAR(20),
  postcode VARCHAR(20)) ENGINE=ndb;</span>
<span style="color: #008000;">mysql> CREATE TABLE postcodes (postcode VARCHAR(20) NOT NULL PRIMARY KEY,
  town VARCHAR(20)) ENGINE=ndb;</span>
<span style="color: #008000;">mysql> CREATE TABLE towns (town VARCHAR(20) NOT NULL PRIMARY KEY,
  county VARCHAR(20)) ENGINE=ndb;</span></pre>
<p>I then added 100K rows to each of these tables; if you want to recreate this then you can <a href="http://www.clusterdb.com/adaptive_query_example_data.zip" target="_blank">download the data files here</a>.</p>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> LOAD DATA LOCAL INFILE  "/home/billy/Dropbox/LINUX/projects/SPJ/residents.csv"</span>
<span style="color: #008000;">   REPLACE INTO TABLE residents FIELDS TERMINATED BY ',' ENCLOSED BY '"';</span>
<span style="color: #008000;">mysql> LOAD DATA LOCAL INFILE  "/home/billy/Dropbox/LINUX/projects/SPJ/postcodes.csv"</span>
<span style="color: #008000;">  REPLACE INTO TABLE postcodes FIELDS TERMINATED BY ',' ENCLOSED BY '"';</span>
<span style="color: #008000;">mysql> LOAD DATA LOCAL INFILE  "/home/billy/Dropbox/LINUX/projects/SPJ/towns.csv"</span>
<span style="color: #008000;">  REPLACE INTO TABLE towns FIELDS TERMINATED BY ',' ENCLOSED BY '"'; </span></pre>
<p>Now everything is set up to actually perform our tests! First of all two queries are run with the adaptive query localization turned <strong>off</strong> i.e. this is the &#8220;before&#8221; picture:</p>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> set ndb_join_pushdown=off;</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> SELECT COUNT(*)  FROM residents,postcodes WHERE
  residents.postcode=postcodes.postcode AND postcodes.town="MAIDENHEAD";</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> | COUNT(*) |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> |    20000 |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> 1 row in set (<span style="color: #800000;"><strong>27.65 sec</strong></span>)</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> SELECT COUNT(*)  FROM residents,postcodes,towns WHERE
  residents.postcode=postcodes.postcode AND
  postcodes.town=towns.town AND towns.county="Berkshire";</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> | COUNT(*) |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> |    40001 |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> 1 row in set (<span style="color: #800000;"><strong>48.68 sec</strong></span>)</span></pre>
<p>and then the test is repeated with adaptive query localization turned on:</p>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> set ndb_join_pushdown=on;</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> SELECT COUNT(*)  FROM residents,postcodes WHERE
  residents.postcode=postcodes.postcode</span><span style="color: #008000;"> AND postcodes.town="MAIDENHEAD";</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> | COUNT(*) |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> |    20000 |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> 1 row in set (<span style="color: #800000;"><strong>1.07 sec</strong></span>)</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> SELECT COUNT(*)  FROM residents,postcodes,towns WHERE
  residents.postcode=postcodes.postcode </span><span style="color: #008000;">AND postcodes.town=towns.town
  AND towns.county="Berkshire";</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> | COUNT(*) |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> |    40001 |</span>
<span style="color: #008000;"> +----------+</span>
<span style="color: #008000;"> 1 row in set (<span style="color: #800000;"><strong>2.02 sec</strong></span>)</span></pre>
<p>For those 2 queries it represents a 25.8x and 24.1x speedup.</p>
<p>It&#8217;s important to note that not every join can currently be pushed down to the data nodes; here are the current rules (we hope to relax them overtime) for a query to be suitable:</p>
<ul>
<li>JOINed columns must have the same data type</li>
<li>Queries should not reference BLOBs</li>
<li>Explicit locking is not supported</li>
<li>Only supports fully or partially qualified primary keys or plain indexes as access method for child tables (first part of JOIN can be a full table scan)</li>
</ul>
<p>You can check whether your query is fitting these rules using EXPLAIN, for example:</p>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> set ndb_join_pushdown=on;</span></pre>
<pre style="padding-left: 30px;"><span style="color: #008000;">mysql> EXPLAIN SELECT COUNT(*)  FROM residents,postcodes WHERE residents.postcode=postcodes.postcode AND postcodes.town="MAIDENHEAD";</span>
<span style="color: #008000;">+----+-------------+-----------+--------+---------------+---------+---------+------------------------------+--------+--------------------------------------------------------------------------+</span>
<span style="color: #008000;">| id | select_type | table     | type   | possible_keys | key     | key_len | ref                          | rows   | Extra                                                                    |</span><span style="color: #008000;">
+----+-------------+-----------+--------+---------------+---------+---------+------------------------------+--------+--------------------------------------------------------------------------+</span><span style="color: #008000;">
|  1 | SIMPLE      | residents | ALL    | NULL          | NULL    | NULL    | NULL                         | 100000 | Parent of 2 pushed join@1                                                |</span><span style="color: #008000;">
|  1 | SIMPLE      | postcodes | eq_ref | PRIMARY       | PRIMARY | 22      | clusterdb.residents.postcode |      1 | Child of 'residents' in pushed join@1; Using where with pushed condition |</span><span style="color: #008000;">
+----+-------------+-----------+--------+---------------+---------+---------+------------------------------+--------+--------------------------------------------------------------------------+</span></pre>
<pre style="padding-left: 30px; font-size: 11px;"><span style="color: #008000;">mysql> EXPLAIN EXTENDED SELECT COUNT(*)  FROM residents,postcodes,towns WHERE residents.postcode=postcodes.postcode AND postcodes.town=towns.town AND towns.county="Berkshire";</span><span style="color: #008000;">
+----+-------------+-----------+--------+---------------+---------+---------+------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------------+</span><span style="color: #008000;">
| id | select_type | table     | type   | possible_keys | key     | key_len | ref                          | rows   | filtered | Extra                                                                                                                  |</span><span style="color: #008000;">
+----+-------------+-----------+--------+---------------+---------+---------+------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------------+</span><span style="color: #008000;">
|  1 | SIMPLE      | residents | ALL    | NULL          | NULL    | NULL    | NULL                         | 100000 |   100.00 | Parent of 3 pushed join@1                                                                                              |</span><span style="color: #008000;">
|  1 | SIMPLE      | postcodes | eq_ref | PRIMARY       | PRIMARY | 22      | clusterdb.residents.postcode |      1 |   100.00 | Child of 'residents' in pushed join@1                                                                                  |</span><span style="color: #008000;">
|  1 | SIMPLE      | towns     | eq_ref | PRIMARY       | PRIMARY | 22      | clusterdb.postcodes.town     |      1 |   100.00 | Child of 'postcodes' in pushed join@1; Using where with pushed condition: (`clusterdb`.`towns`.`county` = 'Berkshire') |</span><span style="color: #008000;">
+----+-------------+-----------+--------+---------------+---------+---------+------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------------+</span></pre>
<p>Note that if you want to check for more details why your join isn&#8217;t currently being pushed down to the data node then you can use &#8220;<span style="color: #008000;">EXPLAIN EXTENDED</span>&#8221; and then &#8220;<span style="color: #008000;">SHOW WARNINGS</span>&#8221; to get more hints. Hopefully that will allow you to tweak your queries to get the best improvements.</p>
<p>PLEASE let us know your experiences and give us examples of queries that worked well and (just as importantly) those that didn&#8217;t so that we can improve the feature &#8211; just leave a comment on this Blog with your table schemas, your query and your before/after timings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/dramatically-increased-mysql-cluster-join-performance-with-adaptive-query-localization/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Are you using NoSQL databases?</title>
		<link>http://www.clusterdb.com/mysql/are-you-using-nosql-databases/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=are-you-using-nosql-databases</link>
		<comments>http://www.clusterdb.com/mysql/are-you-using-nosql-databases/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 17:11:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=1610</guid>
		<description><![CDATA[We&#8217;re interested in finding out what NoSQL databases you might be using (and we include MySQL Cluster in that list when using one of its NoSQL interfaces such as the NDB API or ClusterJ). To figure this out we&#8217;ve posted a quick poll on the home page of dev.mysql.com (go straight to the bottom-right corner [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re interested in finding out what NoSQL databases you might be using (and we include MySQL Cluster in that list when using one of its NoSQL interfaces such as the NDB API or ClusterJ).</p>
<p>To figure this out we&#8217;ve posted a quick poll on the home page of <a href="http://dev.mysql.com/" target="_blank">dev.mysql.com</a> (go straight to the bottom-right corner of the page) &#8211; please take 30 seconds to complete it (it shouldn&#8217;t take any longer than that) if you can. In return, you can also see the latest results from the poll.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/are-you-using-nosql-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submit your MySQL Proposals for Oracle OpenWorld 2011</title>
		<link>http://www.clusterdb.com/mysql/submit-your-mysql-proposals-for-oracle-openworld-2011/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=submit-your-mysql-proposals-for-oracle-openworld-2011</link>
		<comments>http://www.clusterdb.com/mysql/submit-your-mysql-proposals-for-oracle-openworld-2011/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 15:39:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=1543</guid>
		<description><![CDATA[Once again, MySQL gets special treatment and has a dedicated track at this year&#8217;s Oracle OpenWorld (October 2-6 in San Francisco). If you think that you&#8217;d have something interesting to present (for example if you&#8217;re using MySQL in an interesting way) then why not submit a session &#8211; the call for papers is now open! [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.clusterdb.com/wp-content/uploads/2011/03/OracleOpenWorld2011.jpg"><img class="alignright size-medium wp-image-1542" title="OracleOpenWorld2011" src="http://www.clusterdb.com/wp-content/uploads/2011/03/OracleOpenWorld2011-300x69.jpg" alt="" width="300" height="69" /></a>Once again, MySQL gets special treatment and has a dedicated track at this year&#8217;s Oracle OpenWorld (October 2-6 in San Francisco). If you think that you&#8217;d have something interesting to present (for example if you&#8217;re using MySQL in an interesting way) then why not submit a session &#8211; the <a href="https://oracleus.wingateweb.com/portal/cfp/closed.ww;jsessionid=abc15ul6YonIic6BSW35s" target="_blank">call for papers is now open</a>! Time&#8217;s a little tight to get your proposals in &#8211; the deadline is 27th March.</p>
<p>Alternatively, if you want to attend but not present then there&#8217;s <a href="http://www.oracle.com/us/openworld/registration-173440.html" target="_blank">super-save discount until 1st April &#8211; register now</a>!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clusterdb.com/mysql/submit-your-mysql-proposals-for-oracle-openworld-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

