标签:
一个、ganglia基本介绍
ganglia它是一个分布式监控系统,那里有两个Daemon,每间:clientGangliaMonitoring Daemon (gmond)和服务端GangliaMeta Daemon (gmetad),还有GangliaPHP Web
Frontend(基于web的动态訪问方式)组成是一个Linux下图形化监控系统执行性能的软件,界面美观、丰富,功能强大而ganglia又依赖于一个webserver用来显示集群状态,用rrdtool来存储数据和生成曲线图,须要xml解析因此须要expat。配置文件解析须要libconfuse。
Ganglia是一个监控server,集群的开源软件,可以用曲线图表现近期一个小时,近期一天,近期一周,近期一月。近期一年的server或者集群的cpu负载,内存,网络,硬盘等指标。
Ganglia的强大在于:ganglia服务端可以通过一台client收集到同一个网段的全部client的数据。ganglia集群服务端可以通过一台服务端收集到它下属的全部client数据。这个体系设计表示一台server可以通过不同的分层可以管理上万台机器。
这个功能是其它mrtg,nagios,cacti所不能比拟。
[root@ws ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
[root@ws ~]# uname -a
Linux ws.zdqy.com 2.6.32-431.5.1.el6.i686 #1 SMP Tue Feb 11 21:56:33 UTC 2014 i686 i686 i386 GNU/Linux
[root@ws tmp]# tar xf ganglia-3.6.0.tar.gz
[root@ws ~]# yum -y install apr-devel apr-util check-devel cairo-develpango-devel libxml2-devel rpm-build glib2-devel dbus-develfreetype-devel fontconfig-devel gcc gcc-c++ expat-devel python-devellibXrender-devel
[root@ws ganglia-3.6.0]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.ULcPJf: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@ws ganglia-3.6.0]# yum clean all
[root@ws ganglia-3.6.0]# yum install libconfuse* -y
Installing:
libconfuse i686 2.7-4.el6 epel 79 k
libconfuse-devel i686 2.7-4.el6 epel 17 k
[root@ws ~]# yum install libart_lgpl-devel pcre-devel libtool -y
[root@ws softs]# rpmbuild -tb ganglia-3.6.0.tar.gz
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/ganglia-3.6.0-1.i386
Wrote: /root/rpmbuild/RPMS/i386/ganglia-gmetad-3.6.0-1.i386.rpm
Wrote: /root/rpmbuild/RPMS/i386/ganglia-gmond-3.6.0-1.i386.rpm
Wrote: /root/rpmbuild/RPMS/i386/ganglia-gmond-modules-python-3.6.0-1.i386.rpm
Wrote: /root/rpmbuild/RPMS/i386/ganglia-devel-3.6.0-1.i386.rpm
Wrote: /root/rpmbuild/RPMS/i386/libganglia-3.6.0-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.zQCFRZ
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd ganglia-3.6.0
+ /bin/rm -rf /root/rpmbuild/BUILDROOT/ganglia-3.6.0-1.i386
+ exit 0
[root@ws softs]# cd /root/rpmbuild/RPMS/
[root@ws RPMS]# ls
i386
[root@ws RPMS]# cd i386/
[root@ws i386]# ls
ganglia-devel-3.6.0-1.i386.rpm
ganglia-gmetad-3.6.0-1.i386.rpm
ganglia-gmond-3.6.0-1.i386.rpm
ganglia-gmond-modules-python-3.6.0-1.i386.rpm
libganglia-3.6.0-1.i386.rpm
[root@ws i386]# rpm -ivh *
Preparing... ########################################### [100%]
1:libganglia ########################################### [ 20%]
2:ganglia-gmond ########################################### [ 40%]
3:ganglia-devel ########################################### [ 60%]
4:ganglia-gmond-modules-p ########################################### [ 80%]
5:ganglia-gmetad ########################################### [100%]
[root@ws ganglia]# yum install httpd -y
[root@ws conf]# /etc/init.d/gmond start
Starting GANGLIA gmond: [ OK ]
[root@ws conf]# /etc/init.d/gmetad start
Starting GANGLIA gmetad: [ OK ]
[root@ws softs]# wget http://ftp.jaist.ac.jp/pub/sourceforge/g/ga/ganglia/ganglia-web/3.5.12/ganglia-web-3.5.12.tar.gz
[root@ws softs]# tar xf ganglia-web-3.5.12.tar.gz -C /var/www/html/
[root@ws html]# mv ganglia-web-3.5.12.tar.gz /softs/
[root@ws html]# mv ganglia-web-3.5.12 ganglia
三、调试
訪问页面http://192.168.0.104/ganglia/index.php
发现报错
是由于对应的文件夹没有建,并且权限不正确
建立对应的文件夹,将文件夹权限改为777
mkdir -p /var/www/html/ganglia/dwoo/compiled
mkdir -p /var/www/html/ganglia/dwoo/cache
chmod 777 /var/www/html/ganglia/dwoo/compiled
chmod 777 /var/www/html/ganglia/dwoo/cache
[root@ws ganglia-web]# find . -type d
.
./cache
./conf
./dwoo
./dwoo/cache
./dwoo/compiled
./dwoo/compiled/templates
./dwoo/compiled/templates/default
[root@ws ganglia-web]# pwd
/var/lib/ganglia-web
然后重新启动httpd,又一次訪问
这是ganglia本机的一些监控信息
以下还须要对被监控主机进行配置。
[root@localhost yum.repos.d]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@localhost yum.repos.d]# yum install ganglia-gmond
[root@ws softs]# rpmbuild -tb ganglia-3.6.0.tar.gz
error: Failed build dependencies:
libpng-devel is needed by ganglia-3.6.0-1.i386
python-devel is needed by ganglia-3.6.0-1.i386
解决方法
[root@ws ~]# yum install libpng-devel python-devel -y
Fatal error:
$conf[‘dwoo_compiled_dir‘]
.$conf[‘dwoo_cache_dir‘]
.版权声明:本文博客原创文章,博客,未经同意,不得转载。
标签:
原文地址:http://www.cnblogs.com/hrhguanli/p/4715147.html