Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'enthuseinc/feat/uwsgi_graphite' into test

  • Loading branch information...
commit 6f6fa3fa6d8c79acd15d1c854e452e5c23674514 2 parents 5f9ac86 + c92e8d3
Matt Conway authored
10 templates/graphite/config/rubber/deploy-graphite.rb
View
@@ -1,8 +1,8 @@
namespace :rubber do
-
+
namespace :graphite do
-
+
rubber.allow_optional_tasks(self)
after "rubber:install_packages", "rubber:graphite:install_collectd_graphite_plugin"
@@ -140,7 +140,7 @@
else
after "rubber:graphite:server:install", "rubber:graphite:web:install"
end
-
+
after "rubber:graphite:server:bootstrap", "rubber:graphite:web:bootstrap"
desc <<-DESC
@@ -191,12 +191,12 @@
desc "Start graphite system monitoring"
task :start, :roles => :graphite_web do
- rsudo "service apache2 start"
+ rsudo "service graphite-web start"
end
desc "Stop graphite system monitoring"
task :stop, :roles => :graphite_web do
- rsudo "service apache2 stop || true"
+ rsudo "service graphite-web stop || true"
end
desc "Restart graphite system monitoring"
17 templates/graphite/config/rubber/role/graphite_web/graphite_web-upstart.conf
View
@@ -0,0 +1,17 @@
+<%
+ @path = "/etc/init/graphite-web.conf"
+ @backup = false
+%>
+
+description "graphite-web uwsgi daemon"
+
+start on runlevel [2345]
+stop on runlevel [016]
+
+env PID=/var/run/graphite-web.pid
+
+expect daemon
+respawn
+respawn limit 10 5
+
+exec uwsgi --ini /opt/graphite/conf/uwsgi.ini
7 templates/graphite/config/rubber/role/graphite_web/monit-graphite_web.conf
View
@@ -0,0 +1,7 @@
+<%
+ @path = '/etc/monit/monit.d/monit-graphite-web.conf'
+%>
+check process graphite-web with pidfile /var/run/graphite-web.pid
+ group graphite-web-<%= Rubber.env %>
+ start program = "/usr/bin/env service graphite-web start"
+ stop program = "/usr/bin/env service graphite-web stop"
16 templates/graphite/config/rubber/role/graphite_web/uwsgi.ini
View
@@ -0,0 +1,16 @@
+<%
+ @path = '/opt/graphite/conf/uwsgi.ini'
+%>
+
+[uwsgi]
+chdir=/opt/graphite/webapp
+wsgi-file=/opt/graphite/conf/graphite.wsgi
+master=True
+pidfile=/var/run/graphite-web.pid
+socket=:3031
+processes=4
+die-on-term=True
+vacuum=True
+max-requests=5000
+daemonize=/opt/graphite/storage/log/webapp/webapp.log
+plugins=python
28 templates/graphite/config/rubber/role/nginx/graphite_web.conf
View
@@ -0,0 +1,28 @@
+<%
+ @path = '/etc/nginx/rubber/graphite_web.conf'
+%>
+
+server {
+ listen <%= rubber_env.graphite_web_port %>;
+ server_name <%= rubber_env.full_host %>;
+ access_log /var/log/graphite_web.log;
+
+ location / {
+ root /opt/graphite/webapp;
+ uwsgi_pass 127.0.0.1:3031;
+
+ uwsgi_param QUERY_STRING $query_string;
+ uwsgi_param REQUEST_METHOD $request_method;
+ uwsgi_param CONTENT_TYPE $content_type;
+ uwsgi_param CONTENT_LENGTH $content_length;
+ uwsgi_param REQUEST_URI $request_uri;
+ uwsgi_param PATH_INFO $document_uri;
+ uwsgi_param DOCUMENT_ROOT $document_root;
+ uwsgi_param SERVER_PROTOCOL $server_protocol;
+ uwsgi_param REMOTE_ADDR $remote_addr;
+ uwsgi_param REMOTE_PORT $remote_port;
+ uwsgi_param SERVER_ADDR $server_addr;
+ uwsgi_param SERVER_PORT $server_port;
+ uwsgi_param SERVER_NAME $server_name;
+ }
+}
2  templates/graphite/config/rubber/rubber-graphite.yml
View
@@ -19,6 +19,6 @@ web_tools_proxies:
roles:
graphite_web:
- packages: [python-django, python-django-tagging, apache2, libapache2-mod-wsgi, python-cairo, python-memcache, memcached, sqlite3, bzr, zip]
+ packages: [python-django, python-django-tagging, python-cairo, python-memcache, memcached, uwsgi, uwsgi-plugin-python, sqlite3, bzr, zip]
collectd:
packages: [libperl-dev]
Please sign in to comment.
Something went wrong with that request. Please try again.