Thursday, February 7, 2013

About Ganglia and steps to install in CentOS


Ganglia is a scalable distributed system monitor tool for high-performance computing systems such as clusters and grids. It allows the user to remotely view live or historical statistics (such as CPU load averages or network utilization) for all machines that are being monitored.[1]

It has 2 operations

Ganglia Meta Daemon (gmetad)
The meta node: one machine that receives all measurements and presents it to a client through a website.

Ganglia Monitoring Daemon (gmond)
The monitoring nodes: machines that run only the monitoring daemon and send the measurements to the meta node

Installation below will be in metanode and monitoring daemon: 

CentOS 6 and above :
1. Download : Add the EPEL (Extra Package Enterprise Linux) repository to your system. By downloading epel-release-6-8.noarch.rpm

2. Install rpm  

$ rpm -ivh epel-release-6-8.noarch.rpm
Note : Once its installed under /etc/yum.repos.d/ you can see epel repo. This repo contains ganglia packages to install.

MetaNode Machine (Ganglia Server)
Before you proceed, Make sure you downloaded and installed RPM following above mentioned steps.
$ yum install ganglia ganglia-gmetad ganglia-web ganglia-gmond
Note : ganglia-web is for web. Ganglia runs in Apache Webserver. It has php front-end. The message transfer in UDP (unified data protocol) XML.

Update Ganglia Client / Server configuration
$ vi /etc/ganglia/gmond.conf
cluster {
name = "my servers"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}

udp_send_channel {
host = collector.mycompany.com
port = 8649
}

udp_recv_channel {
port = 8649
}

tcp_accept_channel {
port = 8649
}

Note : This allows collector.mycompany.com to receive monitoring data from every node on port 8649(UDP). The cluster name and gmetad.conf datasource name should be same. Remove mcast_join and put host in gmond.conf

Update Apache Configuration - ServerName
Uncomment serverName in apache configuration and update.
$ vi /etc/httpd/conf/httpd.conf
ServerName example.com:80
Update Ganglia Server Configuration
Change ganglia Configuration in location tag from 'All' to 'Allow'
$ vi /etc/httpd/conf.d/ganglia.conf
Command to Start Ganglia & Gmond & apache Service in Ganglia Server
$ /etc/init.d/gmond start
$ /etc/init.d/gmetad start
$ /etc/init.d/httpd start

Steps to Install Ganglia Client Services in Clusters (Ganglia Client Nodes)
Before you proceed, Make sure you downloaded and installed RPM following above mentioned steps.
$ yum install ganglia ganglia-gmond
Update Ganglia Client (Gmond) Configuration
$ vi /etc/ganglia/gmond.conf 
cluster {
name = "PRODUCTION"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}

udp_send_channel {
host = collector.mycompany.com
port = 8649
}

/*udp_recv_channel {
}
tcp_accept_channel {
}*/
Note : This tells gmond to send the info to ganglia server (master) host ip(collector.mycompany.com) on port 8649(UDP). Cluster Name assigned value can be hostname or dataSourceName of ganglia server (Master). Remove udp_recv_channel and tcp_accept_channel from gmond configuration. Also, Remove mcast_join and put host in gmond.conf
Restart gmond service in ganglia client
$ service gmond restart
Access Ganglia Server through your browser using URL as configured: collector.mycompany.com/ganglia

7 comments :

Anonymous said...

getting below error while trying to yum install:
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again.

please help.

Anonymous said...

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

add repo first

Russell said...

Hi

Thanks for your excellent post. Have you ever got this to work with Centos 7? I get

Error: Package: ganglia-gmond-3.1.7-6.el6.x86_64 (epel)
Requires: libpcre.so.0()(64bit)y

Any ideas?

DeveloperBlog said...

No Russell. We still have 6.5 in our Staging / production.

Anonymous said...

this is the message on front end web ui

Cannot find any metrics for selected cluster "my servers", exiting.
Check ganglia XML tree (telnet 127.0.0.1 8652)

dannyk96 said...

I also have Centos 7
How can I install Ganglia? Can I use yum here at all?

Note I have been using Ganglia on multiple system for over 10 years so am more than comfortable in setting it up once I get the binaries ins

dannyk96 said...

I also have Centos 7
How can I install Ganglia? Can I use yum here at all?

Note I have been using Ganglia on multiple system for over 10 years so am more than comfortable in setting it up once I get the binaries ins

// Below script tag for SyntaxHighLighter