Skip to content

Instantly share code, notes, and snippets.

@jqr
Forked from howardr/setup-statsd.sh
Created July 6, 2011 02:04
Show Gist options
  • Save jqr/1066383 to your computer and use it in GitHub Desktop.
Save jqr/1066383 to your computer and use it in GitHub Desktop.
Minor changes to statsd installation
# install git
sudo apt-get install -y g++ curl libssl-dev apache2-utils
sudo apt-get install -y git-core
mkdir ~/src
cd ~/src
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
cd ~/src
curl http://npmjs.org/install.sh | sudo sh
# clone the statsd project
cd ~/src
git clone https://github.com/etsy/statsd.git
# download everything for graphite
mkdir ~/src/graphite
cd ~/src/graphite
wget http://launchpad.net/graphite/1.0/0.9.8/+download/graphite-web-0.9.8.tar.gz
wget http://launchpad.net/graphite/1.0/0.9.8/+download/carbon-0.9.8.tar.gz
wget http://launchpad.net/graphite/1.0/0.9.8/+download/whisper-0.9.8.tar.gz
tar xzvf whisper-0.9.8.tar.gz
tar xzvf carbon-0.9.8.tar.gz
tar xzvf graphite-web-0.9.8.tar.gz
# install whisper - Graphite's DB system
cd ~/src/graphite/whisper-0.9.8
sudo python setup.py install
# install carbon - the Graphite back-end
cd ~/src/graphite/carbon-0.9.8
sudo mkdir /opt/graphite
sudo chmod 777 /opt/graphite
python setup.py install
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 -y python-cairo python-django memcached python-memcache python-ldap python-twisted apache2 libapache2-mod-python libapache2-mod-wsgi
#install graphite
cd ~/src/graphite/graphite-web-0.9.8
python setup.py install
# copy the graphite vhost example to available sites, edit it to you satisfaction, then link it from sites-enabled
sudo cp examples/example-graphite-vhost.conf /etc/apache2/sites-available/graphite.conf
sudo ln -s /etc/apache2/sites-available/graphite.conf /etc/apache2/sites-enabled/graphite.conf
sudo rm /etc/apache2/sites-enabled/000-default
sudo apache2ctl restart
# I had to create these log files manually
cd /opt/graphite/storage/log/webapp
touch info.log
chmod 777 info.log
touch exception.log
chmod 777 exception.log
# run syncdb to setup the db and prime the authentication model (if you're using the DB model)
cd /opt/graphite/webapp/graphite
sudo python manage.py syncdb
# 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/
# copy the local_settings example file to creating the app's settings
# this is where both carbon federation and authentication is configured
cp local_settings.py.example local_settings.py
# 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 ~/src/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