Created
June 19, 2014 06:15
-
-
Save Dao007forever/01b496f5659679ce76ec to your computer and use it in GitHub Desktop.
Graphite with uWsgi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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