Skip to content

Instantly share code, notes, and snippets.

@vanto
Forked from simondean/setup-statsd.sh
Created January 15, 2013 12:45
Show Gist options
  • Save vanto/4538390 to your computer and use it in GitHub Desktop.
Save vanto/4538390 to your computer and use it in GitHub Desktop.
# update apt's package list
sudo apt-get update
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# install node
sudo apt-get install nodejs
# install the Node package manager (npm) for later use
sudo apt-get install npm
sudo npm install express
# clone the statsd project
sudo mkdir -p /opt/statsd
sudo git clone https://github.com/etsy/statsd.git /opt/statsd
# Install Python prereqs for whisper, carbon and graphite
sudo apt-get install python-pip python-dev
# install whisper - Graphite's DB system
sudo pip install whisper
# install carbon - the Graphite back-end
sudo pip install carbon
cd /opt/graphite/conf
cp carbon.conf.example carbon.conf
# copy the example schema configuration file, and then configure the schema
# see: http://graphite.wikidot.com/getting-your-data-into-graphite
cp storage-schemas.conf.example storage-schemas.conf
# install other graphite dependencies
sudo apt-get install python-cairo
sudo apt-get install python-django
sudo apt-get install memcached
sudo apt-get install python-memcache
sudo apt-get install python-ldap
sudo apt-get install python-twisted
sudo apt-get install apache2 libapache2-mod-python libapache2-mod-wsgi
sudo pip install graphite-web
# copy the graphite vhost example to available sites, edit it to you satisfaction, then link it from sites-enabled
sudo cp example-graphite-vhost.conf /etc/apache2/sites-available/graphite
cd /opt/graphite/conf
sudo cp graphite.wsgi.example graphite.wsgi
# Update this file if you installed the graphite webapp somewhere custom
sudo a2ensite graphite
apache2ctl restart
# I had to create these log files manually
/opt/graphite/storage/log/webapp
touch info.log
chmod 777 info.log
touch exception.log
chmod 777 exception.log
# make sure to change ownership of the storage folder to the Apache user/group - mine was www-data
sudo chown -R www-data:www-data /opt/graphite/storage/
cd /opt/graphite/webapp/graphite
# copy the local_settings example file to creating the app's settings
# this is where both carbon federation and authentication is configured
sudo cp local_settings.py.example local_settings.py
# run syncdb to setup the db and prime the authentication model (if you're using the DB model)
sudo python manage.py syncdb
# start the carbon cache
sudo /opt/graphite/bin/carbon-cache.py start
# copy the the statsd config example to create the config file
# unless you used non-default ports for some other feature of the system, the defaults in the config file are fine
cd ~/statsd
cp exampleConfig.js 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