Skip to content

Instantly share code, notes, and snippets.

@clee-jana
Last active April 18, 2016 20:03
Show Gist options
  • Save clee-jana/ecae856211a184fb7a6d44bffe1af22e to your computer and use it in GitHub Desktop.
Save clee-jana/ecae856211a184fb7a6d44bffe1af22e to your computer and use it in GitHub Desktop.
Provision section of a Vagrant file to spin up graphite
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 5080 # graphite-web
config.vm.network "forwarded_port", guest: 2003, host: 5003 # graphite
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --force-yes graphite-web graphite-carbon apache2 libapache2-mod-wsgi
sudo sh -c 'echo "CARBON_CACHE_ENABLED=true" > /etc/default/graphite-carbon'
sudo sh -c 'echo "[default]\npattern = .*\nretentions = 10s:10m,1m:1h,10m:1d\n\n" > /etc/carbon/storage-schemas.conf'
sudo a2dissite 000-default
sudo cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
sudo a2ensite apache2-graphite
sudo service apache2 reload
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment