Skip to content

Instantly share code, notes, and snippets.

@eddies
Forked from caged/graphite.md
Last active April 14, 2018 13:08
Show Gist options
  • Save eddies/5672221 to your computer and use it in GitHub Desktop.
Save eddies/5672221 to your computer and use it in GitHub Desktop.

Installation of Graphite on OS X Mountain Lion (30 May 2013)

Prerequisites

Install Python

brew install python --framework
pip install --upgrade distribute
pip install --upgrade pip

Sanity check

$ python --version
Python 2.7.5

$ 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.9.4

Install Cairo

brew install cairo
brew install py2cairo

Install Django

pip install Django==1.4.5
pip install django-tagging

Configure Django

cd /usr/local/lib/python2.7/site-packages/django/conf/

Generate a secret key Add your secret key to SECRET_KEY in global_settings.py

Install Graphite and Dependencies

pip install whisper
pip install carbon
pip install graphite-web

Configure graphite-web

cd /opt/graphite/webapp/graphite
cp local_settings.py.example local_settings.py
  • Edit TIME_ZONE to whatever you like
  • Edit DEFAULT_CACHE_DURATION if you don’t like the default of 60 sec
  • Uncomment the Version 1.2 database settings
  • Add your secret key to SECRET_KEY in app_settings.py

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
cd /opt/graphite/bin
ln -s /usr/local/share/python/carbon-cache.py .
ln -s /usr/local/share/python/run-graphite-devel-server.py .

Start carbon

python ./bin/carbon-cache.py --debug start

Start Graphite

/opt/graphite/bin/run-graphite-devel-server.py --port 9090 /opt/graphite

Hope like hell it works

http://localhost:9090

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