ganalia+php+nginx+rrd 监控hadoop

两天的时间整理搭建了hadoop+ganalia监控系统

虚拟机3台 centos 6.5

192.168.24.192   h1  namenode gmond

192.168.24.190   h2  datanode ganalia监控 ganalia-web gmetad gmond

192.168.24.189   h2  datanode gmond

软件下载

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

如果需安装gmetad

yum install rrdtool rrdtool-devel  -y

如果需安装gweb

yum install rsync  -y

由于libconfuse库不能用yum安装,

tar –xzvf  confuse-2.7.tar.gz

cd  ./confuse-2.7

./configure CFLAGS=-fPIC -disable-nls

make

make install

安装ganglia(全部节点都要安装)

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配置 (主节点配置)

进入ganglia安装文件

cd ganglia-3.6.0

cp ./gmetad/gmetad.init  /etc/init.d/gmetad

chkconfig --add gmetad

vim /etc/init.d/gmetad

修改如下(find / =name ‘gmetad‘搜索之):

GMETAD=/usr/local/ganglia/sbin/gmetad

mkdir -p /etc/ganglia

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

修改gmetad.conf配置文件

{每个data_source由3个字段组成 "名称" 指定轮询间隔(秒) 主机列表 }

节点分组

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 (重启gmetad)

被监控节点安装ganglia

yum install gcc apr apr-devel libconfuse libconfuse-devel expat-devel pcre pcre-devel -y

libconfuse  无法yum,看上面

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配置 所有节点

mkdir -p /etc/ganglia

cp gmond/gmond.init /etc/init.d/gmond

chkconfig --add gmond

vim /etc/init.d/gmond

修改如下(find / =name ‘gmond‘搜索之):

GMOND=/usr/local/ganglia/sbin/gmond

节点使用 生成配置文件

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

修改gmond.conf  分组,默认多播模式

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    #默认多播,我这里使用的单播

port = 8650          #注意修改对应端口 gmetad配置文件的data_source

host = 192.168.24.189    #单播  gmetad配置文件的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 are 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配置文件的data_source

# If you want to gzip XML output

gzip_output = no

}

service gmond restart

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

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

节点分组 单播配置,可跨网段(多播默认配置即可)

ganglia配置文件中需要对应gmetad配置文件的data_source命名

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

host = 192.168.24.189

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

安装ganglia-web(仅主节点安装)

tar -zxvf ganglia-web-3.5.12.tar.gz

cd ganglia-web-3.5.12/

vim Makefile

GDESTDIR = /var/www/ganglia

APACHE_USER = apache                    # 与 /etc/php-fpm.d/www.conf 中user保持一致

make install

修改配置文件

mkdir -p /var/lib/ganglia/rrds

chown nobody:nobody /var/lib/ganglia/rrds

安装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

装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();

?>

主配置文件 nginx.conf加入  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;

}

访问 http://192.168.24.190/ganglia/

时间: 2024-08-01 22:48:10

ganalia+php+nginx+rrd 监控hadoop的相关文章

Ganglia环境搭建并监控Hadoop分布式集群

简介 Ganglia可以监控分布式集群中硬件资源的使用情况,例如CPU,内存,网络等资源.通过Ganglia可以监控Hadoop集群在运行过程中对集群资源的调度,作为简单地运维参考. 环境搭建流程 1.我们先在主机master01上面搭建好Ganglia环境 2.在master01主机上解压JDK和Hadoop到安装目录.修改配置文件 3.克隆出两台主机slave01,slave02并修改主机名和IP主机名映射.做免密码登录 4.启动Ganglia和Hadoop集群.实现wordcount实例

Ganglia监控Hadoop集群的安装部署[转]

Ganglia监控Hadoop集群的安装部署 一. 安装环境 Ubuntu server 12.04 安装gmetad的机器:192.168.52.105 安装gmond的机 器:192.168.52.31,192.168.52.32,192.168.52.33,192.168.52.34,192.168.52.35,192.168.52.36,192.168.52.37,192.168.52.38,192.168.52.105 浏览监控web页面的机器:192.168.52.105 二. 介绍

Ganglia 监控Hadoop

Ganglia监控Hadoop集群的安装部署 一. 安装环境 Ubuntu server 12.04 安装gmetad的机器:192.168.52.105 安装gmond的机 器:192.168.52.31,192.168.52.32,192.168.52.33,192.168.52.34,192.168.52.35,192.168.52.36,192.168.52.37,192.168.52.38,192.168.52.105 浏览监控web页面的机器:192.168.52.105 二. 介绍

zabbix监控之nginx状态监控(一)

[本文档所介绍的内容适用于公司测试/生产环境等常见的zabbix监控应用部署] 一:相关环境准备: 1.1相关软件以及系统 系统要求:Centos 6及以上(64位) 环境要求:zabbix监控系统(服务端,客户端) 相关中间件:nginx (版本1.6.0及以上) 二:配置zabbix监控nginx 2.1修改nginx配置文件,在server区块添加nginxs状态监控配置,如下所示 location ^~ /ngx_status {                 stub_status

nginx状态监控

nginx状态监控 通过查看Nginx的并发连接,我们可以更清除的知道网站的负载情况.Nginx并发查看有两种方法(之所以这么说,是因为笔者只知道两种),一种是通过web界面,一种是通过命令,web查看要比命令查看显示的结果精确一些.下面介绍这两种查看方法 No1.通过浏览器查看 通过web界面查看时Nginx需要开启status模块,也就是安装Nginx时加上        –with-http_stub_status_module   然后配置Nginx.conf,在server点里面加入如

zabbix应用之nginx统一监控

"nginx统一监控"意思是在一台Linux服务器上集中监控所有nginx站点的status状态.我们把这个服务器叫做"nginx监控服务器",可以是装有zabbix agent的zabbix server,或是其他装agent的被监控客户端. 思路:把所有nginx站点的URL写入到"nginx监控服务器"上的一个配置文件中.增加或删除nginx监控站点只需要修改这个配置文件,利用zabbix的low-level discovery动态监控这些

Linux下编译安装nginx并且监控

一.安装Nginx 使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g++ 开发库之类的需要提前装好. 安装make: yum -y install gcc automake autoconf libtool make 安装g++: yum install gcc gcc-c++ 一般我们都需要先装pcre, zlib,前者为了重写rewrite,后者为了gzip压缩. 1.选定源码目录 可以是任何目录,本文选定的是/usr/local/src cd /usr/local

Ganglia+nagios 监控hadoop资源与报警

全篇主要依赖下面2篇文章 http://quenlang.blog.51cto.com/4813803/1571635 http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html#!comments 一 资源下载 ganglia-3.6.0.tar.gz ganglia-web-3.6.2.tar.gz nagios : http://sourceforge.net/projects/nagios/files/nagios-4.x/

Ganglia监控Hadoop集群的安装部署

Ganglia是UC Berkeley发起的一个开源实时监视项目,用于测量数以千计的节点,为云计算系统提供系统静态数据以及重要的性能度量数据.Ganglia系统基本包含以下三大部分. Gmond:Gmond运行在每台计算机上,它主要监控每台机器上收集和发送度量数据(如处理器速度.内存使用量等). Gmetad:Gmetad运行在Cluster的一台主机上,作为Web Server,或者用于与Web Server进行沟通. Ganglia Web前端:Web前端用于显示Ganglia的Metric