Configuring gmetad and gmond on the Cluster Node Manager


It's time to configure Ganglia. Let's start with gmetad and gmond on the cluster node manager. gmetad is controlled by the /etc/gmetad.conf file, and gmond is controlled by the /etc/gmond.conf file.

Modify /etc/gmetad.conf

The /etc/gmetad.conf file on the cluster node manager only needs to contain one line where you specify the name of the cluster[2] and the name of the nodes inside the cluster. For example, the following entry defines a cluster named Cluster1 and places the localhost (the cluster node manager) and two cluster nodes named clnode1 and clnode2:

 data_source "Cluster1" localhost clnode1 clnode2 

Note 

If a cluster node name changes, you will need to modify the /etc/gmetad.conf file on the cluster node manager, restart gmond on all cluster nodes, and then restart gmetad on the cluster node manager to make the change take effect.

Each of the nodes in the data source should have identical information for Ganglia to monitor. Because Ganglia communication uses a symmetrical model (multicast), a failure on one node in the list means that Ganglia can connect to the next node. For this reason, it is not necessary to specify every host in a cluster for each data_source entry.

Modify /etc/gmond.conf

The /etc/gmond.conf file need only contain one line that specifies the name of the cluster. We'll use this same configuration file on all of the cluster nodes shortly. For example:

 name "Cluster1" 

Note 

See the comments in the /etc/gmond.conf file for other options you may need to specify for your configuration (for example, the Ethernet port gmond should use, the number of multicast hops allowed if you are monitoring clusters that are not connected to the same Ethernet switch, and the level of compression gmond should use for XML data[3]).

Start gmond and gmetad

After making changes to the two configuration files (/etc/gmond.conf and /etc/gmetad.conf) on the cluster node manager, start gmond and gmetad:

 #service gmond restart #service gmetad restart 

Note 

See Chapter 1 for instructions on how to start these services automatically when the system boots.

Now, test to make sure gmond is working properly by entering the following command on the cluster node manager:

 #telnet 127.0.0.1 8649 

Press ENTER twice to send a carriage return through port 8649 to the gmond daemon on the cluster node manager.[4] This should cause your screen to fill up with a long listing of XML code containing the performance metrics that gmond is monitoring.

Note 

The gmetad daemon stores this information using RRDtool in a subdirectory underneath the /var/lib/ganglia/rrds/ directory. For clusters with over 100 nodes, you may want to put this directory on a RAM filesystem because the disk I/O for this database will be very high.

Add the Ganglia Page to Your Apache Configuration

You're now ready to point Apache to the Ganglia PHP scripts. The RPM installation of gmetad placed the PHP programs for Ganglia into the directory /var/www/html/ganglia/. You'll need to create an Apache virtual host to point to these files or configure Apache's DocumentRoot to use the /var/www/html/ ganglia/ directory as the default directory. (See "Modifying the Apache Configuration File" in Appendix F.)

Once you've changed the Apache configuration file [5] and restarted the Apache daemon, you are ready to point your web browser to the Ganglia Web package web page. If, for example, you set the Apache DocumentRoot to /var/www/html, you can use the following URL: http://clusternodemanager/ganglia/index.php.

In this example, the host name clusternodemanager resolves to the IP address of the cluster node manager.

Your web browser should now display the Ganglia main page. In the next section, we'll examine this web page in more detail.

[2]This is the first (and only) time in this book that we have been required to provide a name for our cluster for any of the software packages we've installed (except for the host name you used for your VIP address that client computers use to connect to cluster services).

[3]The default compression level is 0, or no compression. You should only need to use compression on very large clusters, or when you are monitoring a grid (a cluster of clusters).

[4]If you tell gmond to compress the XML data (in the /etc/gmond.conf file), you'll need to use the netcat (netcat.sf.net) program to uncompress that XML data to make it legible. After installing netcat the command to use is nc localhost 8649 | gunzip.

[5]On some versions of Apache, you'll need to uncomment the lines in the httpd.conf configuration file to enable the LoadModule command to load the php4_module.



The Linux Enterprise Cluster. Build a Highly Available Cluster with Commodity Hardware and Free Software
Linux Enterprise Cluster: Build a Highly Available Cluster with Commodity Hardware and Free Software
ISBN: 1593270364
EAN: 2147483647
Year: 2003
Pages: 219
Authors: Karl Kopper

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net