Skip to content

Instantly share code, notes, and snippets.

@diver-in-sky
Created July 5, 2012 12:32
Show Gist options
  • Save diver-in-sky/3053443 to your computer and use it in GitHub Desktop.
Save diver-in-sky/3053443 to your computer and use it in GitHub Desktop.
Installing Graphite on OS X Lion

Install Python 2.7.3 (if needed)

brew install python

Install cairo & py2cairo

brew install cairo
brew install py2cairo

Verify cairo

$ python
Python 2.7.3 (default, Jun 17 2012, 23:27:13) 
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
>>> 

Create default directory

sudo mkdir /opt/graphite
chown root:admin /opt/graphite
chmod g+w /opt/graphite 

Create virtualenv (virtualenv should be installed with brewed python)

cd /opt/graphite
virtualenv .ve

Install Graphite and Dependencies

/opt/graphite/.ve/bin/pip install carbon
/opt/graphite/.ve/bin/pip install whisper
/opt/graphite/.ve/bin/pip install django
/opt/graphite/.ve/bin/pip install django-tagging
/opt/graphite/.ve/bin/pip install graphite-web

Create default database

cd /opt/graphite/webapp/graphite
sudo python manage.py syncdb
sudo chown -R nobody:nobody /opt/graphite/storage/

Move example configs

cd /opt/graphite/conf
cp storage-schemas.conf.example storage-schemas.conf
cp carbon.conf.example carbon.conf

Carbon scripts are installed in /usr/local/share/python. Need to symlink

mkdir /opt/graphite/bin
ln -s /usr/local/share/python/carbon-cache.py bin

Start carbon

python ./bin/carbon-cache.py start

Start Graphite

python /usr/local/share/python/run-graphite-devel-server.py /opt/graphite

Hope like hell it works

http://localhost:8080

If it works correclty you should see a black image with "No Data" in the Graphite Composer. If you see a broken image, it's probably something to do with py2cairo and cairo.

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