Getting StatsD up and running on Ubuntu 14.04 in 10 minutes

Even though that sending metrics to StatsD is really easy the installation of the StatsD stack on a webserver is historically non-trivial. Because the components are now available as apt-get packages and all guides that I found are long, incomplete or contain user intervention I have scripted an unattended install of StatsD on Ubuntu 14.04.

The script is currently located at Github. Also contained in the repository is a Docker config file to easily test the script. The Docker container exposes ports 8080, 8125 and 8126 for interaction with StatsD and Graphite.

Installation proces

  • SSH into your fresh Ubuntu 14.04 machine
  • Download the script: wget https://raw.githubusercontent.com/crunchie84/ubuntu-statsd-server-installer/master/install-statsd-trusty-1404.sh
  • Make it executable chmod +x install-statsd-trusty-1404.sh
  • Run it sudo ./install-statsd-trusty-1404.sh

What this does

The script itself is commented so you can check it out. In essence it:

  • Installs Graphite-web + apache2 for displaying of metrics
  • Installs Carbon-cache for metrics storing
  • Installs StatsD for metrics aggregating
  • Tweaks some settings on the graphite-web Django DB, inits it
  • Tweaks some retention profiles for carbon-cache
  • Creates upstart scripts for StatsD
  • Starts all services

Now its time to insert your first metric into StatsD: