Skip to content

Instantly share code, notes, and snippets.

@mattjbarlow
Last active August 29, 2015 14:00
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 mattjbarlow/c23e41e130ce212a3944 to your computer and use it in GitHub Desktop.
Save mattjbarlow/c23e41e130ce212a3944 to your computer and use it in GitHub Desktop.
StatsD and Graphite Start Script
#!/bin/bash
# start carbon data collection daemon - default port: 2003 --------------------
mkdir -p /var/log/carbon
/opt/graphite/bin/carbon-cache.py start --logdir=/var/log/carbon
# configure graphite ----------------------------------------------------------
mkdir -p /var/log/graphite
cat << EOF > /opt/graphite/webapp/graphite/local_settings.py
LOG_DIR = '/var/log/graphite'
SECRET_KEY = '$(date +%s | sha256sum | base64 | head -c 64)'
EOF
# start graphite web app cgi server -------------------------------------------
python /opt/graphite/webapp/graphite/manage.py runserver 127.0.0.1:80
# start statsd ----------------------------------------------------------------
node /opt/statsd/stats.js /opt/statsd/localConfig.js 2>&1 >> /var/log/statsd.log &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment