Skip to navigation

Installing Ganglia on a Banana Pi

I've been looking for tools to monitor my ARM server farm, and the best contender so far is Ganglia, which is a tool for monitoring large clusters of computers, and logging their performance over time.  You can see an online demo of the Ganglia web UI used to monitor Wikipedia's servers.

Ganglia has three main components:

  • Ganglia Meta Daemon, gmetad
  • Ganglia Monitor Daemon, gmond
  • the Ganaglia web front end

The monitor needs to be installed and configured on each node that's being monitored. The meta daemon needs to be installed on a master node, where it will collect data from the monitors on the other nodes.  Data is transferred using UDP multicasting.  The multicast addresses used can be specified in the Ganglion configuration files. 

Installing Ganglia

To begin with, I'm just going to install Ganglia on a single Banana Pi.  I'm going to use the Ganglia web front end, so I'm going to install Apache and support for PHP5:

sudo apt-get install apache2 php5 libapache2-mod-php5 php5-json 

I'm not completely sure if php5-json is needed, but it's installed on my server.  Now install the necessary Ganglia components:

sudo apt-get install ganglia-frontendweb gmetad gmetad rrdtool ganglia-monitor

The configuration file for the Ganglia daemon is in /etc/ganglia/gmetad.conf, and the configuration file for the monitor is /etc/ganglia/gmond.conf. I used Leafpad to edit the monitor configuration file:

sudo leafpad /etc/ganglia/gmond.conf

and I set the name of the cluster:

...
cluster {
  cluster = "my cluster"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}
...

Copy the Ganglia sample Apache configuration file to Apache's 'sites-available' directory, and enable the new configuration:

sudo cp /etc/ganglia-webfrontend/apache.conf /etc/apache2/sites-available/ganglia.conf
sudo a2ensite ganglia.conf

Restart Ganaglia monitor, Ganglia Meta Daemon and Apache:

sudo service ganglia-monitor restart ; sudo service gmetad restart ; sudo service apache2 restart

Now visit http://<your Banana Pi's IP address>/ganglia/ in a web browser, and you should see something like this:

Ganglia web UI served from a Banana Pi

One of the benefits of Ganglia is it means I don't have to have a web server installed on each node that I want to monitor, just the control node.

The downside of Ganglion is that it accumulates a signicant amount of data over time. The RRD tools database that's used to store the data has an averaging function which reduces the amount of space needed to store older data (but also reduces the resolution of that data), but the database still occupies quite a lot of space.  My Ganglia master node will need its own hard disk.

 

See also: http://ganglia.info/

Share this page:

comments powered by Disqus