Skip to content

Instantly share code, notes, and snippets.

@yesoreyeram
Last active March 8, 2017 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yesoreyeram/f677d5ec9cb7db8e714704b251bb8fb4 to your computer and use it in GitHub Desktop.
Save yesoreyeram/f677d5ec9cb7db8e714704b251bb8fb4 to your computer and use it in GitHub Desktop.
Graphite DB with apache setup for Ubuntu 16 LTS
######################################
# Update and install requied packages
######################################
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install build-essential graphite-web graphite-carbon python-dev apache2 libapache2-mod-wsgi libpq-dev python-psycopg2 --yes
######################################
# Setup Carbon
######################################
sudo nano /etc/default/graphite-carbon # enable carbon cache. change the value to true
sudo service carbon-cache start
######################################
# Setup Graphtie webapp
######################################
sudo graphite-manage syncdb
sudo chown _graphite:_graphite /var/lib/graphite/graphite.db
######################################
# Configure Apache
######################################
sudo cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
sudo a2dissite 000-default
sudo a2ensite apache2-graphite
sudo service apache2 reload
sudo service apache2 restart
######################################
# Test the stuff
######################################
curl http://localhost/
echo "foo.bar 1 `date +%s`" | nc localhost 2003
curl "localhost/render/?format=json&target=foo.bar&from=-10minutes"
yesoreyeram@monitoring:/$ ls /var/lib/graphite/whisper/
carbon foo
yesoreyeram@monitoring:/$ ls /etc/carbon/
carbon.conf storage-schemas.conf
yesoreyeram@monitoring:/$
###########################
output
###########################
yesoreyeram@graphite:~$ apt-cache madison build-essential
build-essential | 12.1ubuntu2 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
build-essential | 12.1ubuntu2 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main Sources
yesoreyeram@graphite:~$ apt-cache madison graphite-web
graphite-web | 0.9.15+debian-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
graphite-web | 0.9.15+debian-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/universe Sources
yesoreyeram@graphite:~$ apt-cache madison graphite-carbon
graphite-carbon | 0.9.15-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
graphite-carbon | 0.9.15-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/universe Sources
yesoreyeram@graphite:~$ apt-cache madison python-dev
python-dev | 2.7.11-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
python-defaults | 2.7.11-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main Sources
yesoreyeram@graphite:~$ apt-cache madison apache2
apache2 | 2.4.18-2ubuntu3.1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
apache2 | 2.4.18-2ubuntu3.1 | http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
apache2 | 2.4.18-2ubuntu3 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
apache2 | 2.4.18-2ubuntu3 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main Sources
apache2 | 2.4.18-2ubuntu3.1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial-updates/main Sources
apache2 | 2.4.18-2ubuntu3.1 | http://security.ubuntu.com/ubuntu xenial-security/main Sources
yesoreyeram@graphite:~$ apt-cache madison libapache2-mod-wsgi
libapache2-mod-wsgi | 4.3.0-1.1build1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
mod-wsgi | 4.3.0-1.1build1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main Sources
yesoreyeram@graphite:~$ apt-cache madison libpq-dev
libpq-dev | 9.5.6-0ubuntu0.16.04 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
libpq-dev | 9.5.4-0ubuntu0.16.04 | http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
libpq-dev | 9.5.2-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
postgresql-9.5 | 9.5.2-1 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main Sources
postgresql-9.5 | 9.5.6-0ubuntu0.16.04 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial-updates/main Sources
postgresql-9.5 | 9.5.4-0ubuntu0.16.04 | http://security.ubuntu.com/ubuntu xenial-security/main Sources
yesoreyeram@graphite:~$ apt-cache madison python-psycopg2
python-psycopg2 | 2.6.1-1build2 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
psycopg2 | 2.6.1-1build2 | http://us-central1.gce.archive.ubuntu.com/ubuntu xenial/main Sources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment