Skip to content

Instantly share code, notes, and snippets.

@jjulian
Forked from caged/graphite.md
Last active December 11, 2015 02:48
Show Gist options
  • Save jjulian/4532799 to your computer and use it in GitHub Desktop.
Save jjulian/4532799 to your computer and use it in GitHub Desktop.
Steps I used to install graphite on OS X Lion Jan 14 2013

Steps I used to install graphite (http://graphite.wikidot.com) on OS X Lion Jan 14 2013.

Your Application sends stats over UDP to... statsd (the data collection agent) which sends the stats to... Carbon (the storage application) which stores the data in... Whisper db which is immediately cached and optimized for time-series data.

The Graphite webapp reads data from the Whisper db and the cache and show us pretty graphs.

Install Python 2.7.3

brew install python

Check the env - open a new shell

$ python --version
Python 2.7.3

$ type python
python is hashed (/usr/local/bin/python)

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

$ brew --version
0.9.3

Install Cairo

brew install cairo

Instally py2cairo

brew install py2cairo

Install Graphite and Dependencies into /opt/graphite

sudo chown -R jjulian:jjulian /opt
pip install carbon whisper django django-tagging graphite-web

Create default sqlite database for Graphite/Django

cd /opt/graphite/webapp/graphite
cp local_settings.py.example local_settings.py
 - edit file, uncomment DATABASES hash -
python manage.py syncdb
#sudo chown -R nobody:nobody /opt/graphite/storage/

Create carbon config files

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

Start carbon

python ./bin/carbon-cache.py start

Start Graphite

export PATH=$PATH:/usr/local/share/python/
python /usr/local/share/python/run-graphite-devel-server.py /opt/graphite

It works!

http://localhost:8080

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.

Using statsd in the ruby app, increment a counter:

Statsd.increment('myapp.testcounter1')

Statsd is running, collecting stats via UDP, sending them to Carbon on port 2003. The Graphite (front-end) reads the data and shows it in a reasonable manner.

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