CentOS下ganglia监控部署

第一步:CentOS环境准备
1、yum -y install apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel rpm-build glib2-devel dbus-devel freetype-devel fontconfig-devel gcc gcc-c++ expat-devel python-devel libXrender-devel
2、yum install libconfuse libconfuse-devel -y
3、yum install -y libart_lgpl-devel pcre-devel libtool
4、yum install -y rrdtool rrdtool-devel

 

第二步:安装gmetad
1、wget https://sourceforge.net/projects/ganglia/files/ganglia%20monitoring%20core/3.7.2/ganglia-3.7.2.tar.gz
2、tar zxf ganglia-3.7.2.tar.gz -C /home/
3、cd /home/ganglia-3.7.2
4、rpmbuild -tb /tools/ganglia-3.7.2.tar.gz #-tb表示从tar包中build二进制文件
5、cd /root/rpmbuild/RPMS/x86_64/
6、 rpm -ivh /root/rpmbuild/RPMS/x86_64/*
备注:
rpm包安装之后:

/etc/ganglia/ #为主配置文件目录

/var/lib/ganglia/rrds #为rrds图信息存储目录

# rpm -ql ganglia-gmetad-3.7.2-1 #如:通过这个命令也可以看出,gmetad的rpm包相关的目录

/etc/ganglia/gmetad.conf

/etc/init.d/gmetad

/etc/sysconfig/gmetad

/usr/sbin/gmetad

/usr/share/man/man1/gmetad.1.gz

/usr/share/man/man1/gmetad.py.1.gz

/var/lib/ganglia

/var/lib/ganglia/rrds

 

第三步:安装gweb
1、yum install httpd httpd-devel php -y
2、yum -y install rsync
3、wget https://sourceforge.net/projects/ganglia/files/ganglia-web/3.7.2/ganglia-web-3.7.2.tar.gz
4、tar zxf /tools/ganglia-web-3.7.2.tar.gz -C /var/www/html/
5、cd /var/www/html/
6、mv ganglia-web-3.7.2 ganglia
7、cd /var/www/html/ganglia/ cp conf.default.php conf.php
8、make install #执行这步,会创建相关的目录
9、mkdir -p /var/lib/ganglia-web/dwoo/compiled/templates/default
10、mkdir -p /var/lib/ganglia-web/dwoo/cache
11、chmod 777 /var/lib/ganglia-web/dwoo/compiled
12、chmod 777 /var/lib/ganglia-web/dwoo/cache
14、ln -s /var/lib/ganglia /var/lib/ganglia-web
15 chown -R www-data:www-data /var/lib/ganglia-web
16、chown -R apache:apache /var/lib/ganglia
17、chown nobody:nobody /var/lib/ganglia/rrds -R
18、修改apache目录
vim /usr/local/apache2/conf/httpd.conf
修改为DocumentRoot“/var/www/html”
修改为<Directory“/var/www/html”>

第四歩:安装gmond
1、yum -y install apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel rpm-build glib2-devel dbus-devel freetype-devel fontconfig-devel gcc gcc-c++ expat-devel python-devel libXrender-devel
2、yum install libconfuse libconfuse-devel -y
3、rpm -ivh * ganglia-devel-3.7.2-1.x86_64.rpm ganglia-gmond-3.7.2-1.x86_64.rpm ganglia-gmond-modules-python-3.7.2-1.x86_64.rpm libganglia-3.7.2-1.x86_64.rpm
4、/etc/init.d/gmetad start       /etc/init.d/gmond start

posted @ 2017-06-22 17:12  wclwcw  阅读(512)  评论(0编辑  收藏  举报