Archive

Archive for January, 2010

A Shell Script to keep the Datanodes on MySQL NDB Clusters live and stable

January 7th, 2010

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.

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.

#!/bin/sh

logfile=/usr/local/mysql-cluster/restart.log

PID=`ps -eo ‘tty pid args’ | grep ‘ndbd’ | grep -v grep | tr -s ” | cut -f2 -d ”`

if [ -z "$PID" ]

then

message=`service ndbd start`

echo “`date` – NDBD started”>>$logfile

fi

Cron job that I added, (edit the file /etc/crontab and add the following line at the end)

*/10 * * * * root /path/to/the/script

This would keep the ndbclusters live for ever.

Linux, MySql NDB Clusters , ,

Password Protected WordPress blog

January 6th, 2010

A simple way to have a password protected wordpress.org blog. You may ask, if a blog is to be password protected, what is the need for it. Sometimes we may need a small office or company internal blog which may have confidential information of the company. Here you go

Add the following code to the beginning of the index.php file of the Theme you are using.

<?php
if (!is_user_logged_in()) {
auth_redirect();
}
?>

And thats it…

Web , , ,

Ubuntu 9.10 Wireless Issue Dell 1330 or BCM4312

January 1st, 2010

To solve this issue you should make sure you have installed the right driver and also you should make sure you removed all the conflicting drivers. Because if there is any conflicting drivers installed it will not allow the kernel to load the right driver.

Packages to be intalled

bcmwl-kernel-source

bcmwl-modaliases

Packages that should not be installed or removed

b43-fwcutter

linux-backports-modules-karmic

linux-backports-modules-karmic-generic

actually no backports-modules need not be installed.

Problems solved

  • detecting wireless connections, but not able to connect.
  • Wireless not working
  • wireless is enabled but doesnt work.

Linux, Ubuntu , ,