Graphite is a time series database which excels in storing large amounts of metrics and has a mature query language, which can be used by applications to manipulate the data.
We first need to install the required graphite packages:
sudo apt-get install graphite-api graphite-carbon graphite-web
The preceding command gives the following output:
Edit the storage schemas file /etc/graphite/storage-schemas.conf and place the following into it:
[carbon]
pattern = ^carbon.
retentions = 60:90d
[default_1min_for_1day]
pattern = .*
retentions = 60s:1d
And now we can create the graphite database by running the following command:
sudo graphite-manage syncdb
The preceding command will give the following output:
Set the password for the root user when prompted:
sudo apt-get install apache2 libapache2-mod-wsgi
The preceding command gives the following output:
In order to stop the default apache site from conflicting with the graphite web service, we need to disable it by running the following command:
sudo a2dissite 000-default
The preceding command gives the following output:
We can now copy the apache graphite configuration into the apache environment:
sudo cp /usr/share/graphite-web/apache2-graphite.conf
/etc/apache2/sites-available
sudo a2ensite apache2-graphite
The preceding commands give the following output:
Restart the apache service:
sudo service apache2 reload