Skip to content

Instantly share code, notes, and snippets.

@caged
Created March 3, 2012 20:25
Show Gist options
  • Star 29 You must be signed in to star a gist
  • Fork 15 You must be signed in to fork a gist
  • Save caged/1968044 to your computer and use it in GitHub Desktop.
Save caged/1968044 to your computer and use it in GitHub Desktop.
Installing Graphite on OS X Lion

This is a general overview (from memory) of the steps I used to install graphite (http://graphite.wikidot.com) on OS X Lion. I think the steps are in order but YMMV. Please fork and fix if you find an error.

Install Python 2.7.2

brew install python

Check your env

$ python --version
Python 2.7.2

$ type python
python is /usr/local/bin/python

$ file /usr/local/bin/python
/usr/local/bin/python: Mach-O 64-bit executable x86_64

$ brew --version
0.8.1

Install Cairo

brew install cairo

Instally py2cairo [CRAZY TRAIN]

git clone git://git.cairographics.org/git/py2cairo
# Open wscript and below `env = ctx.env` add `env.append_unique('CFLAGS', ['-arch', 'x86_64'])`

python waf clean

export PATH=/usr/local/Cellar/python/2.7.2/bin:$PATH
export PYTHONPATH=/usr/local/Cellar/python/2.7.2
export LD_LIBRARY_PATH=/usr/local/Cellar/python/2.7.2:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/Cellar/python/2.7.2/lib:$LD_LIBRARY_PATH
export LINKFLAGS='-search_dylibs_first -L /usr/local/Cellar/python/2.7.2/lib/'
export ARCHFLAGS='-arch x86_64'
export CC=/usr/bin/gcc
export PKG_CONFIG_PATH=/usr/local/Cellar/cairo/1.10.2/lib/pkgconfig

python waf configure
python waf build
python waf install

Install Graphite and Dependencies

pip install carbon
pip install whisper
pip install django
pip install django-tagging
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.

@23inhouse
Copy link

In the end I used easy_install instead of pip.

after installing i used which to find them.

which carbon-cache.py
which run-graphite-devel-server.py

carbon-cache.py has a -- debug option.

CRAZY TRAIN can be replaced with brew install py2cairo

@ciaranj
Copy link

ciaranj commented Oct 12, 2012

I needed to install: https://xquartz.macosforge.org/landing/ before I could

brew install cairo

@dch
Copy link

dch commented Oct 27, 2012

use brew install cairo --without-x and skip xquartz.

@jeremy-degroot
Copy link

I'm trying to do this with graphite 0.9.10.

Every time I try to start the graphite server it tells me it can't find the django admin script.

$ python /usr/local/share/python/run-graphite-devel-server.py /opt/graphite
Could not find a django-admin script!

Eventually, I dug into the code and found out that it uses which which so far as I know that only uses $PATH to find the script to run.

After I ran export PATH=$PATH:/usr/local/share/python/ I was able to start the server.

@richarddbarnett
Copy link

I had to use Django 1.4

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