Skip to content

Instantly share code, notes, and snippets.

@jdeniau jdeniau/
Created Mar 27, 2013

What would you like to do?
Graphite - install graphite
# create the directory
mkdir /opt/graphite
# make directory writable by whoever your want. You can chmod 777 if you want to: sudo chmod 777 /opt/graphite
# in our exemple, the "users" group, and www-data user (who execute apache) will have write and execute rights
sudo setfacl -dR -m m:rwx -m u:www-data:rwx -m g:users:rwx /opt/graphite
sudo setfacl -R -m m:rwx -m u:www-data:rwx -m g:users:rwx /opt/graphite
# install all required packages
pip install django==1.3 # Graphite does not seems to work with django >= 1.4
pip install django-tagging twisted whisper carbon graphite-web # all other graphite dependancies
# configure graphite
cd /opt/graphite/conf/
cp graphite.wsgi.example graphite.wsgi
cp carbon.conf.example carbon.conf
cp storage-schemas.conf.example storage-schemas.conf
# Edit graphite.wsgi in order to specify python virtualenv path
# Change the "import" line with those two lines :
- import os, sys
+ import os, sys, site
+ site.addsitedir('/home/envs/graphite/lib/python2.7/site-packages')
# Edit storage-schemas.conf in order to include a custom tweak provided by stats.d
pattern = ^stats.*
retentions = 10:2160,60:10080,600:262974
pattern = ^carbon\.
retentions = 60:90d
pattern = .*
retentions = 60s:1d
# Create a storage-aggregation.conf file
vim storage-aggregation.conf
# Then copy paste in it the following parameters
pattern = \.min$
xFilesFactor = 0.1
aggregationMethod = min
pattern = \.max$
xFilesFactor = 0.1
aggregationMethod = max
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum
pattern = .*
xFilesFactor = 0.3
aggregationMethod = average
# go back to the installation process
cd /opt/graphite/webapp/graphite
python syncdb # I spend some hour on this command, but if you have followed the previous steps, it should be working
# If you have some gcc error message, you may have to install python header
# enable graphite host
/opt/graphite/bin/ start # errors can be found in /opt/graphite/storage/log/carbon-cache/ but I did not have any on that one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.