Skip to content

Instantly share code, notes, and snippets.

@wangshijun wangshijun/INSTALL

forked from mat/INSTALL
Created Nov 6, 2013
What would you like to do?
# This needs to be in your server's config somewhere, probably
# the main httpd.conf
NameVirtualHost *:80
# You may need to manually edit this file to fit your needs.
# This configuration assumes the default installation prefix
# of /opt/graphite/, if you installed graphite somewhere else
# you will need to change all the occurances of /opt/graphite/
# in this file to your chosen install location.
<VirtualHost *:80>
ServerName graphite
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
CustomLog /opt/graphite/storage/log/webapp/access.log common
# I've found that an equal number of processes & threads tends
# to show the best performance for Graphite (ymmv).
WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
WSGIProcessGroup graphite
# You will need to create this file! There is a graphite.wsgi.example
# file in this directory that you can safely use, just copy it to graphite.wgsi
WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi
Alias /content/ /opt/graphite/webapp/content/
<Location "/content/">
SetHandler None
# NOTE: In order for the django admin site media to work you
# must change @DJANGO_ROOT@ to be the path to your django
# installation, which is probably something like:
# /usr/lib/python2.6/site-packages/django
Alias /media/ "@DJANGO_ROOT@/contrib/admin/media/"
<Location "/media/">
SetHandler None
# The graphite.wsgi file has to be accessible by apache. It won't
# be visible to clients because of the DocumentRoot though.
<Directory /opt/graphite/conf/>
Order deny,allow
Allow from all
- edit /opt/statsd/local.js
- correct the graphite host to localhost
- if desired, put 'debug: true' in there
- make the box accessible via the hostname 'graphite'
- update conf/storage-schemas.conf, see example for these retention rules:
6 hours of 10 second data
1 week of 1 minute data
5 years of 10 minute data
# install git and graphite dependencies
aptitude install git-core curl python-cairo python-pip python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi
# download and install everything for graphite
mkdir -pv /opt/graphite/install
cd /opt/graphite/install
for a in graphite-web carbon whisper; do
wget "$version/+download/$a-$version.tar.gz"
tar xfz $a-$version.tar.gz
cd $a-$version
python install
cd ..
pip install django-tagging
# carbon: copy conf.example to conf
for a in carbon.conf graphTemplates.conf storage-schemas.conf graphite.wsgi; do
cp -v /opt/graphite/conf/$a.example /opt/graphite/conf/$a
cp -v /opt/graphite/webapp/graphite/ \
# apache conf
chown -Rv www-data:www-data /opt/graphite/storage/
cp -v /opt/graphite/install/graphite-web-$version/examples/example-graphite-vhost.conf \
ln -sv /etc/apache2/sites-available/graphite.conf \
/etc/init.d/apache2 restart
# run syncdb to setup the db and prime the authentication model (if you're using the DB model)
cd /opt/graphite/webapp/graphite
python syncdb
# start the carbon cache
/opt/graphite/bin/ start
# install nodejs from seperate apt repo
aptitude install python-software-properties
add-apt-repository ppa:chris-lea/node.js
aptitude update
aptitude install nodejs=0.4.10-1chl1~lucid1
# install the node package manager for later use
curl | sudo sh
npm install express
# clone and setup statsd
git clone /opt/statsd
cd /opt/statsd && git checkout $version
cp -v /opt/statsd/exampleConfig.js /opt/statsd/local.js
# start statsd
# node stats.js local.js
# Schema definitions for whisper files. Entries are scanned in order,
# and first match wins.
# [name]
# pattern = regex
# retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...
priority = 110
pattern = ^stats\..*
retentions = 10:2160,60:10080,600:262974
pattern = .*
retentions = 60s:1d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.