Tuesday, April 29, 2014

Percona 5.6.x Installation Error: scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory

If you get an below error while installing Percona 5.6.x  tarball file.

./scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/var/lib/mysqldata/ --user=mysql
-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory

Solution:

Install perl perl-devel

#yum install perl perl-devel

Again if you try it, you may get again an error like below,

./scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/var/lib/mysqldata/ --user=mysql
Can't locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./scripts/mysql_install_db line 42.
BEGIN failed--compilation aborted at ./scripts/mysql_install_db line 42.

Solution:

#yum install 'perl(Data::Dumper)'

Then install it.This problem because of Perl.Perl is required for installation.  -:)


Wednesday, April 9, 2014

openssl 1.0.1g heartbleed updates for Centos,Redhat and Fedora

The openssl heartbleed bug has made the rounds today here i have given how to update it to latest one from source file.




Check you openssl version

#openssl version
OpenSSL 1.0.1 14 Mar 2012  --  it is very old version

Download openssl-1.0.1g.tar.gz  from http://www.openssl.org/source/

Check gcc and glibc installed or not by,

#rpm -qa|grep gcc

#rpm -qa|grep glibc

if the both files are not  installed then install it.

now extract openssl-1.0.1g.tar.gz

cd  openssl-1.0.1g

./config

make

make install

cp /usr/bin/openssl /usr/bin/openssl.org

cp -r /usr/local/ssl/bin/openssl /usr/bin/openssl

cp -r /etc/pki/tls/openssl.cnf /etc/pki/tls/openssl.cnf.org

cp -r /usr/local/ssl/openssl.cnf /etc/pki/tls/openssl.cnf

#openssl version
OpenSSL 1.0.1g 7 Apr 2014


Now you have updated the openssl to latest one.

Saturday, April 5, 2014

Percona Plugins for Cacti MySQL Graph View Monitoring




Every DBA would like to monitor mysql server wit out any point of failure.

Here am going to explain how to monitor MySQL Server with each and every internal process by Cacti and Percona MySQL Plugins.

First install cacti in your machine.Here I have given the steps for ubuntu 12.04.

Cacti Installation :

1.Update you machine.

#apt-get update

2. Install the Apache,PHP,MySQL and its dependencies.

#apt-get install apache2  apache2-mpm-prefork apache2-utils

#apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi php php5-mysql

#apt-get install mysql-server mysql-client

3. Install snmpd

# apt-get install snmpd

edit the snmpd.conf file.

#vi /etc/snmp/snmpd.conf

#agentAddress udp:161,udp6:[::1]:161   --- remove # here

#rocommunity secret  CactiServerIpAddress   ---  remove # here and add Your cacti server public ip

restart snmpd
#service snmpd restart

4.Install cacti
# apt-get install cacti cacti-spine

here it will ask the mysql user name and password give the correct user name and password. once installation finish check in mysql there one new database name "cacti" is created or not.

5.Go to web browser

http://cacti ip address /cacti/install

Default user name password for cacti login is admin.

Once you done the installation in browser you will go to the dashboard page.

Percona Plugins installation in Cacti:

1.Download cacti percona tar.gz plugin from the below link in cacti server and in your local machine desktop.

http://www.percona.com/downloads/percona-monitoring-plugins/LATEST/

2.Extract the file percona-monitoring-plugins-1.1.3.tar.gz in both cacti server and local machine.

#tar -xvzf percona-monitoring-plugins-1.1.3.tar.gz

3.In cacti server do the following.

#cd  percona-monitoring-plugins-1.0.0/cacti/
#cp scripts/ss_get_mysql_stats.php /usr/share/cacti/site/scripts

Once you copied the php file to cacti path go to cacti dashboard in browser.




In the left side you can see import templates option click it.The you will see a new page like below.


Here browse "cacti_host_template_percona_mysql_server_ht_0.8.6i-sver1.1.1.xml" file from your local machine where you have extracted the percona plugin.

>percona-monitoring-plugins-1.1.1> cacti>templates>cacti_host_template_percona_mysql_server_ht_0.8.6i-sver1.1.1.xml

Then do import in the dashboard.It will take few minutes to import from your local machine. After imported it will show the page like below.



Percona Plugin was installed now we need to add MySQL server to monitor from cacti.

From the home page click devices.then add a new device.

Console > devices > add new device

Here give your mysql server IP and select the host templete as "Percona MySQL Server HT" option and create it,

In the next page it will show list of options to be monitor to select it.like below


once you selected the options then create it. after that it will show what are the graphs are created to monitor.


Then go to graph page and see your MySQL server current process through graph like below.



 Now you can monitor your MySQL Server for each and every process.


Note :
For host MySQL server machine. you need to add this cacti server ip in snmpd.conf

as like this,

vi /etc/snmp/snmpd.conf

rocommunity secret  CactiServerIpAddress

 Enjoy and monitor your MySQL server now!!!


References:

http://www.percona.com/doc/percona-monitoring-plugins/1.0/cacti/installing-templates.html

http://www.percona.com/doc/percona-monitoring-plugins/1.0/cacti/mysql-templates.html

https://www.digitalocean.com/community/articles/installing-the-cacti-server-monitor-on-ubuntu-12-04-cloud-server 

http://myconfigure.blogspot.in/2013/01/install-snmp-cacti-on-ubuntu-1210.html