Wednesday, June 30, 2010

Server Monitoring with ServerSTAT server.STATS (Clook Internet Ltd)

This is Popular and real time monitoring tool. mostly it used for webhosting server. It is alarming system too.
Server.STATS is develop by clook.net
and its very useful tool where you can add multiple servers and monitoring custom ports and server load.
Please check with this image. I have configure monitoring for some major services. e.g. Httpd-MySql-Ftp etc. you can add any ports and whatever you wants no limit. So when its stoped or some services down it showing you red signal immediately with  sound alarm/alerts.
      Also it gives you Server Load if its cross load 5.00 its become red and sound alarm. So no need to always check the page refresh, it send you sound alarm, if you attached spekers to your system.
    Its free tool, which is in php code, if someone need  i can provide you, help you for configuration.


Yo Guys,  lets monitor your server with serverstat. :)

Thursday, June 24, 2010

Check Mysql Master-Slave Replication Script.

This is Mysql Master-Slave Replication Script which is checking position of log. you can set as cron and run.

vi /usr/bin/scriptname

#! /bin/bash
#
# Will Run on LOCAL LAN ON EC2 CLUSTER

SLAVE_HOST=1.2.2.1
SLAVE_PASS=passwd
SLAVE_USER=root

MASTER_PASS=passwd
MASTER_USER=root
MASTER_HOST=1.2.4.2

master_pos=`/usr/local/mysql/bin/mysql -u$SLAVE_USER -p$SLAVE_PASS -h$SLAVE_HOST -e 'show slave status \G;' |grep -r 'Read_Master_Log_Pos' |awk '{ printf " %s ", $2 }' |xargs`


slave_pos=`/usr/local/mysql/bin/mysql -u$MASTER_USER -p$MASTER_PASS -h$MASTER_HOST -e 'show master status;' | grep mysql-bin |awk '{ printf " %s ", $2 }' |xargs`

echo $master_pos
echo $slave_pos

expr $master_pos - $slave_pos

echo $master_pos
echo $slave_pos

Tuesday, June 8, 2010

/usr/libexec/mysqld: Can't change dir to '/data/mysql/' (Errcode: 13) [Resolved]

If you want's to change mysql default data directory or apart of /var/lib/mysql and for this setting you are facing this type of issue:
========================================================================
/usr/libexec/mysqld: Can't change dir to '/data/mysql/' (Errcode: 13)
100607 16:57:44 [ERROR] Aborting

100607 16:57:44 [Note] /usr/libexec/mysqld: Shutdown complete

100607 16:57:44 mysqld ended
========================================================================
Solution.
Just Do.

mysql_install_db --user=mysql --ldata=/data/mysql
mysqld_safe --datadir=/data/mysql --user=mysql &

[root@321 mysql]# /etc/init.d/mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
[root@dh119sj mysql]#

Yo.!