Skip to content

Instantly share code, notes, and snippets.

@justinrosenthal
Created October 11, 2012 06:33
Show Gist options
  • Save justinrosenthal/3870599 to your computer and use it in GitHub Desktop.
Save justinrosenthal/3870599 to your computer and use it in GitHub Desktop.
Setup for statsd on Ubuntu ec2
##################
# INSTALL STATSD
##################
sudo apt-get install git-core python-software-properties build-essential
sudo apt-get -y install python-software-properties debhelper
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get -y install nodejs npm
npm install express
# clone the statsd project
git clone https://github.com/etsy/statsd.git
cd ~/statsd
dpkg-buildpackage
dpkg --install ~/statsd_0.0.3_all.deb
#############################
# INSTALL SYSTEM DEPENDENCIES
#############################
sudo apt-get -y install apache2 libapache2-mod-wsgi libapache2-mod-python memcached python-dev python-cairo-dev python-django python-ldap python-memcache python-pysqlite2 python-pip sqlite3 erlang-os-mon erlang-snmp rabbitmq-server
sudo pip install django-tagging
#################
# INSTALL WHISPER
#################
sudo pip install http://launchpad.net/graphite/0.9/0.9.9/+download/whisper-0.9.9.tar.gz
################################################
# INSTALL AND CONFIGURE CARBON (data aggregator)
################################################
sudo pip install http://launchpad.net/graphite/0.9/0.9.9/+download/carbon-0.9.9.tar.gz
cd /opt/graphite/conf/
sudo cp carbon.conf.example carbon.conf
sudo cp storage-schemas.conf.example storage-schemas.conf
###########################
# INSTALL GRAPHITE (webapp)
###########################
cd ~
wget http://launchpad.net/graphite/0.9/0.9.9/+download/graphite-web-0.9.9.tar.gz
tar -zxvf graphite-web-0.9.9.tar.gz
mv graphite-web-0.9.9 graphite
cd graphite
sudo python check-dependencies.py
sudo python setup.py install
##################
# CONFIGURE APACHE
##################
cd examples
sudo cp example-graphite-vhost.conf /etc/apache2/sites-available/default
sudo cp /opt/graphite/conf/graphite.wsgi.example /opt/graphite/conf/graphite.wsgi
sudo mkdir /etc/httpd
sudo mkdir /etc/httpd/wsgi
sudo /etc/init.d/apache2 reload
#########################
# CREATE INITIAL DATABASE
#########################
cd /opt/graphite/webapp/graphite/
sudo python manage.py syncdb
sudo chown -R www-data:www-data /opt/graphite/storage/
sudo /etc/init.d/apache2 restart
sudo cp local_settings.py.example local_settings.py
################################
# START CARBON (data aggregator)
################################
sudo /opt/graphite/bin/carbon-cache.py start
##################
# RUN UPDATES
##################
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-software-properties git-core
# CREATE A CONFIG FILE
cd statsd
cp exampleConfig.js dConfig.js
###########################
# EXECUTE THE REST BY HAND
###########################
# edit config file your settings
# sudo vim dConfig.js
# node stats.js dConfig.js
# START STATSD
# node stats.js dConfig.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment