2. Installation

 

Make things as simple as possible, but not simpler.

 
--Albert Einstein 

2.1. Ganglia Monitoring Core Installation (gmetad, gmond, gstat, gmetric)

Last Updated: $Date: 2002/10/16 18:04:26 $

2.1.1. Installation from Source

Starting in version 2.5.1, the gmond and gmetad services reside in separate packages. We made this change to simplify service management: when you install the gmetad RPM package, the gmetad daemon is automatically started, the same for gmond.

  1. Your machine and network must be multicast-enabled to run ganglia. If your machines are all on the same switch then you are in luck: gmond is ready for use without any configuration tweaks. However, if the machines in your cluster are seperated by a router, then you will need to set the mcast_ttl option in /etc/gmond.conf to be higher than the default of 1. Set the multi-cast Time-To-Live (TTL) to be one greater than the number of hops (routers) between the hosts. Also, you will also have to make sure that the routers are configured to pass along the multicast traffic.

    Note

    Some users have reported problems on machines with no "default" route. Gmond reports the error mcast_join() setsockopt() error: No such device and then exits at startup. The workaround is to create a static route for the ganglia multicast channel.

    prompt> route add -host 239.2.11.71 dev eth0

    Replace eth0 above with the name of the network interface you want to send ganglia multicast traffic on

  2. Download the latest source tarball from http://ganglia.sourceforge.net/downloads.php

  3. Unzip the distribution

    prompt> gunzip < ganglia-monitor-core-2.5.0.tar.gz | tar -xvf -
    ganglia-monitor-core-2.5.0/
    ganglia-monitor-core-2.5.0/Makefile.in
    ganglia-monitor-core-2.5.0/README
    ganglia-monitor-core-2.5.0/stamp-h.in
    ganglia-monitor-core-2.5.0/AUTHORS
    ganglia-monitor-core-2.5.0/COPYING
    ganglia-monitor-core-2.5.0/ChangeLog
    ganglia-monitor-core-2.5.0/INSTALL
    ganglia-monitor-core-2.5.0/Makefile.am
    ganglia-monitor-core-2.5.0/NEWS
    ganglia-monitor-core-2.5.0/acconfig.h
    ganglia-monitor-core-2.5.0/acinclude.m4
    ganglia-monitor-core-2.5.0/aclocal.m4
    ganglia-monitor-core-2.5.0/config.h.in
    ...
  4. Jump into the distribution directory

    prompt> cd ganglia-monitor-core-2.5.0
  5. Run the configuration script

    Note

    You must add the --with-gmetad configure flag if you wish to compile and install the Ganglia Meta Daemon (gmetad). To compile gmetad, you must have the Round-Robin Database library and header files installed (librrd.a and rrd.h).

    Note

    You must add the --disable-shared and --enable-static configure flags if you running on AIX

    prompt> ./configure
    creating cache ./config.cache
    checking for a BSD compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking whether make sets ${MAKE}... yes
    checking for working aclocal... found
    checking for working autoconf... found
    checking for working automake... found
    checking for working autoheader... found
    checking for working makeinfo... found
    checking host system type... i686-pc-linux-gnu
    checking for gcc... gcc
    ...
    creating ./config.status
    creating Makefile
    creating lib/Makefile
    creating gmond/Makefile
    creating gmetric/Makefile
    creating ganglia.spec
    creating config.h
    linking ./gmond/machines/linux.c to gmond/machine.c
  6. Run make

    prompt> make
    make  all-recursive
    make[1]: Entering directory `/tmp/mas/ganglia-monitor-core-2.5.0'
    Making all in lib
    make[2]: Entering directory `/tmp/mas/ganglia-monitor-core-2.5.0/lib'
    /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..    -I. -O2  -D_REENTRANT -
    Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -D_GNU_SOURCE -c daemon_inetd.
    c
    mkdir .libs
    gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -O2 -D_REENTRANT -Wall -Wshadow -Wpointer-arith -Wcast-a
    lign -Wstrict-prototypes -D_GNU_SOURCE -c daemon_inetd.c  -fPIC -DPIC -o .libs/daemon_inetd.l
    o
    gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -O2 -D_REENTRANT -Wall -Wshadow -Wpointer-arith -Wcast-a
    lign -Wstrict-prototypes -D_GNU_SOURCE -c daemon_inetd.c -o daemon_inetd.o >/dev/null 2>&1
    mv -f .libs/daemon_inetd.lo daemon_inetd.lo
    ...
  7. Once everything is built, install it

    prompt> make install
    Making install in lib
    make[1]: Entering directory `/tmp/mas/ganglia-monitor-core-2.5.0/lib'
    make[2]: Entering directory `/tmp/mas/ganglia-monitor-core-2.5.0/lib'
    /bin/sh ../config/mkinstalldirs /usr/lib
    /bin/sh ../libtool  --mode=install /usr/bin/install -c libganglia.la /usr/lib/libganglia.la
    ...
  8. Start up gmond and make sure it is started at reboot. Activate gmetad too if necessary.

    Note

    These instructions are Linux specific. Each operating system has a unique way of making sure that daemons are started at system boot.

    prompt> cp ./gmond/gmond.init /etc/rc.d/init.d/gmond
    prompt> chkconfig --add gmond
    prompt> chkconfig --list gmond
    gmond          	0:off	1:off	2:on	3:on	4:on	5:on	6:off
    prompt> /etc/rc.d/init.d/gmond start
    Starting GANGLIA gmond:                                    [  OK  ]

    If you are installing the monitoring core and a web server you plan to install the web frontend on, then you will need to activate gmetad as well in much the same way. If you have specified a different location to store your RRDs than the default (/var/lib/ganglia/rrds) then substitute the new directory in the following example...

    prompt> mkdir -p /var/lib/ganglia/rrds
    prompt> chown -R nobody /var/lib/ganglia/rrds
    prompt> cp ./gmetad/gmetad.init /etc/rc.d/init.d/gmetad
    prompt> chkconfig --add gmetad
    prompt> chkconfig --list gmetad
    gmond             0:off 1:off 2:on  3:on  4:on  5:on  6:off
    prompt> /etc/rc.d/init.d/gmetad start
    Starting GANGLIA gmetad:                                    [  OK  ]
  9. Test your gmond installation

    prompt> telnet localhost 8649

    You should see XML that conforms to the ganglia XML spec

    Optionally, you can test you gmetad installation

    prompt> telnet localhost 8651

2.1.2. Installation Using RPM (Linux-specific)

  1. Your machine and network must be multicast-enabled to run ganglia (stock kernel almost always have multicast). If your machines are all on the same switch then you are in luck: gmond is ready for use without any configuration tweaks. However, if the machines in your cluster are seperated by a router, then you will need to set the mcast_ttl option in /etc/gmond.conf to be higher than the default of 1. Set the multi-cast Time-To-Live (TTL) to be one greater than the number of hops (routers) between the hosts. Also, you will also have to make sure that the routers are configured to pass along the multicast traffic.

    Note

    Some users have reported problems on machines with no "default" route. Gmond reports the error mcast_join() setsockopt() error: No such device and then exits at startup. The workaround is to create a static route for the ganglia multicast channel.

    prompt> route add -host 239.2.11.71 dev eth0

    Replace eth0 above with the name of the network interface you want to send ganglia multicast traffic on

  2. Download the latest monitoring core RPMs: gmond | gmetad.

  3. Install the Gmond RPM on every machine that you want to monitor with ganglia

    prompt> rpm -Uvh ganglia-monitor-core-gmond-2.5.0-1.i386.rpm
    Preparing...                ########################################### [100%]
       1:ganglia-monitor-core   ########################################### [100%]
    Starting GANGLIA gmond: [  OK  ]

    This package will install all the necessary startup files and activate gmond for startup at system boot and start the Ganglia Monitor Daemon (gmond).

  4. Install the Gmetad RPM on a frontend or monitoring machine. This machine can be a compute node, but generally the gmetad service will run on a dedicated webserver.

    prompt> rpm -Uvh ganglia-monitor-core-gmetad-2.5.0-1.i386.rpm
    Preparing...                ########################################### [100%]
       1:ganglia-monitor-core   ########################################### [100%]
    Starting GANGLIA gmond: [  OK  ]

    This package will install all the necessary startup files and activate gmetad for startup at system boot and start the Ganglia Meta Daemon (gmetad). You will need to define the "data sources" in the /etc/gmetad.conf configuration file, to tell Gmetad which Gmond daemons to monitor.

    ## /etc/gmetad.conf ##
    #
    # The data_source tag must immediately be followed by a unique
    # string which identifies the source then a list of machines
    # which service the data source in the format ip:port, or name:port.
    # If a # port is not specified then 8649 (the default gmond port) is
    # assumed.
    # default: There is no default value
    
    data_source "my cluster" localhost

2.2. Ganglia Web Frontend

Last Updated: $Date: 2002/09/17 17:50:55 $

2.2.1. Installation from Source

  1. Download the latest source tarball from http://ganglia.sourceforge.net/downloads.php

  2. Unzip the webfrontend distribution in your website tree. This is often under the directory /var/www/html, however look for the variable DocumentRoot in your Apache configuration files to be sure. All the PHP script files use relative URLs in their links, so you may place the gmetad-webfrontend/ directory anywhere convenient. I like to unzip *tar.gz files with one tar command:

    prompt> cd /var/www/html
    prompt> tar xvzf gmetad-webfrontend-2.5.0.tar.gz
  3. Ensure your webserver understands how to process PHP script files. Currently, the web frontend contains certain php language that requires PHP version 4 or greater. Processing PHP script files usually requires a webserver module, such as the mod_php for the popular Apache webserver. In RedHat Linux, the RPM package that provides this module is called simply "php".

    For Apache, mod_php module must be enabled. The following lines should appear somewhere in Apache's *conf files. This example applies to RedHat and Mandrake Linux. The actual filenames may vary on your system. If you installed the php module using an RPM package, this work will have been done automatically.

    <IfDefine HAVE_PHP4>
    LoadModule php4_module    extramodules/libphp4.so
    AddModule mod_php4.c
    </IfDefine>
    
    AddType  application/x-httpd-php         .php .php4 .php3 .phtml
    AddType  application/x-httpd-php-source  .phps
  4. The webfrontend requires the existance of the gmetad package on the webserver. Follow the installation instructions on the gmetad page. Specifically, the webfrontend requires the rrdtool and the rrds/ directory from gmetad. If you are a power user, you may use NFS to simulate the local existance of the rrds.

  5. Test your installation. Visit the URL:

    http://localhost/gmetad-webfrontend/

    With a web-browser, where localhost is the address of your webserver.

2.2.2. Installation Using RPM

  1. Installation from the RPM should be easy, however they currently only work on Linux i386 machines. Download gmetad-webfrontend-2.5.0-1.i386.rpm, the latest web frontend RPM package.

  2. Install the gmetad-webfrontend RPM on your webserver machine.

    prompt> rpm -Uvh gmetad-webfrontend-2.5.0-1.i386.rpm
    Preparing...                ########################################### [100%]
       1:gmetad-webfrontend     ########################################### [100%]
  3. Test your installation. Visit the URL:

    http://localhost/gmetad-webfrontend/

    With a web-browser, where localhost is the address of your webserver.