Setup Real-Time Monitoring using Ganglia on Centos 7

Mohammad Hanif
2 min readMay 14, 2020

--

What Is Ganglia?

Ganglia is one of the monitoring tools used in cluster, grid and cloud infrastructure. Ganglia is very powerful even though it is used for monitoring many servers. Broadly speaking, ganglia consist of several components, including:

Gmond (Deamon Ganglia Monitoring): This service will retrieve some information about the node to be monitored.
Gmetad (Ganglia Meta Daemon): Gmated will collect data from all gmonds. Including gmond which is installed on the client. Gmated only needs to be installed on the server side only.
RRD (Round Robin Database): Used to store data on ganglia.
Ganglia Web: A web interface for displaying data graph displays and matrices from rrd tools.

Install Ganglia on Centos 7

Here I use 2 nodes, 1 for the master and 1 for the node.
Master : IP 10.180.0.1
Node: IP 10.180.0.2

  1. Install package ganglia, ganglia-gmetad, ganglia-mond, httpd
#yum install -y rrdtool rrdtool-devel ganglia-web ganglia-gmetad  ganglia-gmond ganglia-gmond-python httpd httpd-tools apr-devel zlib-devel  libconfuse-devel expat-devel pcre-devel

2. Edit on /etc/ganglia/gmetad.conf

add data source RRD on local, but if you install RRD on different machine, please add on config below

data_source "Example Cluster" master

3. Edit on /etc/ganglia/gmond.conf

cluster {
name = “Example Cluster”
owner = “my server”
latlong = “unspecified”
url = “unspecified”
}

host {
location = “unspecified”
}

udp_send_channel {
host = master
port = 8649
ttl = 1
}

udp_recv_channel {
port = 8649
}

tcp_accept_channel {
port = 8649
}

3. Add Ganglia to httpd

By default, ganglia-web only limits local access. For that we need to change the configuration in /etc/httpd/conf.d/ganglia.conf so that web ganglia can be accessed via remote too.

#vi /etc/httpd/conf.d/ganglia.conf

# Ganglia Monitoring Web

Alias /ganglia /usr/share/ganglia

<Location /ganglia>
AuthType basic
AuthName “My Server”
AuthBasicProvider file
AuthUserFile “/etc/httpd/auth.basic”
Require valid-user
</Location>

4. Setup authentication accessing ganglia-web

#htpasswd -c /etc/httpd/auth.basic username

Enter the password for username twice before proceeding.

5. Disable Firwall

#systemctl stop firewalld
#systemctl disable firewalld

then restart All Service

#systemctl restart httpd
#systemctl restart gmond
#systemctl restart gmetad
#systemctl enable httpd
#systemctl enable gmond
#systemctl enable gmetad

Before next setup to node, check first ganglia-web running healthy

url: ip-server/ganglia

Configuration Node

  1. Install package ganglia-gmond
#yum install ganglia-gmond

2. Edit some config /etc/ganglia/gmond.conf

cluster {
name = “Example Cluster”
owner = “my server”
latlong = “unspecified”
url = “unspecified”
}

host {
location = “unspecified”
}

udp_send_channel {
host = master
port = 8649
ttl = 1
}

udp_recv_channel {

}

tcp_accept_channel {

}

3. Stop Firewalld & Restart Ganglia

#systemctl stop firewalld
#systemctl restart gmond

Now check, it will add 1 server to monitor. Do this as many servers as you will monitor.

--

--