Skip to content

Instantly share code, notes, and snippets.

@jalaziz
Last active December 14, 2015 08:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jalaziz/5056150 to your computer and use it in GitHub Desktop.
Save jalaziz/5056150 to your computer and use it in GitHub Desktop.
Graphite Upstart + uWSGI + Nginx
description "Graphite Carbon Cache Daemon"
start on runlevel [2345]
stop on runlevel [06]
expect daemon
respawn limit 10 5
chdir /opt/graphite
pre-start exec rm -f /opt/graphite/storage/carbon-cache-a.pid
exec /opt/graphite/bin/carbon-cache.py start
description "Graphite"
start on runlevel [2345]
stop on runlevel [06]
respawn limit 10 5
chdir /opt/graphite
exec uwsgi --master --processes 2 --die-on-term --socket /var/run/graphite.socket \
--chown-socket graphite:graphite --chmod-socket=775 --uid graphite \
--wsgi-file /opt/graphite/conf/graphite.wsgi --logto /var/log/uwsgi/graphite.log
server {
listen 80 default_server deferred;
charset utf-8;
access_log /var/log/nginx/graphite.access.log;
error_log /var/log/nginx/graphite.error.log;
root /opt/graphite/webapp;
location /static/admin/ {
alias /usr/local/lib/python2.7/dist-packages/django/contrib/static/media/;
}
location /content {
}
location / {
include uwsgi_params;
uwsgi_pass unix:/var/run/graphite.socket;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment