GANALIA+PHP+NGINX+RRD monitoring Hadoop

Source: Internet
Author: User
Tags mcrypt rrd rrdtool

Two days to organize the Hadoop+ganalia monitoring system.

Virtual Machines 3 CentOS 6.5

192.168.24.192 H1 Namenode Gmond

192.168.24.190 H2 Datanode ganalia monitoring Ganalia-web Gmetad Gmond

192.168.24.189 H2 Datanode Gmond


Software download

confuse-2.7 http://www.nongnu.org/confuse/

Http://sourceforge.net/projects/ganglia/files/?source=navbar



Gmond

Yum install gcc Apr apr-devel libconfuse libconfuse-devel expat-devel pcre pcre-devel-y

If you need to install Gmetad

Yum Install RRDtool rrdtool-devel-y

If you need to install Gweb

Yum Install Rsync-y


Since the Libconfuse library cannot be installed with Yum,

TAR–XZVF confuse-2.7.tar.gz

CD./confuse-2.7

./configure Cflags=-fpic-disable-nls

Make

Make install


Install ganglia (all nodes are to be installed)

TAR-XZVF ganglia-3.7.2.tar.gz

CD ganglia-3.7.2

./configure--prefix=/usr/local/ganglia--with-gmetad--enable-gexec--with-python=/usr/local--with-librrd=/usr/ Bin

Make

Make install



Gmetad Configuration (Master node configuration)

Enter the ganglia installation file

CD ganglia-3.6.0

CP./gmetad/gmetad.init/etc/init.d/gmetad

Chkconfig--add Gmetad

Vim/etc/init.d/gmetad

Modify the following (Find/=name ' Gmetad ' search):

Gmetad=/usr/local/ganglia/sbin/gmetad

Mkdir-p/etc/ganglia

Ln-s/usr/local/ganglia/etc/gmetad.conf/etc/ganglia/gmetad.conf




Modifying the gmetad.conf configuration file


{Each data_source consists of 3 fields "name" specifies the polling interval (seconds) host list}

Node grouping

Vim/usr/local/ganglia/etc/gmetad.conf

///////////////////////////////////////////////  #

Data_source "HADOOP_NAMENODE_H1" 10 192.168.24.192:8649

Data_source "Hadoop_datanode" 10 192.168.24.190:8650 192.168.24.189:8650

Gridname "Mygrid XF Hadoop test"

Xml_port 8651

Interactive_port 8652

Rrd_rootdir "/var/lib/ganglia/rrds"

Case_sensitive_hostnames 0

//////////////////////////////////////////////

Service Gmetad Restart (restart Gmetad)


Monitored node installation ganglia

Yum install gcc Apr apr-devel libconfuse libconfuse-devel expat-devel pcre pcre-devel-y

Libconfuse can't yum, look up there.

cd/data/tools/

TAR-AXVF ganglia-3.7.2.tar.gz

CD ganglia-3.7.2

./configure--prefix=/usr/local/ganglia--with-gmetad--enable-gexec--with-python=/usr/local--with-librrd=/usr/ Bin

Make && make install


Ganglia Configuring all Nodes

Mkdir-p/etc/ganglia

CP Gmond/gmond.init/etc/init.d/gmond

Chkconfig--add Gmond

Vim/etc/init.d/gmond

Modify the following (Find/=name ' Gmond ' search):

Gmond=/usr/local/ganglia/sbin/gmond

Node usage build configuration file

mkdir/usr/local/ganglia/etc/

./gmond/gmond-t | Tee/usr/local/ganglia/etc/gmond.conf

Ln-s/usr/local/ganglia/etc/gmond.conf/etc/ganglia/gmond.conf


Modify gmond.conf grouping, default multicast mode

Vim/etc/ganglia/gmond.conf

Send_metadata_interval = 30

Cluster {

Name = #对应gmetad中的data_source

...}

Host {

Location = "190-H2" #随意起个名字

}

Udp_send_channel {

#mcast_join = 239.2.11.71 #默认多播, the unicast I use here

Port = 8650 #注意修改对应端口 Gmetad configuration file Data_source

Host = 192.168.24.189 #单播 Gmetad configuration file Data_source

TTL = 1

}

Udp_recv_channel {

#mcast_join = 239.2.11.71

Port = 8650

#bind = 192.168.24.189 #本机ip

Retry_bind = True

# Size of the UDP buffer. If You is handling lots of metrics you really

# should bump it up to e.g. 10MB or even higher.

# buffer = 10485760

}

Tcp_accept_channel {

Port = 8650 #注意修改对应端口 Gmetad configuration file Data_source

# If you want to gzip XML output

Gzip_output = No

}

Service Gmond Restart

------------------------------------------------------------------------


------------------------------------------------------------------------


Node grouping unicast configuration, which can span network segments (multicast default configuration is available)

Ganglia configuration file requires data_source naming of the corresponding Gmetad profile

Udp_send_channel {#这段的host指向data_source命名后的配置地址即可实现单播

Host = 192.168.24.189


------------------------------------------------------------------------


Install Ganglia-web (primary node only installation)

TAR-ZXVF ganglia-web-3.5.12.tar.gz

CD ganglia-web-3.5.12/

Vim Makefile

Gdestdir =/var/www/ganglia

Apache_user = Apache # consistent with USER in/etc/php-fpm.d/www.conf

Make install

Modifying a configuration file

Mkdir-p/var/lib/ganglia/rrds

Chown Nobody:nobody/var/lib/ganglia/rrds


Install PHP

PHP5.3 XF

Yum install php-fpm Php-common php-devel php-mysqlnd php-mbstring php-mcrypt-y


PHP5.5

Yum--enablerepo=remi,remi-php55 install php-fpm php-common php-devel php-mysqlnd php-mbstring php-mcrypt

Service PHP-FPM Start



Loading nginx-1.9.7

Location ~ \.php$ {

root/var/www;

Fastcgi_pass 127.0.0.1:9000;

Fastcgi_index index.php;

Fastcgi_param script_filename $document _root$fastcgi_script_name;

Include Fastcgi_params;

}


cat/var/www/t.php

<?php

Phpinfo ();

?>


Master config file nginx.conf join include conf.d/*.conf;

Vim/usr/local/nginx/conf/conf.d/ganglia.conf

Location/ganglia {

root/var/www;

Index index.html index.htm index.php;

}



Visit http://192.168.24.190/ganglia/


This article is from the "Intelligent Future _XFICC" blog, please be sure to keep this source http://xficc.blog.51cto.com/1189288/1718580

GANALIA+PHP+NGINX+RRD monitoring Hadoop

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.