2008年10月24日 星期五

Ganglia 簡易安裝流程

Ganglia 簡易安裝流程
OS Centos 4.3 最小安裝
安裝路徑 /opt
Source 路徑 /opt/src



必須套件
yum install gcc gcc-g77 gcc-g++ bison flex libjpeg-devel libpng-devel \
zlib-devel freetype-devel libart_lgpl libart_lgpl-devel

1. 下載 Source
mkdir /opt/src
cd /opt/src

wget http://apache.cdpa.nsysu.edu.tw/httpd/apache_1.3.36.tar.gz
wget http://ftp.isu.edu.tw/pub/Unix/Web/PHP/distributions/php-4.4.2.tar.gz
wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool.tar.gz
wget http://nchc.dl.sourceforge.net/sourceforge/ganglia/ganglia-3.0.3.tar.gz

tar zxvf apache_1.3.36.tar.gz
tar zxvf php-4.4.2.tar.gz
tar zxvf rrdtool.tar.gz
tar zxvf ganglia-3.0.3.tar.gz

2. 安裝 Apache
cd /opt/src/apache_1.3.36
./configure --prefix=/opt/apache --enable-module=so
make
make install

3. 安裝 PHP
cd /opt/src/php-4.4.2
./configure --with-gd --with-apxs=/opt/apache/bin/apxs --with-jpeg-dir=/usr --with-zlib-dir=/usr
make
make install

cp php.ini-dist /usr/local/lib/php.ini

4. 設定 Apache
vi /opt/apache/conf/httpd.conf
AddType application/x-httpd-php .php .phtml

/opt/apache/bin/apachectl start


5. 安裝 RRDTOOL
cd /opt/src/rrdtool-1.2.13
./configure --prefix=/opt/rrdtool
make
make install

6. 安裝 Ganglia
cd /opt/src/ganglia-3.0.3
./configure --prefix=/opt/ganglia \
CFLAGS="-I/opt/rrdtool/include" \
CPPFLAGS="-I/opt/rrdtool/include" \
LDFLAGS="-L/opt/rrdtool/lib" \
--with-gmetad
make
make install
cp -ar web /opt/ganglia/

7. 設定 Ganglia Part I
cd /opt/ganglia/sbin
7.1 gmond
./gmond --default_config > /etc/gmond.conf
vi /etc/gmond.conf
cluster {
name = "unspecified" --> name = "UniGrid_NCHC"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}

./gmond
telnet localhost 8649
7.2 gmetad
cp /opt/src/ganglia-3.0.3/gmetad/gmetad.conf /etc
vi /etc/gmetad.conf
#gridname "MyGrid" --> gridname "UniGrid"

mkdir -p /var/lib/ganglia/rrds
chown -R nobody /var/lib/ganglia/rrds
./gmetad
7.3 web 介面
vi /opt/ganglia/web/conf.php
define("RRDTOOL", "/opt/rrdtool/bin/rrdtool");

vi /opt/apache/conf/httpd.conf
DocumentRoot "/opt/apache/htdocs" --> DocumentRoot "/opt/ganglia/web"
-->

/opt/apache/bin/apachectl restart

8. 設定 Ganglia Part II
vi /opt/src/ganglia-3.0.3/gmetad/gmetad.init
GMETAD=/usr/sbin/gmetad --> GMETAD=/opt/ganglia/sbin/gmetad
cp /opt/src/ganglia-3.0.3/gmetad/gmetad.init /etc/init.d/gmetad
chkconfig --level 3 gmetad on
service gmetad start

vi /opt/src/ganglia-3.0.3/gmond/gmond.init
GMOND=/usr/sbin/gmond --> GMOND=/opt/ganglia/sbin/gmond
cp /opt/src/ganglia-3.0.3/gmond/gmond.init /etc/init.d/gmond
chkconfig --level 3 gmond on
service gmond start

沒有留言: