<?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>LinuxMonk &#187; MySql NDB Clusters</title>
	<atom:link href="http://www.linuxmonk.org/category/linux/mysql-ndb-clusters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxmonk.org</link>
	<description>A Journey Towards Infinity...</description>
	<lastBuildDate>Fri, 16 Jul 2010 19:32:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A Shell Script to keep the Datanodes on MySQL NDB Clusters live and stable</title>
		<link>http://www.linuxmonk.org/2010/01/07/a-shell-script-to-keep-the-datanodes-on-mysql-ndb-clusters-live-and-stable/</link>
		<comments>http://www.linuxmonk.org/2010/01/07/a-shell-script-to-keep-the-datanodes-on-mysql-ndb-clusters-live-and-stable/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 13:40:29 +0000</pubDate>
		<dc:creator>Rosario</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySql NDB Clusters]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[NDB Clusters]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.linuxmonk.org/?p=317</guid>
		<description><![CDATA[When i installed an ndb clusters, i found sometimes one of the datanodes, fails for some reason and they never start again untill it is manually done. So i wrote a shell script for the datanodes to check itself. The script checks in the ndbd process is running, if not its starts the process and [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } -->When i installed an ndb clusters, i found sometimes one of the datanodes, fails for some reason and they never start again untill it is manually done. So i wrote a shell script  for the datanodes to check itself. The script checks in the ndbd process is running, if not its starts the process and writes a log. I added this shell script to the cron job to run the script every 10 minutes. Now the ndb clusters is perfectly stable for some months.</p>
<p>You may ask, 10 mins is too long. Does it mean, the database server will be down for 10 mins. Not beacuse there are more than 1 data node in the cluster, during this 10 mins other nodes will serve.</p>
<blockquote><p>#!/bin/sh</p>
<p>logfile=/usr/local/mysql-cluster/restart.log</p>
<p>PID=`ps -eo &#8216;tty pid args&#8217; | grep &#8216;ndbd&#8217; | grep -v grep | tr -s &#8221; | cut -f2 -d &#8221;`</p>
<p>if [ -z "$PID" ]</p>
<p>then</p>
<p>message=`service ndbd start`</p>
<p>echo &#8220;`date` &#8211; NDBD started&#8221;&gt;&gt;$logfile</p>
<p>fi</p></blockquote>
<p>Cron job that I added, (edit the file /etc/crontab and add the following line at the end)</p>
<blockquote><p>*/10 * * * * root /path/to/the/script</p></blockquote>
<p>This would keep the ndbclusters live for ever.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmonk.org/2010/01/07/a-shell-script-to-keep-the-datanodes-on-mysql-ndb-clusters-live-and-stable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
