当前位置:首页 > ganglia安装配置
ganglia安装配置
一、 基本环境
apache+php+mysql
yum install httpdhttpd-develphp*
二、 安装ganglia
1.ganglia相关依赖包
1. yum install rrdtoolrrdtool-devel 2. libconfuse: rpm安装:
官方网站下载失败,下载了版本稍旧一点rpm包:http://pkgs.repoforge.org/libconfuse/ wget http://pkgs.repoforge.org/libconfuse/libconfuse-2.6-2.el5.rf.x86_64.rpm wget http://pkgs.repoforge.org/libconfuse/libconfuse-devel-2.6-2.el5.rf.x86_64.rpm rpm -ivhlibconfuse-* 源码安装:
wgethttp://savannah.nongnu.org/download/confuse/confuse-2.7.tar.gz tarzxvfconfuse-2.7.tar.gz cdconfuse-2.7
./configure CFLAGS=-fPIC --disable-nls make&& make install 调整lib库的位置:
echo /usr/local/lib > /etc/ld.so.conf.d/libconfuse.conf ldconfig -v 3. yum install pcre* 4. yum install expat* 5. 其他依赖
yum install apr-develapr-util check-develcairo-develpango-devel libxml2-devel rpmbuild glib2-devel dbus-develfreetype-develfontconfig-develgcc-c++ expat-devel python-devellibXrender-devel make*
2.安装ganglia管理端(gmetad)
wgethttp://sourceforge.net/projects/ganglia/files/ganglia monitoring core/3.5.0/ganglia-3.5.0.tar.gz/download tarzxvf ganglia-3.5.0.tar.gz cd ganglia-3.5.0
./configure --prefix=/usr/local/ganglia
--with-librrd--with-libapr--with-libexpat--with-libconfuse--with-gmetad--enable-gexec--enable-status make make install
为rrdtool创建数据存放目录 mkdir -p /var/lib/ganglia/rrds
chown -R nobody:nobody /var/lib/ganglia/rrds 将gmetad添加到系统服务
cp {ganglia解压目录}gmetad/gmetad.init /etc/init.d/gmetad 将gmetad命令加入到/usr/sbin/目录 cp /usr/local/ganglia/sbin/gmetad /usr/sbin/ gmetad给chkconfig托管 chkconfig--add gmetad 开启gmetad服务 servicegmetad start
Starting GANGLIA gmetad: [ OK ] 见到[OK]字样说明启动成功。
3. 安装ganglia节点(gmond)ps:主控端也需要安装
依赖:yum install prce* expat* apr-develapr-util check-develcairo-develpango-devel libxml2-develrpmbuild glib2-devel
dbus-develfreetype-develfontconfig-develgcc-c++python-devellibXrender-devel
安装libconfuse rpm安装:
官方网站下载失败,下载了版本稍旧一点rpm包:http://pkgs.repoforge.org/libconfuse/ wget http://pkgs.repoforge.org/libconfuse/libconfuse-2.6-2.el5.rf.x86_64.rpm
wget http://pkgs.repoforge.org/libconfuse/libconfuse-devel-2.6-2.el5.rf.x86_64.rpm rpm -ivhlibconfuse-*
wgethttp://sourceforge.net/projects/ganglia/files/ganglia monitoring core/3.5.0/ganglia-3.5.0.tar.gz/download
(1)解压同gmetad
(2)./configure --prefix=/usr/local/ganglia --with-librrd--with-libapr
--with-libexpat--with-libconfuse--enable-gexec--enable-status--sysconfdir=/etc/ganglia
./configure --prefix=/usr/local/ganglia--sysconfdir=/etc/ganglia
(3)make && make install
(4)将gmond加入系统服务{ganglia解压目录} cpgmond/gmond.init /etc/init.d/gmond (5)将gmond命令加入到/usr/sbin/目录 cp /usr/local/ganglia/sbin/gmond /usr/sbin/ (9)生成gmond的默认配置文件 mkdir /etc/ganglia
/usr/local/ganglia/sbin/gmond -t |tee /etc/ganglia/gmond.conf (10)将gmond给chkconfig托管 chkconfig--add gmond
(11)修改gmond配置文件/etc/ganglia/gmond.conf cluster {
name = \owner = \latlong = %url = \}
(12)开启gmond服务 servicegmond start
Starting GANGLIA gmetad: [ OK ] (6)见到[OK]字样说明启动成功。
4. 安装ganglia web页面 4.2. 构建web服务器
wget
http://sourceforge.net/projects/ganglia/files/ganglia-web/3.5.4/ganglia-web-3.5.4.tar.gz/download tar -xf ganglia-web-3.5.4.tar.gz
cp -r ganglia-web-3.5.4 /{apache:wwwroot}/ganglia cd /{apache:wwwroot}/ganglia
vim Makefile,修改参数GDESTDIR和APACHE_USER,然后执行make install进行安装: GDESTDIR=/usr/local/apache2/htdocs/ganglia APACHE_USER=daemon
make install
cpconf_default.phpconf.php vim conf.php,修改如下参数: $conf['gmetad_root'] = \
$conf['rrds'] = \$conf['rrdtool'] = \
$conf['external_location'] = \把SERVER替换成自己的g $conf['case_sensitive_hostnames'] = false;
禁用SELinux setenforce 0 启动并访问: servicegmetad start servicegmond start
http://SERVER/ganglia/ //把SERVER替换成自己的ganglia服务器IP
三. 集群式部署
集群的部署依靠配置文件: vim/usr/local/ganglia/etc/gmetad.conf 这里需要配置的是集群名称和server端地址 data_source \? /etc/ganglia/gmond.conf
这里需要配置cluster下的name和owner属性与gmetad端一致 cluster {
name = \owner = \latlong = %url = \}
? 如果修改owner,同时也要修改Rrdtool的数据文件目录的owner: chown -R nobody:nobody /var/lib/ganglia/rrds
四.添加apache监控插件(客户端)
1.下载插件
插件下载:https://github.com/hirose31/ganglia-pymodule_apache_status
git clone git://github.com/hirose31/ganglia-pymodule_apache_status.git apache_status cpapache_status/conf.d/apache_status.conf/etc/ganglia/conf.d/ cp -R apache_status/python_modules /etc/ganglia/
共分享92篇相关文档