This is part one of a three-part tutorial on installing and configuring Ganglia on Debian. The full tutorial includes
- Installing Ganglia
- Configuring Ganglia: the host node (gmetad)
- Configuring Ganglia: the client nodes (gmon)
Ganglia uses RRDTool to generate and display its graphs and won't work without it. Fortunately, rrdtool doesn't need to be installed from source. Just run
apt-get install rrdtool librrds-perl librrd2-dev
In order to see the pie charts in PHP, you'll need an additional package:
apt-get install php5-gd
Except for the frontend, Ganglia is in the Debian repository and easy to install. On the webserver, you'll need both packages, so
apt-get install ganglia-monitor gmetad
On all of the worker nodes (and head node, if it isn't running your webserver), you'll only need
ganglia-monitor. You can
apt-get this one at a time or see the Cluster Time-saving Tricks for tips on how to write a script.
Getting the Ganglia Frontend
Unfortunately, the frontend requires an entire build of Ganglia. That doesn't detract from the convenience of having the other two packages in the Debian repository, though, since you'll only need to build this one.
Visit Ganglia's SourceForge download page and copy the file location of the most recent version (the file should end in
.tar.gz). Then, from whenever you keep your source files, run
or similar. Then untar the file with
tar xvzf ganglia*.tar.gz
and cd into the new directory. Ganglia follows the typical source installation paradigm. Run
./configure --help to see all of the options. Important ones include
--prefix=- specify where the binaries should be installed, optional ones are often put in
--enable-gexec- use gexec support
--with-gmetad- compile and install the metad daemon
The full line to enter should look similar to this:
./configure --prefix=/opt/ganglia --enable-gexec --with-gmetad
If it errors out and is unable to find rrd.h, make sure you installed everything listed above under "RRDTool". When it finishes successfully, you should see a screen like this:
Welcome to.. ______ ___ / ____/___ _____ ____ _/ (_)___ _ / / __/ __ `/ __ \/ __ `/ / / __ `/ / /_/ / /_/ / / / / /_/ / / / /_/ / \____/\__,_/_/ /_/\__, /_/_/\__,_/ /____/ Copyright (c) 2005 University of California, Berkeley Version: 3.0.7 (Fossett) Library: Release 3.0.7 0:0:0 Type "make" to compile.
Go ahead and enter
make, and after that finishes,
Finally, when it's done, create a ganglia directory and copy all of
/web to it:
cp web/* /var/www/ganglia
For convenience, you can update Apache to redirect any HTML requests for the root directory (ie, yourserver.yourdomain.com) to go straight to
/etc/apache2/sites-enabled/000-default and find the block of code for the
/var/www directory and add a redirect. The block should now look like this:
<Directory /var/www/> Options FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all RedirectMatch ^/$ /ganglia/ </Directory>
convert: no images defined `/tmp/transform_240d73-1.jpg' @ error/convert.c/ConvertImageCommand/3044.
After this, restart Apache:
When you visit yourserver.yourdomain.com for the first time, you should be redirected to yourserver.yourdomain.com/ganglia, and you should have an "unspecified Grid report" as shown to the right. Cool!
Next, it's time to get rid of some of those "unspecifieds". Continue on to configuring the Ganglia host's gmetad.