Skip to content

Instantly share code, notes, and snippets.

@j1n6
Forked from jgeurts/install-graphite-ubuntu-12.04.sh
Last active December 18, 2015 04:28
Show Gist options
  • Save j1n6/5725224 to your computer and use it in GitHub Desktop.
Save j1n6/5725224 to your computer and use it in GitHub Desktop.
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
cd
sudo apt-get update
sudo apt-get upgrade
wget https://launchpad.net/graphite/0.9/0.9.10/+download/graphite-web-0.9.10.tar.gz
wget https://launchpad.net/graphite/0.9/0.9.10/+download/carbon-0.9.10.tar.gz
wget https://launchpad.net/graphite/0.9/0.9.10/+download/whisper-0.9.10.tar.gz
tar -zxvf graphite-web-0.9.10.tar.gz
tar -zxvf carbon-0.9.10.tar.gz
tar -zxvf whisper-0.9.10.tar.gz
mv graphite-web-0.9.10 graphite
mv carbon-0.9.10 carbon
mv whisper-0.9.10 whisper
rm graphite-web-0.9.10.tar.gz
rm carbon-0.9.10.tar.gz
rm whisper-0.9.10.tar.gz
sudo apt-get install --assume-yes libapr1 libaprutil1 libaprutil1-dbd-sqlite3 build-essential python3.2 python-dev libpython3.2 python3-minimal libaprutil1-ldap memcached python-cairo-dev python-django python-ldap python-memcache python-pysqlite2 sqlite3 erlang-os-mon erlang-snmp rabbitmq-server bzr expect ssh python-setuptools
sudo easy_install django-tagging
sudo easy_install zope.interface
sudo easy_install twisted
sudo easy_install txamqp
# gunicorn to serve the web app
sudo easy_install gunicorn
sudo easy_install virtualenv
####################################
# INSTALL WHISPER
####################################
cd ~/whisper
sudo python setup.py install
####################################
# INSTALL CARBON
####################################
cd ~/carbon
sudo python setup.py install
cd /opt/graphite/conf
sudo cp carbon.conf.example carbon.conf
sudo cp storage-schemas.conf.example storage-schemas.conf
sudo gedit storage-schemas.conf
### Replace contents of storage-schemas.conf to be the following
[stats]
priority = 110
pattern = .*
retentions = 10:2160,60:10080,600:262974
###
####################################
# CONFIGURE GRAPHITE (webapp)
####################################
cd ~/graphite
sudo python check-dependencies.py
sudo python setup.py install
####################################
# INITIAL DATABASE CREATION
####################################
cd /opt/graphite/webapp/graphite/
sudo python manage.py syncdb
# follow prompts to setup django admin user
sudo chown -R www-data:www-data /opt/graphite/storage/
cd /opt/graphite/webapp/graphite
sudo cp local_settings.py.example local_settings.py
####################################
# START CARBON
####################################
cd /opt/graphite/
sudo ./bin/carbon-cache.py start
## NGINX
# 1. make a start up script
sudo vim /opt/graphite/webapp/start.sh
### insert the following to start.sh ####
cd /opt/graphite/webapp/ && sudo gunicorn_django -w 3 -u www-data -g www-data -b 0.0.0.0:8080
###
sudo chmod +x /opt/graphite/webapp/start.sh
# 2. make upstart task
sudo vim /etc/init/graphite.conf
### insert the following content to ### graphtie.config
description "Graphite Web App"
start on runlevel [2345]
stop on runlevel [06]
respawn
respawn limit 10 5
exec /opt/graphite/webapp/start.sh
######
sudo ln -s /etc/init/graphite.conf /etc/init.d/graphite
# 3. start the service
sudo service graphite start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment