Skip to content

Instantly share code, notes, and snippets.

@jpmens
Forked from bfritz/graphite_pip_uwsgi_recipe.sh
Created August 10, 2012 11:36
Show Gist options
  • Select an option

  • Save jpmens/3313706 to your computer and use it in GitHub Desktop.

Select an option

Save jpmens/3313706 to your computer and use it in GitHub Desktop.
installing graphite-web with pip and running under uwsgi
# graphite-web install is hardcoded in setup.cfg to /opt/graphite
sudo mkdir /opt/graphite
sudo chown brad.users /opt/graphite
# run under python2.7 virtualenv
virtualenv --python=python2.7 ~/ve/graphite
source ~/ve/graphite/bin/activate
# install the necessary python packages (simplejson is for flot graphs)
pip install graphite-web carbon whisper django django-tagging uwsgi simplejson
# use example configurations
cp /opt/graphite/conf/carbon.conf.example /opt/graphite/conf/carbon.conf
cp /opt/graphite/conf/storage-schemas.conf.example /opt/graphite/conf/storage-schemas.conf
# feed carbon 1000 random data points at 90 second intervals
perl -e '$ts = time(); for (1..1000) { printf "foo.bar %d %d\n", int(rand(10000)), $ts - 90 * $_ }' \
| nc -c localhost 2003
# make sure the database gets created
(cd /opt/graphite/webapp/graphite; python manage.py syncdb)
# start graphite-web under uwsgi using built-in http server on port 8085
$HOME/ve/graphite/bin/uwsgi --http localhost:8085 --master --processes 4 --home $HOME/ve/graphite --pythonpath /opt/graphite/webapp/graphite --wsgi-file=/opt/graphite/conf/graphite.wsgi.example
# view a graph of the random data
firefox http://localhost:8085/render/?width=800&height=600&target=foo.bar
@jpmens

jpmens commented Aug 12, 2012

Copy link
Copy Markdown
Author

Download py2cairo
python waf configure --prefix=/opt/cairo
python waf build
python waf install

install django 1.3 manually (python setup.py install) from w/in the virtualenv -- Graphite doesn't seem to like Django 1.4

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