Skip to content

Instantly share code, notes, and snippets.

@Dao007forever
Created June 19, 2014 06:15
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 Dao007forever/01b496f5659679ce76ec to your computer and use it in GitHub Desktop.
Save Dao007forever/01b496f5659679ce76ec to your computer and use it in GitHub Desktop.
Graphite with uWsgi
(in /etc/nginx/sites-available/graphite)
server {
listen 80;
server_name _;
client_max_body_size 64M;
keepalive_timeout 5;
# path for static files
root /opt/graphite/webapp/content;
location /media/ {
# this changes depending on your python version
root /usr/local/lib/python2.7/dist-packages/django/contrib/admin;
}
location / {
uwsgi_pass unix:/tmp/uwsgi_graphite.sock;
include uwsgi_params;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/graphite.htpasswd;
}
}
(in /etc/init/graphite.conf)
description "uWSGI server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /home/ubuntu/graphite-env/bin/uwsgi \
--home /home/ubuntu/graphite-env \
--socket /tmp/uwsgi_graphite.sock \
--chmod-socket \
--module graphite.wsgi:application \
--chdir /opt/graphite/webapp \
--logto /home/ubuntu/graphite.log \
--logdate
(in /etc/supervisor/conf.d/supgraphite.conf)
[program:carbon-cache]
command=/usr/local/bin/carbon-cache
process_name=%(program_name)s
autostart=true
autorestart=true
stopsignal=QUIT
user=ubuntu
[program:statsd]
command=/usr/bin/node /opt/statsd/stats.js /opt/statsd/localConfig.js
process_name=%(program_name)s
autostart=true
autorestart=true
stopsignal=QUIT
user=ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment