inside the mind of a linux admin


Graphite is a highly scalable real-time graphing system. We use it to graph all sorts of metrics. Basically, you write an application that collects numeric time-series data that you are interested in graphing, and send it to Graphite’s processing backend, carbon, which stores the data in Graphite’s specialized database. The data can then be visualized through graphite’s web interfaces. This tutorial expects that you are using a RHEL/CentOS based server.



Here I will go over all of the steps required to install the many components which make graphite work. Note that these instructions are intended for CentOS/RHEL based systems only.

Install EPEL

rpm -i

Install rpms

yum -y install bitmap bitmap-fonts Django pycairo python-devel python-ldap python-memcached mod_wsgi python-sqlite2 glibc-devel gcc gcc-c++ git openssl-devel
python-zope-interface httpd memcached

Install twisted

cd /tmp
wget “”
tar -xjf Twisted-11.0.0.tar.bz2
cd Twisted-11.0.0
python install

Install graphite

cd /tmp
wget “”
tar -zxf graphite-web-0.9.8.tar.gz
cd graphite-web-0.9.8
python install

Install whisper

cd /tmp
wget “”
tar -zxf whisper-0.9.8.tar.gz
cd whisper-0.9.8
python install

Install carbon

cd /tmp
wget “”
tar -zxf carbon-0.9.8.tar.gz
cd carbon-0.9.8
python install

Install Node-js

cd /tmp
git clone
cd node
git checkout v0.4.9
./configure && make && make install

Install npm

cd /tmp
. ./
/usr/local/bin/npm install express

Install statsd

cd /tmp
git clone
cp -R /tmp/statsd /opt/graphite


Now, we have to configure apache to accept connections on port 8080 for graphite.

First, create /etc/httpd/conf.d/graphite.conf (just copy and paste all of this into a command line)

cat > /etc/httpd/conf.d/graphite.conf

Listen 8080
# 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 *:8080>
ServerName graphite
DocumentRoot “/opt/graphite/webapp”

# 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/ “/usr/lib/python2.4/site-packages/django/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


Lastly, uncomment the following line in /etc/httpd/conf.d/wsgi.conf:

LoadModule wsgi_module modules/
WSGISocketPrefix /var/run/wsgi

configure statsd

You need to create /opt/graphite/statsd/local.js, again you can paste this into a terminal to do so:

cat > /opt/graphite/statsd/local.js
graphitePort: 2003
, graphiteHost: “localhost”
, port: 8125

copy example configs

cd /opt/graphite/conf/
for i in graphite.wsgi carbon.conf storage-schemas.conf ; do cp $i.example $i ; done
cp /opt/graphite/webapp/graphite/ /opt/graphite/webapp/graphite/

Update with correct values for memcache timezone and DEBUG

TIME_ZONE = ‘America/Los_Angeles’
DEBUG = True

create database

python /opt/graphite/webapp/graphite/ syncdb
sudo chown -R apache:apache /opt/graphite/storage/

Starting Services

start apache

/etc/init.d/httpd start

start memcached

/etc/init.d/memcached start

Start carbon

/usr/bin/python /opt/graphite/bin/ start

start nodejs/statsd

cd /opt/graphite/statsd
nohup /usr/local/bin/node stats.js local.js &


  • mosul518 on Tuesday, March 26, 2013

    Hi, i’m new to both linux and to install graphite. I have question, do I need to install all the requirements to my centos 5.9 machine before installation and configuration steps or the these two (installation and configuration steps) will take care of the requirements?
    Please help
    Thank you


  • lovegandhi on Thursday, April 18, 2013

    Great writeup!
    Quick question: What’s nodejs doing in this instance?

Leave a Reply

Your email address will not be published. Required fields are marked *

Tweeter button Facebook button Myspace button