ganglia安装部署

展示节点

安装ganglia包

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm   (32位系统)
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm (64位系统) 
yum -y install ganglia-gmetad ganglia-gmond ganglia-web

配置gmetad (/etc/gmetad.conf)


data_source "BEE Points" 10.210.77.15:8649
data_source "hadoop test" 10.210.213.127:8649

配置gmond (/etc/gmond.conf)

cluster { 
  name = "Bee Points" 
  owner = "unspecified" 
  latlong = "unspecified" 
  url = "unspecified" 
}
udp_send_channel {
  host = 10.210.77.15
  port = 8649
}
udp_recv_channel {
  port = 8649
  family = inet4
}

启动

/etc/init.d/gmetad start
/etc/init.d/gmond start

设置自启动

chkconfig gmetad on
chkconfig gmond on

ganglia展示脚本放到apache的web目录

收集节点

安装ganglia

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm   (32位系统)
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm (64位系统)
yum -y install ganglia-gmond

配置gmond (/etc/gmond.conf)

cluster { 
  name = "Bee Points" 
  owner = "unspecified" 
  latlong = "unspecified" 
  url = "unspecified" 
}
udp_send_channel {
  host = 10.210.77.15
  port = 8649
}
udp_recv_channel {
  port = 8649
  family = inet4
}

启动gmond 设置自启动

port = 8649 /etc/init.d/gmond start
chkconfig gmond on


RPM包安装方法

文档

http://sourceforge.net/apps/trac/ganglia/wiki/ganglia-web-2#Installation

下载安装包 制作rpm包

cp ../ganglia-3.1.7.tar.gz /usr/src/redhat/SOURCES/
rpmbuild -bb ganglia.spec
cd /usr/src/redhat/RPMS/x86_64

拷贝对应安装包安装,配置同上

rpm -ivh ganglia-3.0.7-1.el5.x86_64.rpm
rpm -ivh ganglia-gmond-3.0.7-1.el5.x86_64.rpm


ganglia数据获取接口

http://180.149.134.85/get_ganglia_info.php?group=hadoop&ip=10.79.48.22&items=cpu_wio

返回数据格式:json

参数说明:group:hadoop、scribe(选填 默认scribe)

               ip:必填(要获取的被监控主机ip)

               items:选填 (要获取的具体监控项,如留空则返回该主机上的所有监控项数据)