Create a gist now

Instantly share code, notes, and snippets.

Steps for Graphite Installation screencast

Installing Graphite from Source

Overview

This page documents all of the commands that were run in the Installing Graphite from Source screencast. Neither the screencast nor this document are intended to serve as an exhaustive guide for installing or configuring your own Graphite server. Please refer to the official documentation for up-to-date and exhaustive information pertaining to the Graphite project.

System

This screencast installs Graphite 0.9.10 in a Rackspace Cloud server running Ubuntu 10.04.

Commands

All commands are run as root.

apt-get update
apt-get dist-upgrade
apt-get install python-cairo python-django python-django-tagging python-twisted python-zope.interface fontconfig apache2 libapache2-mod-wsgi python-pysqlite2 python-simplejson git-core python-rrdtool
git clone https://github.com/graphite-project/graphite-web.git
git clone https://github.com/graphite-project/carbon.git
git clone https://github.com/graphite-project/whisper.git
cd whisper; git checkout 0.9.10; python setup.py install
cd ../carbon; git checkout 0.9.10; python setup.py install
cd ../graphite-web; python check-dependencies.py; git checkout 0.9.10; python setup.py install
cd /opt/graphite/conf
cp carbon.conf.example carbon.conf

In /opt/graphite/conf/carbon.conf set USER = carbon so Carbon doesn't need to run as root.

vi carbon.conf
cp storage-schemas.conf.example storage-schemas.conf
cp graphite.wsgi.example graphite.wsgi

In /opt/graphite/conf/graphite.wsgi disable the search index settings.

vi graphite.wsgi
cd /etc/apache2/sites-enabled
vi ../sites-available/graphite

Contents of /etc/apache2/sites-available/graphite:

<VirtualHost *:443>
  SSLEngine on
  SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile   /etc/ssl/private/ssl-cert-snakeoil.key
  ServerName graphite
  CustomLog /var/log/apache2/access.log combined
  ErrorLog /var/log/apache2/error.log

  WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi

  Alias /media/ "/usr/lib/pymodules/python2.6/django/contrib/admin/media/"

  <Directory /opt/graphite/conf>
    Order allow,deny
    Allow from all
  </Directory>

  <Location />
    AuthName "Graphite Server"
    AuthType Basic
    AuthUserFile /etc/apache2/graphite.htpasswd
    <Limit GET>
      require valid-user
    </Limit>
  </Location>
</VirtualHost>
ln -s ../sites-available/graphite
htpasswd -c /etc/apache2/graphite.htpasswd demo
cd ../mods-enabled
ln -s ../mods-available/ssl.conf
ln -s ../mods-available/ssl.load
/etc/init.d/apache2 restart
netstat -vant | grep 443
cd /opt/graphite/webapp/graphite
python manage.py syncdb
chown www-data:www-data /opt/graphite/storage/graphite.db
chown www-data /opt/graphite/storage/
chown -R www-data /opt/graphite/storage/log/
groupadd -g 999 carbon
useradd -c "carbon user" -g 999 -u 999 -s /bin/false carbon
chown -R carbon /opt/graphite/storage/whisper/
/opt/graphite/bin/carbon-cache.py start
chown -R carbon /opt/graphite/storage/log/carbon-cache/
/opt/graphite/bin/carbon-cache.py stop
/opt/graphite/bin/carbon-cache.py start
@foetterer

Sad that gists aren't pull requestable :(

diff c83e02b55e0288c72409/ 277d6cbe468908d79773/

Common subdirectories: c83e02b55e0288c72409/.git and 277d6cbe468908d79773/.git

diff c83e02b55e0288c72409/gistfile1.md 277d6cbe468908d79773/gistfile1.md

83c83,84

< ln -s ../sites-available/graphitehtpasswd -c /etc/apache2/graphite.htpasswd demo

---

> ln -s ../sites-available/graphite

> htpasswd -c /etc/apache2/graphite.htpasswd demo

@obfuscurity
Owner

@lixef Thanks, fixed.

@suvash
suvash commented Dec 18, 2012

Any chances you have a development env setup gist as well ? ( for the whole graphite-project stack )

@rbucker
rbucker commented Mar 19, 2013

this was missing:

chown -R carbon /opt/graphite/storage/rrd/

which was in the screencast but not in the text above.

@rflopsy
rflopsy commented Dec 14, 2014

ImportError: cannot import name daemonize

@rflopsy
rflopsy commented Dec 14, 2014

I get this error

python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 11, in
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 459, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(_args, *_options.dict)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, *_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
cursor = connection.cursor()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/dummy/base.py", line 15, in complain
raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

@Jayad
Jayad commented May 19, 2015

sudo python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 2, in
from django.core.management import execute_manager
ImportError: cannot import name execute_manager

Getting the following error.

django-admin --version
1.6.11

django-admin.py --version
1.6.11

@venkat566

Same here... Seems like python 1.6 does not support execute_manager.
Can you please provide the manage.py to execute

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