Skip to content

Instantly share code, notes, and snippets.

@huggsboson
Forked from dewski/locally.sh
Last active December 12, 2015 04:59
Show Gist options
  • Select an option

  • Save huggsboson/4718732 to your computer and use it in GitHub Desktop.

Select an option

Save huggsboson/4718732 to your computer and use it in GitHub Desktop.
ec2-authorize default -p 2003
# install git
sudo yum -y install git curl gcc gcc-c++ make memcached
# 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
sudo /usr/local/bin/npm install express
cd ..
# clone the statsd project
git clone https://github.com/etsy/statsd.git
# download everything for graphite
mkdir graphite
cd graphite/
wget "http://launchpad.net/graphite/0.9/0.9.9/+download/whisper-0.9.9.tar.gz"
wget "http://launchpad.net/graphite/0.9/0.9.9/+download/carbon-0.9.9.tar.gz"
wget "http://launchpad.net/graphite/0.9/0.9.9/+download/graphite-web-0.9.9.tar.gz"
tar xzvf whisper-0.9.9.tar.gz
tar xzvf carbon-0.9.9.tar.gz
tar xzvf graphite-web-0.9.9.tar.gz
# install whisper - Graphite's DB system
cd whisper-0.9.9
sudo python setup.py install
cd ..
# install carbon - the Graphite back-end
cd carbon-0.9.9
sudo python setup.py install
pushd /opt/graphite/conf
sudo 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
sudo cp storage-schemas.conf.example storage-schemas.conf
popd
cd ..
# install django
wget http://www.djangoproject.com/download/1.3.1/tarball/
tar xzvf Django-1.3.1.tar.gz
cd Django-1.3.1
sudo python setup.py install
cd ..
# install other graphite dependencies
sudo yum -y install pycairo python-memcached python-ldap python-twisted httpd mod_python mod_wsgi
cd graphite/graphite-web-0.9.9
sudo 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/httpd/conf.d/
pushd /opt/graphite/conf
sudo cp graphite.wsgi.example graphite.wsgi
popd
# Update this file if you installed the graphite webapp somewhere custom
sudo /etc/init.d/httpd restart
# I had to create these log files manually
pushd /opt/graphite/storage/log/webapp
sudo touch info.log
sudo chmod 777 info.log
sudo touch exception.log
sudo chmod 777 exception.log
popd
# make sure to change ownership of the storage folder to the Apache user/group - mine was www-data
sudo chown -R apache:apache /opt/graphite/storage/
pushd /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
sudo easy_install django-tagging
sudo easy_install simple_json
# 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
popd
# 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