Skip to content

Instantly share code, notes, and snippets.

@johnsome
Forked from mat/INSTALL
Created September 1, 2011 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnsome/1185986 to your computer and use it in GitHub Desktop.
Save johnsome/1185986 to your computer and use it in GitHub Desktop.
Turn an Ubuntu 10.04 server into a StatsD/Graphite server
TODO:
- 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'
- patch graphite, like described in https://answers.launchpad.net/graphite/+question/152851
#!/bin/bash
version=0.9.8
# install git and graphite dependencies
aptitude install git-core python-cairo 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 "http://launchpad.net/graphite/1.0/$version/+download/$a-$version.tar.gz"
tar xfz $a-$version.tar.gz
cd $a-$version
python setup.py install
cd ..
done
# carbon: copy conf.example to conf
for a in carbon.conf storage-schemas.conf graphite.wsgi; do
cp -v /opt/graphite/conf/$a.example /opt/graphite/conf/$a
done
cp -v /opt/graphite/webapp/graphite/local_settings.py.example \
/opt/graphite/webapp/graphite/local_settings.py
# apache conf
chown -Rv www-data:www-data /opt/graphite/storage/
cp -v /opt/graphite/install/graphite-web-$version/examples/example-graphite-vhost.conf \
/etc/apache2/sites-available/graphite.conf
ln -sv /etc/apache2/sites-available/graphite.conf \
/etc/apache2/sites-enabled/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 manage.py syncdb
# start the carbon cache
/opt/graphite/bin/carbon-cache.py start
#!/bin/bash
version=116dfe36820159ff2633090d130abcd16a98aefe
# 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 http://npmjs.org/install.sh | sudo sh
npm install express
# clone and setup statsd
git clone https://github.com/etsy/statsd.git /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 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment