Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save literalplus/804dc9441faa7e3e00059305cc53ae62 to your computer and use it in GitHub Desktop.
Save literalplus/804dc9441faa7e3e00059305cc53ae62 to your computer and use it in GitHub Desktop.
Information I collected from the web on how to install a working Graphite Stack (Whisper, Carbon, Graphite-Web, Grafana, Statsd) on Debian 8. Most info is partial because every install resulted in unexplicable errors that needed to be fixed individually. Take care.

Install Graphite on Debian 8

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-graphite-on-an-ubuntu-14-04-server

then a lot of magic

sudo apt-get install uwsgi uwsgi-plugin-python graphite-web graphite-carbon

<set salt thingy in /etc/graphite/local_settings.py>

!!! ABSOLUTELY DO EDIT /etc/carbon/storage-schemas.conf OR ELSE EVERYTHING GET DELETED AFTER ONE (1) DAY !!!

sudo graphite-manage syncdb
sudo chown _graphite: /var/lib/graphite/graphite.db

some of the edited files:

/etc/uwsgi/apps-enabled/graphite.ini

[uwsgi]
processes = 2
uid = _graphite
gid = _graphite
chdir = /usr/share/graphite-web
file = graphite.wsgi
chmod-socket = 666

/etc/nginx/sites-available/graphite.

server {
  include snippets/listen_both_le.conf;

  server_name graphite.minotopia.me;
  server_name graphite2.minotopia.me;
  server_name 127.0.0.2;

  location / {
    auth_basic "MinoTopia 1337 haxe graphing solute";
    auth_basic_user_file /etc/graphite/graphite.htpasswd;

    include uwsgi_params;
    uwsgi_pass unix:/run/uwsgi/app/graphite/socket;
  }
}

Resize whisper files on Debian

If you want to change storage retention times for existing datapoints, you need to resize them manually - Existing paths are not updated from storage-schemas.conf.

find /var/lib/graphite/whisper/ -iname "*.wsp" | xargs -n 1 -I% sudo -u _graphite whisper-resize %  <RETENTIONS SPACE SEPARATED>

that's an uppercase i over there.

Example:

find /var/lib/graphite/whisper/ -iname "*.wsp" | xargs -n 1 -I% sudo -u _graphite whisper-resize % 60s:90d

source: https://gist.github.com/kirbysayshi/1389254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment