ganglia371 on suse11sp3
参考https://my.oschina.net/duangr/blog/181585
1.确认依赖包是否已安装
确认命令:rpm -qa
如下为适合suse11sp3的依赖包版本
apr:
libapr1-devel-1.4.2-3.1.x86_64.rpm
libapr1-1.4.2-3.1.x86_64.rpm
libdb-4_8-4.8.30-2.4.x86_64.rpm
libapr-util1-1.3.9-9.2.x86_64.rpm
perl:(区以来安装)
perl-5.16.0-3.1.16.x86_64.rpm
perl-base-5.16.0-3.1.16.x86_64.rpm
rrdtool:
glibc-2.14.1-14.12.5.x86_64.rpm
glibc-locale-32bit-2.14.1-14.12.2
glibc-2.14.1-14.12.5
glibc-devel-32bit-2.14.1-14.12.2
glibc-32bit-2.14.1-14.12.2
glibc-locale-2.14.1-14.12.5
glibc-i18ndata-2.14.1-14.12.5
glibc-devel-2.14.1-14.12.5
glibc-info-2.14.1-14.12.5
rrdtool-1.4.7-4.1.2.x86_64.rpm
rrdtool-devel-1.4.7-4.1.2.x86_64.rpm
expat:
libexpat1-2.0.1-101.1.x86_64.rpm
libexpat-devel-2.0.1-101.1.x86_64.rpm
pcre:
libpcre0-8.10-4.1.x86_64.rpm
libpcrecpp0-8.10-4.1.x86_64.rpm
libpcreposix0-8.10-4.1.x86_64.rpm
libstdc++-devel-4.5-19.1.x86_64.rpm
libstdc++45-devel-4.5.1_20101208-9.8.x86_64.rpm
pcre-devel-8.10-4.1.x86_64.rpm
confuse:
libconfuse0-2.7-2.1.x86_64.rpm
libconfuse-devel-2.7-2.1.x86_64.rpm
zlib:
zlib-1.2.7-2.1.2.x86_64.rpm
zlib-devel-1.2.7-2.1.2.x86_64.rpm
2.安装ganglia
./configure --prefix=/etc/ganglia --with-gmetad --enable-gexec
make
make install
3.将python模块copy到目标目录
复制python module到ganglia部署目录
mkdir /etc/ganglia/lib64/ganglia/python_modules
cp ./gmond/python_modules/*/*.py /etc/ganglia/lib64/ganglia/python_modules
安装程序ganglia-3.6.0默认提供了一些python module的配置文件,只需要部署到 /usr/local/ganglia/etc/conf.d 目录下面即可生效
若对默认提供的这些监控脚本不太关心,可以跳过下面这步:
cp ./gmond/python_modules/conf.d/*.pyconf /usr/local/ganglia/etc/conf.d
4.安装ganglia-web
mkdir -p /usr/local/ganglia
tar -zxvf ganglia-web-3.7.2.tar.gz -C /usr/local/ganglia
cd /usr/local/ganglia/ganglia-web-3.7.2
cp conf_default.php conf.php
vi conf.php 调整为如下内容
$conf['gweb_confdir'] = “/usr/local/ganglia/ganglia-web-3.7.2”;
$conf['gmetad_root'] = “/usr/local/ganglia";
vi header.php
<?php
session_start();
ini_set('date.timezone','PRC'); --修改时区为本地时区
if (isset($_GET['date_only'])) {
$d = date("r");
echo $d;
exit(0);
}
配置临时目录
cd /usr/local/ganglia/ganglia-web-3.7.2/dwoo
mkdir cache
chmod 777 cache
mkdir compiled
chmod 777 compiled
5.安装apache
zypper install apache
6.安装php
zypper install php
7.使用apache发布ganglia-web
vi /etc/apache2/default-server.conf
##增加
##ganglia
Alias /ganglia "/usr/local/ganglia/ganglia-web-3.7.2"
<Directory "/usr/local/ganglia/ganglia-web-3.7.2">
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
8.配置ganglia
同其他linux系统
9.将gmetad、gmond加入开机自动启动
cp /root/work/ganglia-3.7.2/gmond/gmetad.init.SuSE /etc/rc.d/gmetad
cp /root/work/ganglia-3.7.2/gmond/gmond.init.SuSE /etc/rc.d/gmond
vi 分别将GMOND_BIN= GMETAD_BIN=修改为prefix设置的地址
chkconfig --add gmond
chkconfig --add gmetad
service start 即可
10.