Skip to content

Instantly share code, notes, and snippets.

@hellwen
Forked from caged/graphite.md
Last active December 11, 2015 01:09
Show Gist options
  • Save hellwen/4521314 to your computer and use it in GitHub Desktop.
Save hellwen/4521314 to your computer and use it in GitHub Desktop.

Install graphite (http://graphite.wikidot.com) on OS X Mountain Lion(10.8.2).

Prerequisites

  • XQuartx

Check your env

$ python --version
Python 2.7.2

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

$ file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 2 architectures
/usr/bin/python (for architecture i386):  Mach-O executable i386
/usr/bin/python (for architecture x86_64):	Mach-O 64-bit executable x86_64

$ brew --version
0.9.3

Install Cairo, cairo dependent xquartz, you need install it before this step.

brew install cairo

# export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH # if non-homebrew python
brew install py2cairo

Install Diango

sudo pip install django
sudo pip install django-tagging

Install Graphite by git

mkdir graphite
cd graphite
git clone https://github.com/graphite-project/graphite-web.git
git clone https://github.com/graphite-project/carbon.git
git clone https://github.com/graphite-project/whisper.git

pushd whisper
sudo python setup.py install
popd

pushd carbon
sudo python setup.py install 
popd

pushd graphite-web
sudo python setup.py install
popd

or Install Graphite by pip

sudo pip install carbon
sudo pip install whisper
sudo pip install graphite-web

Configure carbon

pushd /opt/graphite/conf
sudo cp carbon.conf.example carbon.conf
sudo cp storage-schemas.conf.example storage-schemas.conf

Configure graphite database

cd /opt/graphite/webapp/graphite
sudo cp local_settings.py.example local_settings.py
sudo vi local_settings.py
eg:
    DATABASES = {
        'default': {
            'NAME': '/opt/graphite/storage/graphite.db',
            'ENGINE': 'django.db.backends.sqlite3',
        }
    }

Create sqlite3 database

cd /opt/graphite/webapp/graphite
sudo python manage.py syncdb

Start carbon

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

Start Graphite

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

Go to

http://0.0.0.0:8080/

Additional resources

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