Skip to content

Instantly share code, notes, and snippets.

@tristanbes
Created November 9, 2012 15:53
Show Gist options
  • Save tristanbes/4046457 to your computer and use it in GitHub Desktop.
Save tristanbes/4046457 to your computer and use it in GitHub Desktop.
Install Graphite on Debian Server
# Installing graphite dependencies
apt-get install -y python2.6 python-pip python-cairo python-django python-django-tagging
apt-get install -y libapache2-mod-wsgi python-twisted python-memcache python-pysqlite2 python-simplejson
pip install whisper
pip install carbon
pip install graphite-web
# Setup a vhost by grabbing the example the graphite team released on their repo.
# In this file, you'll provide the url used to access to your Graphite dashboard
wget https://raw.github.com/tmm1/graphite/master/examples/example-graphite-vhost.conf -O /etc/apache2/sites-available/graphite
# If you are running on a Debian, don't forget to replace in the vhost, the WSGISocketPrefix value by the following:
WSGISocketPrefix /var/run/apache2/wsgi
# Configuring 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 storage-schemas.conf in order to include a custom tweak provided by stats.d
[stats]
pattern = ^stats.*
retentions = 10:2160,60:10080,600:262974
[carbon]
pattern = ^carbon\.
retentions = 60:90d
[default_1min_for_1day]
pattern = .*
retentions = 60s:1d
# Create a vi storage-aggregation.conf
vi storage-aggregation.conf
# Then copy paste in it the following parameters
[min]
pattern = \.min$
xFilesFactor = 0.1
aggregationMethod = min
[max]
pattern = \.max$
xFilesFactor = 0.1
aggregationMethod = max
[sum]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum
[default_average]
pattern = .*
xFilesFactor = 0.3
aggregationMethod = average
# Let's go back to the installation process
cd /opt/graphite/webapp/graphite
python manage.py syncdb
chown -R www-data:www-data /opt/graphite/storage/
# Enabling graphite host
a2ensite graphite
/opt/graphite/bin/carbon-cache.py start
/etc/init.d/apache2 restart
@y0j
Copy link

y0j commented Dec 17, 2013

thank you, it's useful

@xc8tlik
Copy link

xc8tlik commented Jan 28, 2014

+1, worked for me on Debian Squeeze.

@lsgd
Copy link

lsgd commented Mar 20, 2014

I had to make little modifications for starting carbon-cache. The solution is posted here: http://stackoverflow.com/a/19916809/568270

Also the current code is not working with Django 1.6
You have to use Django 1.5

@Kozlov-V
Copy link

Kozlov-V commented Jun 4, 2014

Note, selecting 'python2.6-minimal' for regex 'python2.6'
E: Unable to locate package python-pip
E: Unable to locate package python-cairo
E: Unable to locate package python-django
E: Unable to locate package python-django-tagging

@resyst-it
Copy link

/opt/graphite/webapp/graphite# /opt/graphite/bin/carbon-cache.py start
/usr/lib/python2.7/dist-packages/zope/init.py:3: UserWarning: Module twisted was already imported from /usr/lib/python2.7/dist-packages/twisted/init.pyc, but /opt/graphite/lib is being added to sys.path
import pkg_resources
Starting carbon-cache (instance a)

@ajcheng
Copy link

ajcheng commented Jul 6, 2015

THX! Debian7.8 64bit OK

@moltar
Copy link

moltar commented Jan 12, 2016

Might need this also, if you are on Apache 2.4: kelvk/chef-bcpc@245c23f

@dnayyl
Copy link

dnayyl commented Jan 13, 2016

Hi I am been following the steps from root@quic03:/home/x# . However, when I do cd /opt/graphite/conf/, I got: bash: cd: /opt/graphite/conf/: No such file or directory. And I just found out that all the files are installed at /usr/local/lib/python2.7/dist-packages. Did I make mistakes on installation path?

@nicoolas
Copy link

The file /etc/apache2/sites-available/graphite needs to be graphite.conf for the command a2ensite graphiteto work

@jeanfrancoisgratton
Copy link

jeanfrancoisgratton commented Mar 19, 2018

You might also need libffi-dev to be installed before launching the first three pip installs

@sgpinkus
Copy link

sgpinkus commented Jul 3, 2018

This no longer works in Debian 9. The pip packages install nothing in /opt/graphite/

@duven87
Copy link

duven87 commented Jul 9, 2021

can you do a new one for Debian Buster please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment