Ganglia
We install ganglia in /opt/services instead of the normal location. This seperates it from the OS install and allows us to re-install and/or upgrade the OS without worry of interfearing with installed services like ganglia. We also keep /opt/services on a seperate disk which allows us to replace the entire OS disk without interfearing with installed services. Finally, we try to seperate the local configurations of a service (ganglia-local) from the service itsetlf (ganglia). This allow us to easily upgrade the service without having to reconfigure it to work the way the previous version did.
Compile Ganglia
- Set a variable for the version of ganglia to use
-
VERSION="3.4.0"
- Create a directory for ganglia
-
mkdir -p /opt/services/ganglia-${VERSION}
- Create a directory for compilations
-
mkdir /tmp/root
- Ganglia requires libconfuse
- download libconfuse from http://www.nongnu.org/confuse/ and save it in /tmp/root
cd /tmp/root
tar xfvz confuse-2.7.tar.gz
cd confuse-2.7
./configure --prefix=/opt/services/ganglia-${VERSION} --enable-shared
make
make install
- Ganglia requires rrdtool for head nodes
- download rrdtool from http://www.rrdtool.org/ and save it in /tmp/root
cd /tmp/root
tar xfvz rrdtool-1.4.7.tar.gz
cd rrdtool-1.4.7
./configure --prefix=/opt/services/ganglia-${VERSION} --enable-shared
make
make install
- Get ganglia
- download ganglia from http://ganglia.sourceforge.net/ and save it in /tmp/root
cd /tmp/root
tar xfvz ganglia-${VERSION}.tar.gz
cd ganglia-${VERSION}/
LDFLAGS="-L/opt/services/ganglia-${VERSION}/lib" ./configure --prefix=/opt/services/ganglia-${VERSION} --with-libconfuse=/opt/services/ganglia-${VERSION} --with-gmetad
make
make install
(cd /opt/services ; ln -s ganglia-${VERSION} ganglia)
mkdir -p /opt/services/ganglia-local/bin
mkdir -p /opt/services/ganglia-local/etc/conf.d
mkdir -p /opt/services/ganglia-local/init.d
mkdir -p /opt/services/ganglia-local/lib64/ganglia/python_modules
- Create client configure script
-
- Create config file
- Save the attached Ganglia client configuration as /opt/services/ganglia-local/etc/gmond.conf
-
- Create modpython.conf
-
cp /opt/services/ganglia/etc/conf.d/modpython.conf /opt/services/ganglia-local/etc/conf.d
edit /opt/services/ganglia-local/etc/conf.d/modpython.conf
Change params and include to reference ganglia-local
params = "/opt/services/ganglia-local/lib64/ganglia/python_modules"
include('/opt/services/ganglia-local/etc/conf.d/*.pyconf')
- Create client startup script
- Save the attached Ganglia client startup script as /opt/services/ganglia-local/init.d/nrao-gmond
chmod 755 /opt/services/ganglia-local/init.d/nrao-gmond
ln -s /opt/services/ganglia-local/init.d/nrao-gmond /etc/init.d
chkconfig --add nrao-gmond
- Create server configure scripts
-
cp /tmp/root/ganglia-${VERSION}/gmetad/gmetad.conf /opt/services/ganglia-local/etc
- edit /opt/services/ganglia-local/etc/gmetad.conf
- Set the data_source:
data_source "USNO" localhost
Set the rrd_rootdir rrd_rootdir "/opt/services/ganglia-local/var/rrds"
-
- Then make the rrds directory
-
mkdir -p /opt/services/ganglia-local/var/rrds
chown nobody /opt/services/ganglia-local/var/rrds
- Create server startup script
- Save the attached Ganglia server startup script as /opt/services/ganglia-local/init.d/nrao-gmetad
chmod 755 /opt/services/ganglia-local/init.d/nrao-gmetad
ln -s /opt/services/ganglia-local/init.d/nrao-gmetad /etc/init.d
chkconfig --add nrao-gmetad
Create Ganglia Tar Ball
This tar ball can be used to simplify the installation of clients.
cd /opt/services
tar cfvz ganglia_nrao_`uname -i`-${VERSION}.tgz ganglia*
copy this tar ball to someplace your clients can access
Install Ganglia Client (from tar ball)
You should have already created a tar ball for client installs as part of the server install above.
- Install the tarball made in the previous section if not already installed
-
mkdir /opt/services
cd /opt/services
tar xfvz /home/src/ganglia/ganglia_nrao_`uname -i`-${VERSION}.tgz
ln -s /opt/services/ganglia-local/init.d/nrao-gmond /etc/init.d
chkconfig --add nrao-gmond
Install Ganglia Server (from tar ball)
You should have already created a tar ball for client installs as part of the server install above.
- Install the tarball made in the previous section if not already installed
-
mkdir /opt/services
cd /opt/services
tar xfvz /home/src/ganglia/ganglia_nrao_`uname -i`-${VERSION}.tgz
- Setup server startup script
-
ln -s /opt/services/ganglia-local/init.d/nrao-gmetad /etc/init.d
chkconfig --add nrao-gmetad
Install Ganglia Web Interface
- Set a variable for the version of ganglia-web to use
-
VERSION="3.4.2"
- Get ganglia-web
- download ganglia-web from http://sourceforge.net/projects/ganglia/files/
mkdir /tmp/root
cd /tmp/root
tar xfvz ganglia-web-${VERSION}.tar.gz
cd ganglia-web-${VERSION}
mkdir /opt/services/ganglia-web-${VERSION}
(cd /opt/services ; ln -s ganglia-web-${VERSION} ganglia-web)
make install -e DESTDIR=/opt/services/ganglia-web/gweb GWEB_STATEDIR=/opt/services/ganglia-web
- It doesn't read conf.php like it should so
- edit /opt/services/ganglia-web/gweb/conf_default.php
$conf['gmetad_root'] = "/opt/services/ganglia-web/ganglia";
$conf['rrds'] = "/opt/services/ganglia-local/var/rrds";
$conf['rrdtool'] = "/opt/services/ganglia/bin/rrdtool";
$conf['time_ranges'] = array(
'halfhour'=>1800,
'hour'=>3600,
'2hour'=>7200,
'4hour'=>14400,
'8hour'=>28800,
'day'=>86400,
'week'=>604800,
'month'=>2419200,
'year'=>31449600
);
- Eventually we will want to use our regular apache/http installation but for now, I am just going to use the stock redhat for testing
- edit /etc/httpd/conf.d/ganglia.conf
Alias /ganglia/ "/opt/services/ganglia-web/gweb/"
<Directory "/opt/services/ganglia-web/gweb">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
- Configure only https
- We don't want passwds in cleartext
sed -i -e 's/^Listen 80.*$/#Listen 80/' /etc/httpd/conf/httpd.conf
- Setup httpd server startup script
-
chkconfig --level 345 httpd on
chkconfig httpd on
Start
- Start ganglia server
-
/etc/init.d/nrao-gmetad start
- Start ganglia client
-
/etc/init.d/nrao-gmond start
- Start web server
-
/etc/init.d/httpd restart
Access
- One can now access ganglia via
- https://usno-serv-1-ext/ganglia/
--
KScottRowe - 2012-06-14