Skip to content

Installation: Graphite

mewald1 edited this page May 10, 2015 · 6 revisions

In the last part of the installation tutorial we installed Collectd and integrated Collectsphere. Also, we enabled the write_graphite plugin which is currently creating error messages in syslog. This is because write_graphite tries to send the values from Collectsphere to 127.0.0.1:2003 but Graphite is not listening there, yet. This we are going to change now:

Install Graphite

apt-get install graphite-web graphite-carbon

Configure Graphite Web

vim /etc/graphite/local_settings.py

SECRET_KEY = 'SOMESAFEPASSWORD'
TIME_ZONE = 'Europe/Berlin'
USE_REMOTE_USER_AUTHENTICATION = True

Create database structure

graphite-manage syncdb

Configure Graphite Carbon

Enable Carbon Cache:

vim /etc/default/graphite-carbon

CARBON_CACHE_ENABLED=true

Enable Log Rotation

vim /etc/carbon/carbon.conf

ENABLE_LOGROTATION = True

Configure Storage Schemas

vim /etc/carbon/storage-schemas.conf

[carbon]
pattern = ^carbon\.
retentions = 60:90d

[default_1min_for_1day]
pattern = .*
retentions = 60s:1d

Configure Storage Aggregation

cp /usr/share/doc/graphite-carbon/examples/storage-aggregation.conf.example /etc/carbon/storage-aggregation.conf

Finally, restart Carbon Cache:

service carbon-cache start

Integrate Graphite Web Into Apache2

apt-get install apache2 libapache2-mod-wsgi
a2dissite 000-default
cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
a2ensite apache2-graphite
service apache2 reload

In order not the get an error message from Graphite about a read-only database, I had to chown and chmod the sqlite3 database file

chown _graphite:_graphite /var/lib/graphite/graphite.db
chmod 660 /var/lib/graphite/graphite.db