Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Dec 17, 2013

thank you, it's useful

@xc8tlik

This comment has been minimized.

Copy link

commented Jan 28, 2014

+1, worked for me on Debian Squeeze.

@lsgd

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Oct 20, 2014

/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

This comment has been minimized.

Copy link

commented Jul 6, 2015

THX! Debian7.8 64bit OK

@moltar

This comment has been minimized.

Copy link

commented Jan 12, 2016

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

@dnayyl

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Mar 23, 2016

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

@jeanfrancoisgratton

This comment has been minimized.

Copy link

commented Mar 19, 2018

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

@sam-at-github

This comment has been minimized.

Copy link

commented Jul 3, 2018

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

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.