Skip to content

Instantly share code, notes, and snippets.

@avnerbarr
Created July 3, 2013 11:39
Show Gist options
  • Save avnerbarr/5917220 to your computer and use it in GitHub Desktop.
Save avnerbarr/5917220 to your computer and use it in GitHub Desktop.
Installing Graphite server on Ubuntu 13.04 (GNU/Linux 3.8.0-25-generic x86_64) by a total noob. Server configuration is annoying, especially when you are a developer and not a systems guy. Getting things right took ages. Now it seems to work for me. Try this script out
sudo apt-get update
sudo apt-get upgrade
wget http://launchpad.net/graphite/0.9/0.9.9/+download/graphite-web-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/whisper-0.9.9.tar.gz
tar -zxvf graphite-web-0.9.9.tar.gz
tar -zxvf carbon-0.9.9.tar.gz
tar -zxvf whisper-0.9.9.tar.gz
mv graphite-web-0.9.9 graphite
mv carbon-0.9.9 carbon
mv whisper-0.9.9 whisper
rm carbon-0.9.9.tar.gz
rm graphite-web-0.9.9.tar.gz
rm whisper-0.9.9.tar.gz
sudo apt-get install --assume-yes apache2
sudo apt-get install --assume-yes apache2-mpm-worker
sudo apt-get install --assume-yes apache2-utils
sudo apt-get install --assume-yes apache2.2-bin
sudo apt-get install --assume-yes apache2.2-common
sudo apt-get install --assume-yes libapr1
sudo apt-get install --assume-yes libaprutil1
sudo apt-get install --assume-yes libaprutil1-dbd-sqlite3
sudo apt-get install --assume-yes python3.1
sudo apt-get install --assume-yes libpython3.1
sudo apt-get install --assume-yes python3.1-minimal
sudo apt-get install --assume-yes libapache2-mod-wsgi
sudo apt-get install --assume-yes libaprutil1-ldap
sudo apt-get install --assume-yes memcached
sudo apt-get install --assume-yes python-cairo-dev
sudo apt-get install --assume-yes python-django
sudo apt-get install --assume-yes python-ldap
sudo apt-get install --assume-yes python-memcache
sudo apt-get install --assume-yes python-pysqlite2
sudo apt-get install --assume-yes sqlite3
sudo apt-get install --assume-yes erlang-os-mon
sudo apt-get install --assume-yes erlang-snmp
sudo apt-get install --assume-yes rabbitmq-server
sudo apt-get install --assume-yes bzr
sudo apt-get install --assume-yes expect
sudo apt-get install --assume-yes ssh
sudo apt-get install --assume-yes libapache2-mod-python
sudo apt-get install --assume-yes python-setuptools
sudo easy_install django-tagging
####################################
# INSTALL WHISPER
####################################
cd ~/whisper
sudo python setup.py install
####################################
# INSTALL CARBON
####################################
cd ~/carbon
sudo python setup.py install
# CONFIGURE CARBON
####################
cd /opt/graphite/conf
sudo cp carbon.conf.example carbon.conf
sudo cp storage-schemas.conf.example storage-schemas.conf
sudo vim storage-schemas.conf
### edited 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
# CONFIGURE APACHE
###################
cd ~/graphite/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 vim /etc/apache2/sites-available/default
echo "You HAVE TO MOVE THE WSGIIMPORTSCRIPT tag out of the <VirtualHost> Section !!!!"
echo "The setup scripts from graphite can be fucked up and you might get some strange errors"
echo "Lots of trial and error has showed me that some files are loaded twice causing errors"
echo "You might even have to comment out the line #WSGIImportScript /opt/graphite/conf/graphite.wsgi process-group=graphite application-group=%{GLOBAL}"
# moved 'WSGIImportScript /opt/gr..' to right before virtual host since it gave me an error saying
# WSGIImportScript cannot occur within <VirtualHost> section
# if this path does not exist make it!!!!!!
# /etc/httpd/wsgi
sudo mkdir /etc/httpd
sudo mkdir /etc/httpd/wsgi
sudo /etc/init.d/apache2 reload
####################################
# INITIAL DATABASE CREATION
####################################
cd /opt/graphite/webapp/graphite/
sudo python manage.py syncdb
# follow prompts to setup django admin user
echo "You might want to comment this line out because for me changing owners fucked things up :("
sudo chown -R www-data:www-data /opt/graphite/storage/
sudo /etc/init.d/apache2 restart
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
####################################
# SEND DATA TO GRAPHITE
####################################
echo "this is not mandatory - just in order to check that your setup is good"
cd ~/graphite/examples
sudo chmod +x example-client.py
# [optional] edit example-client.py to report data faster
# sudo vim example-client.py
sudo ./example-client.py
@avnerbarr
Copy link
Author

Getting this to work took 5 years off my life. Hopefully this will help someone out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment