I'll explain how Ganglia works as I describe how to install and use it. Begin by installing gmond on the cluster nodes and then gmetad and the Ganglia Web package on the cluster node manager. But first, install the other packages required for gmetad and the Ganglia Web package to run on the cluster node manager: PHP, RRDtool, and Apache.
The Ganglia Web package requires PHP. The source code for PHP is included in the chapter18/version2/dependencies directory on the CD-ROM included with this book, but you'll probably find it easier to install the PHP software included with your distribution. If you are using Red Hat, for example, the name of the rpm file for php is php-<version-number>.rpm. You must install PHP on the cluster node manager before attempting to install Ganglia.
Next, install the RRDtool on the cluster node manager from source code (chapter18/version2/dependencies on the CD-ROM). Untar the source file, and then use the following statements at the top of the RRDtool source directory tree to compile it:
Note | Watch for the small, harmless joke from the RRDtool installation script as it pretends to order a CD for developer Tobi Oeriker. You can help support RRDtool development and maintenance by contributing to the Happy Tobi Project (see http://www.rrdtool.com/license.html). |
#./configure --enable-shared #make site-perl-install #make install
Note | You only need to install PHP and RRDtool on the cluster node manager. |
The Ganglia monitoring core gmetad RPM expects to find the shared library for the RRDtool (librrd.so.0) in the /usr/lib directory. Copy it into place with the following command:
#cp /usr/local/RRDtool-<version>/lib/librrd.so* /usr/lib
Next, place the RRDtool binaries in a standard system path where Apache can find them:
#cp /usr/local/RRDtool-<version>/bin/* /usr/bin
Chapter 12 discusses how to install and configure Apache on cluster nodes (see also Appendix F), and you can use these instructions to install Apache on the cluster node manager as well.
For the Ganglia Web package to work properly, Apache must be configured to support the PHP module, as we'll discuss shortly.