Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eddies/5682982 to your computer and use it in GitHub Desktop.
Save eddies/5682982 to your computer and use it in GitHub Desktop.
Installation notes for Graphite on Ubuntu 12.04

Installation of Graphite on Ubuntu 12.04

Prerequisites

  • Apache 2

System level dependencies for Graphite

sudo apt-get install memcached python-dev python-pip sqlite3 libcairo2 \
 libcairo2-dev python-cairo pkg-config

Get latest pip

sudo pip install --upgrade distribute
sudo pip install --upgrade pip

Install carbon and graphite deps

cat >> /tmp/graphite_reqs.txt << EOF
django==1.4.5
python-memcached
django-tagging
twisted
whisper
carbon
graphite-web
EOF

sudo pip install -r /tmp/graphite_reqs.txt

Configure carbon

cd /opt/graphite/conf/
sudo cp carbon.conf.example carbon.conf

Copy over the local settings file and initialize database

cd /opt/graphite/webapp/graphite/
sudo cp local_settings.py.example local_settings.py
sudo python manage.py syncdb  # Follow the prompts, creating a superuser is optional

Apache

sudo cp /opt/graphite/examples/example-graphite-vhost.conf /etc/apache2/sites-available/graphite
sudo cp /opt/graphite/conf/graphite.wsgi.example /opt/graphite/conf/graphite.wsgi
cd /etc/apache2/sites-enabled
sudo ln -s ../sites-available/graphite .

In /etc/apache2/sites-available/default, update the line: WSGISocketPrefix run/wsgi to read:

WSGISocketPrefix /var/run/apache2/wsgi

sudo /etc/init.d/apache2 reload

Add carbon-cache.conf to Upstart

#!/etc/init/carbon-cache.conf
description "Carbon server"
 
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
 
umask 022
expect daemon
respawn
 
pre-start script
test -d /opt/graphite || { stop; exit 0; }
end script
 
chdir /opt/graphite
 
exec /opt/graphite/bin/carbon-cache.py start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment