StatsD/Graphite server on EC2 using Vagrant, Chef Solo, and Berkshelf
- Vagrant 1.2.x installed
- berkshelf gem (
gem install berkshelf)
- vagrant-berkshelf plugin installed (
vagrant plugin install vagrant-berkshelf)
- vagrant-omnibus plugin installed (
vagrant plugin install vagrant-omnibus)
- AWS access key and secret access key
- AWS local keypair
- EC2 Security group(s) allowing for
- http (80) for the graphite web view
- udp (8125 by default) the protocol and port used by statsd
- ssh (22) required in order for vagrant to provision the instance
The berkshelf provides cookbook dependency resolution. Vagrant handles the creating and provisioning of the ec2 instance. Depending on the ami you use, you may have to
vagrant ssh into the instance after its created but before its provisioned and install chef (
gem install chef). All it takes is the Vagrantfile and Berksfile!
vagrant up --provider aws
Try it out
Open the ec2 instance url in a browser. There you'll see the Graphite interface.
Send it some stats:
gem install statsd-ruby irb
require 'statsd-ruby' statsd = Statsd.new "<your ec2 instance host name>" # Incrementer: statsd.increment "hello.world" # Timer statsd.timing 'glork', 320 # Guage statsd.gauge 'bork', 100
Run those statsd commands multiple times and if you're watching in Graphite you can see the new stats come in shortly after they happen.