Skip to content

Instantly share code, notes, and snippets.

@tildedave
Last active March 15, 2020 20:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tildedave/7751347 to your computer and use it in GitHub Desktop.
Save tildedave/7751347 to your computer and use it in GitHub Desktop.
bootstrap graphite in the fastest way possible. do not use in production
#!/bin/bash -e
# Bootstrap graphite in the fastest way possible
# Run as root because Graphite hardcodes everything to /opt/graphite and it's too annoying to change this
# I did this on Ubuntu 12.04 LTS. For other operating systems you may need to install different apt packages.
apt-get update
apt-get install -y gcc python-virtualenv python-dev python-cairo
virtualenv graphite
source graphite/bin/activate
pip install whisper carbon graphite-web
# Twisted 13.2.0 has a breaking change on importing distribute
pip uninstall -y Twisted
# Django 1.6 removed url defaults, must use 1.5
pip install Twisted==13.1.0 Django==1.5 django-tagging
# Stupid hack to get cairo set up correctly
# http://johannilsson.com/2012/05/13/graphite.html
ln -s /usr/lib/python2.7/dist-packages/cairo/ graphite/lib/python2.7/cairo
# Use example configs
cp /opt/graphite/conf/carbon.conf.example /opt/graphite/conf/carbon.conf
cp /opt/graphite/conf/storage-schemas.conf.example /opt/graphite/conf/storage-schemas.conf
python /opt/graphite/bin/carbon-cache.py --debug start &
# runserver is bad, don't do this in production
python /opt/graphite/webapp/graphite/manage.py syncdb --noinput
python /opt/graphite/webapp/graphite/manage.py runserver 0.0.0.0:8000 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment