Skip to content

Instantly share code, notes, and snippets.

@fabware
Forked from surjikal/graphite.md
Created April 21, 2013 08:06
Show Gist options
  • Save fabware/5428837 to your computer and use it in GitHub Desktop.
Save fabware/5428837 to your computer and use it in GitHub Desktop.

Follow these steps to install graphite on OS X Lion.

Prerequisites

  • Python 2.7
  • Brew
  • Git

Install dependencies

Install Cairo

brew install cairo

Install py2cairo

Clone the repo:

git clone git://git.cairographics.org/git/py2cairo
cd py2cairo

We need to set up a bunch of environment variables:

export PYTHONPATH='/System/Library/Frameworks/Python.framework/Versions/2.7'
export LD_LIBRARY_PATH='$PYTHONPATH/:$PYTHONPATH/lib/:$LD_LIBRARY_PATH'
export LINKFLAGS='-search_dylibs_first -L /System/Library/Frameworks/Python.framework/Versions/2.7/lib/'
export ARCHFLAGS='-arch x86_64'
export CC='/usr/bin/gcc'
export PKG_CONFIG_PATH='/usr/local/Cellar/cairo/1.10.2/lib/pkgconfig/'

Then we can proceed with the installation:

python waf clean
python waf configure --prefix=$PYTHONPATH
python waf build
python waf install

Install Django

pip install django
pip install django-tagging

Install Graphite

pip install carbon
pip install whisper
pip install graphite-web

Configure graphite

cp /opt/graphite/conf/carbon.conf{.example,}
cp /opt/graphite/conf/storage-schemas.conf{.example,}

Create default database

cd /opt/graphite/webapp/graphite

# Modify this file to change database backend (default is sqlite).
cp local_settings.py{.example,}

# Initialize database
python manage.py syncdb

Start carbon

python /opt/graphite/bin/carbon-cache.py start

Start Graphite

python /opt/graphite/bin/run-graphite-devel-server.py /opt/graphite

Hope that it works!

Go to:

http://localhost:8080

You should see this if it works properly:

bacon

If you get a broken image, it most likely means that something is wrong py2cairo and cairo.

Check the debug output here:

http://localhost:8080/render

Additional resources

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