nogara-rubber 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +448 -0
- data/COPYING +339 -0
- data/README +6 -0
- data/TODO +11 -0
- data/VERSION +1 -0
- data/bin/vulcanize +25 -0
- data/generators/vulcanize/USAGE +6 -0
- data/generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb +51 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/apache/deflate.conf +10 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/apache/expires.conf +9 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/apache/headers.conf +6 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/apache/monit-apache.conf +8 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/apache/ports.conf +8 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/apache/setenvif.conf +52 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache-vhost.conf +79 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache.auth +7 -0
- data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-index.html +34 -0
- data/generators/vulcanize/templates/apache/config/rubber/rubber-apache.yml +6 -0
- data/generators/vulcanize/templates/apache/templates.yml +1 -0
- data/generators/vulcanize/templates/base/Capfile +14 -0
- data/generators/vulcanize/templates/base/Rakefile +23 -0
- data/generators/vulcanize/templates/base/config/deploy.rb +56 -0
- data/generators/vulcanize/templates/base/config/rubber/common/crontab +22 -0
- data/generators/vulcanize/templates/base/config/rubber/common/monit-postfix.conf +8 -0
- data/generators/vulcanize/templates/base/config/rubber/common/rubber.profile +13 -0
- data/generators/vulcanize/templates/base/config/rubber/deploy-setup.rb +92 -0
- data/generators/vulcanize/templates/base/config/rubber/deploy-util.rb +97 -0
- data/generators/vulcanize/templates/base/config/rubber/rubber-dns.yml +78 -0
- data/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +33 -0
- data/generators/vulcanize/templates/base/config/rubber/rubber.yml +233 -0
- data/generators/vulcanize/templates/base/lib/tasks/rubber.rake +15 -0
- data/generators/vulcanize/templates/base/script/cron-rake +18 -0
- data/generators/vulcanize/templates/base/script/cron-runner +18 -0
- data/generators/vulcanize/templates/base/script/cron-sh +67 -0
- data/generators/vulcanize/templates/base/templates.rb +11 -0
- data/generators/vulcanize/templates/base/templates.yml +6 -0
- data/generators/vulcanize/templates/cassandra/config/rubber/deploy-cassandra.rb +88 -0
- data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.in.sh +60 -0
- data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.yaml +210 -0
- data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/log4j-server.properties +45 -0
- data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/monit-cassandra.conf +8 -0
- data/generators/vulcanize/templates/cassandra/config/rubber/rubber-cassandra.yml +18 -0
- data/generators/vulcanize/templates/cassandra/templates.yml +1 -0
- data/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf +23 -0
- data/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/nginx/nginx-mongrel.conf +113 -0
- data/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/rubber-complete.yml +41 -0
- data/generators/vulcanize/templates/complete_mongrel_mysql/templates.yml +6 -0
- data/generators/vulcanize/templates/complete_passenger/config/rubber/role/haproxy/haproxy-passenger.conf +21 -0
- data/generators/vulcanize/templates/complete_passenger/config/rubber/rubber-complete.yml +40 -0
- data/generators/vulcanize/templates/complete_passenger/templates.rb +9 -0
- data/generators/vulcanize/templates/complete_passenger/templates.yml +9 -0
- data/generators/vulcanize/templates/complete_passenger_mysql/templates.yml +4 -0
- data/generators/vulcanize/templates/complete_passenger_postgresql/templates.yml +4 -0
- data/generators/vulcanize/templates/cruise/config/rubber/deploy-cruise.rb +72 -0
- data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/cruise +40 -0
- data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/my.cnf +165 -0
- data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/production.rb +8 -0
- data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/site_config.rb +76 -0
- data/generators/vulcanize/templates/cruise/config/rubber/role/web_tools/cruise-nginx.conf +11 -0
- data/generators/vulcanize/templates/cruise/config/rubber/rubber-cruise.yml +18 -0
- data/generators/vulcanize/templates/cruise/templates.yml +1 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb +45 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-base.conf +26 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-default.conf +8 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/monit-haproxy.conf +9 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslog-haproxy.conf +11 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslogd-default.conf +21 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/role/web_tools/haproxy-nginx.conf +10 -0
- data/generators/vulcanize/templates/haproxy/config/rubber/rubber-haproxy.yml +7 -0
- data/generators/vulcanize/templates/haproxy/templates.yml +1 -0
- data/generators/vulcanize/templates/jetty/config/rubber/deploy-jetty.rb +59 -0
- data/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.sh +589 -0
- data/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.xml +199 -0
- data/generators/vulcanize/templates/jetty/config/rubber/role/jetty/monit-jetty.conf +9 -0
- data/generators/vulcanize/templates/jetty/config/rubber/rubber-jetty.yml +10 -0
- data/generators/vulcanize/templates/jetty/templates.yml +1 -0
- data/generators/vulcanize/templates/memcached/config/memcached.yml +28 -0
- data/generators/vulcanize/templates/memcached/config/rubber/common/memcached.yml +14 -0
- data/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached.conf +52 -0
- data/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached_munin_plugin +249 -0
- data/generators/vulcanize/templates/memcached/config/rubber/rubber-memcached.yml +7 -0
- data/generators/vulcanize/templates/memcached/templates.yml +1 -0
- data/generators/vulcanize/templates/minimal_mysql/templates.yml +7 -0
- data/generators/vulcanize/templates/minimal_nodb/templates.yml +6 -0
- data/generators/vulcanize/templates/mongrel/config/rubber/deploy-mongrel.rb +75 -0
- data/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/mongrel_cluster.yml +12 -0
- data/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/monit-mongrel.conf +20 -0
- data/generators/vulcanize/templates/mongrel/config/rubber/rubber-mongrel.yml +9 -0
- data/generators/vulcanize/templates/mongrel/templates.yml +1 -0
- data/generators/vulcanize/templates/monit/config/rubber/common/monit-default.conf +15 -0
- data/generators/vulcanize/templates/monit/config/rubber/common/monit.conf +252 -0
- data/generators/vulcanize/templates/monit/config/rubber/deploy-monit.rb +33 -0
- data/generators/vulcanize/templates/monit/config/rubber/role/web_tools/monit-admin-nginx.conf +10 -0
- data/generators/vulcanize/templates/monit/config/rubber/rubber-monit.yml +6 -0
- data/generators/vulcanize/templates/monit/templates.yml +1 -0
- data/generators/vulcanize/templates/munin/config/rubber/common/monit-munin.conf +8 -0
- data/generators/vulcanize/templates/munin/config/rubber/common/munin-node.conf +48 -0
- data/generators/vulcanize/templates/munin/config/rubber/common/munin-plugins.conf +11 -0
- data/generators/vulcanize/templates/munin/config/rubber/deploy-munin.rb +46 -0
- data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-nginx.conf +8 -0
- data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-plugins.conf +31 -0
- data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin.conf +115 -0
- data/generators/vulcanize/templates/munin/config/rubber/rubber-munin.yml +8 -0
- data/generators/vulcanize/templates/munin/script/munin/example_mysql_query.rb +55 -0
- data/generators/vulcanize/templates/munin/script/munin/example_simple.rb +24 -0
- data/generators/vulcanize/templates/munin/templates.yml +1 -0
- data/generators/vulcanize/templates/mysql/config/rubber/common/database.yml +12 -0
- data/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +169 -0
- data/generators/vulcanize/templates/mysql/config/rubber/role/db/apparmor-mysql.conf +46 -0
- data/generators/vulcanize/templates/mysql/config/rubber/role/db/crontab +14 -0
- data/generators/vulcanize/templates/mysql/config/rubber/role/db/monit-mysql.cnf +10 -0
- data/generators/vulcanize/templates/mysql/config/rubber/role/db/my.cnf +163 -0
- data/generators/vulcanize/templates/mysql/config/rubber/role/mysql_slave/mysql_slave_munin_plugin +51 -0
- data/generators/vulcanize/templates/mysql/config/rubber/rubber-mysql.yml +47 -0
- data/generators/vulcanize/templates/mysql/templates.yml +1 -0
- data/generators/vulcanize/templates/mysql_cluster/config/rubber/common/mysql_cluster_migrations.rb +13 -0
- data/generators/vulcanize/templates/mysql_cluster/config/rubber/deploy-mysql_cluster.rb +177 -0
- data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_data/my.cnf +15 -0
- data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_mgm/ndb_mgmd.cnf +39 -0
- data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/monit-mysql_cluster_sql.cnf +10 -0
- data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/my.cnf +23 -0
- data/generators/vulcanize/templates/mysql_cluster/config/rubber/rubber-mysql_cluster.yml +32 -0
- data/generators/vulcanize/templates/mysql_cluster/templates.yml +1 -0
- data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/database.yml +16 -0
- data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/monit-mysql_proxy.cnf +10 -0
- data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy +153 -0
- data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.conf +10 -0
- data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.lua +5 -0
- data/generators/vulcanize/templates/mysql_proxy/config/rubber/deploy-mysql_proxy.rb +52 -0
- data/generators/vulcanize/templates/mysql_proxy/config/rubber/rubber-mysql_proxy.yml +11 -0
- data/generators/vulcanize/templates/mysql_proxy/templates.yml +1 -0
- data/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb +45 -0
- data/generators/vulcanize/templates/nginx/config/rubber/role/nginx/crontab +9 -0
- data/generators/vulcanize/templates/nginx/config/rubber/role/nginx/monit-nginx.conf +8 -0
- data/generators/vulcanize/templates/nginx/config/rubber/role/nginx/nginx.conf +42 -0
- data/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/nginx-tools.conf +55 -0
- data/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-index.html +30 -0
- data/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-nginx.auth +7 -0
- data/generators/vulcanize/templates/nginx/config/rubber/rubber-nginx.yml +10 -0
- data/generators/vulcanize/templates/nginx/templates.yml +1 -0
- data/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +46 -0
- data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-memory.conf +34 -0
- data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +7 -0
- data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger.conf +47 -0
- data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +46 -0
- data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +35 -0
- data/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +15 -0
- data/generators/vulcanize/templates/passenger/templates.yml +3 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/common/database.yml +12 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +131 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/role/db/crontab +14 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/role/db/monit-postgresql.conf +10 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf +89 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql-sysctl.conf +6 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +504 -0
- data/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +45 -0
- data/generators/vulcanize/templates/postgresql/templates.yml +1 -0
- data/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +37 -0
- data/generators/vulcanize/templates/redis/config/rubber/role/redis/crontab +8 -0
- data/generators/vulcanize/templates/redis/config/rubber/role/redis/monit-redis.conf +9 -0
- data/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +141 -0
- data/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +4 -0
- data/generators/vulcanize/templates/redis/templates.yml +1 -0
- data/generators/vulcanize/templates/resque/config/initializers/resque.rb +15 -0
- data/generators/vulcanize/templates/resque/config/rubber/common/resque.yml +5 -0
- data/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb +58 -0
- data/generators/vulcanize/templates/resque/config/rubber/role/resque_web/monit-resque_web.conf +14 -0
- data/generators/vulcanize/templates/resque/config/rubber/role/resque_worker/monit-resque_worker.conf +19 -0
- data/generators/vulcanize/templates/resque/config/rubber/rubber-resque.yml +18 -0
- data/generators/vulcanize/templates/resque/script/resque_worker_management.rb +144 -0
- data/generators/vulcanize/templates/resque/templates.rb +1 -0
- data/generators/vulcanize/templates/resque/templates.yml +3 -0
- data/generators/vulcanize/templates/sphinx/config/rubber/common/sphinx.yml +46 -0
- data/generators/vulcanize/templates/sphinx/config/rubber/deploy-sphinx.rb +112 -0
- data/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/crontab +11 -0
- data/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/monit-sphinx.conf +13 -0
- data/generators/vulcanize/templates/sphinx/config/rubber/rubber-sphinx.yml +6 -0
- data/generators/vulcanize/templates/sphinx/templates.yml +1 -0
- data/generators/vulcanize/vulcanize_generator.rb +184 -0
- data/lib/capistrano/hostcmd.rb +12 -0
- data/lib/generators/vulcanize/USAGE +6 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb +51 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/deflate.conf +10 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/expires.conf +9 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/headers.conf +6 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/monit-apache.conf +8 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/ports.conf +8 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/setenvif.conf +52 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache-vhost.conf +79 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache.auth +7 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-index.html +34 -0
- data/lib/generators/vulcanize/templates/apache/config/rubber/rubber-apache.yml +6 -0
- data/lib/generators/vulcanize/templates/apache/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/base/Capfile +14 -0
- data/lib/generators/vulcanize/templates/base/Rakefile +23 -0
- data/lib/generators/vulcanize/templates/base/config/deploy.rb +56 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/common/crontab +22 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/common/monit-postfix.conf +8 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/common/rubber.profile +13 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/deploy-setup.rb +92 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/deploy-util.rb +97 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/rubber-dns.yml +78 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +33 -0
- data/lib/generators/vulcanize/templates/base/config/rubber/rubber.yml +233 -0
- data/lib/generators/vulcanize/templates/base/lib/tasks/rubber.rake +15 -0
- data/lib/generators/vulcanize/templates/base/script/cron-rake +18 -0
- data/lib/generators/vulcanize/templates/base/script/cron-runner +18 -0
- data/lib/generators/vulcanize/templates/base/script/cron-sh +67 -0
- data/lib/generators/vulcanize/templates/base/templates.rb +11 -0
- data/lib/generators/vulcanize/templates/base/templates.yml +6 -0
- data/lib/generators/vulcanize/templates/cassandra/config/rubber/deploy-cassandra.rb +88 -0
- data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.in.sh +60 -0
- data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.yaml +210 -0
- data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/log4j-server.properties +45 -0
- data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/monit-cassandra.conf +8 -0
- data/lib/generators/vulcanize/templates/cassandra/config/rubber/rubber-cassandra.yml +18 -0
- data/lib/generators/vulcanize/templates/cassandra/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf +23 -0
- data/lib/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/nginx/nginx-mongrel.conf +113 -0
- data/lib/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/rubber-complete.yml +41 -0
- data/lib/generators/vulcanize/templates/complete_mongrel_mysql/templates.yml +6 -0
- data/lib/generators/vulcanize/templates/complete_passenger/config/rubber/role/haproxy/haproxy-passenger.conf +21 -0
- data/lib/generators/vulcanize/templates/complete_passenger/config/rubber/rubber-complete.yml +40 -0
- data/lib/generators/vulcanize/templates/complete_passenger/templates.rb +9 -0
- data/lib/generators/vulcanize/templates/complete_passenger/templates.yml +9 -0
- data/lib/generators/vulcanize/templates/complete_passenger_mysql/templates.yml +4 -0
- data/lib/generators/vulcanize/templates/complete_passenger_postgresql/templates.yml +4 -0
- data/lib/generators/vulcanize/templates/cruise/config/rubber/deploy-cruise.rb +72 -0
- data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/cruise +40 -0
- data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/my.cnf +165 -0
- data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/production.rb +8 -0
- data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/site_config.rb +76 -0
- data/lib/generators/vulcanize/templates/cruise/config/rubber/role/web_tools/cruise-nginx.conf +11 -0
- data/lib/generators/vulcanize/templates/cruise/config/rubber/rubber-cruise.yml +18 -0
- data/lib/generators/vulcanize/templates/cruise/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb +45 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-base.conf +26 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-default.conf +8 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/monit-haproxy.conf +9 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslog-haproxy.conf +11 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslogd-default.conf +21 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/web_tools/haproxy-nginx.conf +10 -0
- data/lib/generators/vulcanize/templates/haproxy/config/rubber/rubber-haproxy.yml +7 -0
- data/lib/generators/vulcanize/templates/haproxy/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/jetty/config/rubber/deploy-jetty.rb +59 -0
- data/lib/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.sh +589 -0
- data/lib/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.xml +199 -0
- data/lib/generators/vulcanize/templates/jetty/config/rubber/role/jetty/monit-jetty.conf +9 -0
- data/lib/generators/vulcanize/templates/jetty/config/rubber/rubber-jetty.yml +10 -0
- data/lib/generators/vulcanize/templates/jetty/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/memcached/config/memcached.yml +28 -0
- data/lib/generators/vulcanize/templates/memcached/config/rubber/common/memcached.yml +14 -0
- data/lib/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached.conf +52 -0
- data/lib/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached_munin_plugin +249 -0
- data/lib/generators/vulcanize/templates/memcached/config/rubber/rubber-memcached.yml +7 -0
- data/lib/generators/vulcanize/templates/memcached/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/minimal_mysql/templates.yml +7 -0
- data/lib/generators/vulcanize/templates/minimal_nodb/templates.yml +6 -0
- data/lib/generators/vulcanize/templates/mongrel/config/rubber/deploy-mongrel.rb +75 -0
- data/lib/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/mongrel_cluster.yml +12 -0
- data/lib/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/monit-mongrel.conf +20 -0
- data/lib/generators/vulcanize/templates/mongrel/config/rubber/rubber-mongrel.yml +9 -0
- data/lib/generators/vulcanize/templates/mongrel/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/monit/config/rubber/common/monit-default.conf +15 -0
- data/lib/generators/vulcanize/templates/monit/config/rubber/common/monit.conf +252 -0
- data/lib/generators/vulcanize/templates/monit/config/rubber/deploy-monit.rb +33 -0
- data/lib/generators/vulcanize/templates/monit/config/rubber/role/web_tools/monit-admin-nginx.conf +10 -0
- data/lib/generators/vulcanize/templates/monit/config/rubber/rubber-monit.yml +6 -0
- data/lib/generators/vulcanize/templates/monit/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/common/monit-munin.conf +8 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/common/munin-node.conf +48 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/common/munin-plugins.conf +11 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/deploy-munin.rb +46 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-nginx.conf +8 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-plugins.conf +31 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin.conf +115 -0
- data/lib/generators/vulcanize/templates/munin/config/rubber/rubber-munin.yml +8 -0
- data/lib/generators/vulcanize/templates/munin/script/munin/example_mysql_query.rb +55 -0
- data/lib/generators/vulcanize/templates/munin/script/munin/example_simple.rb +24 -0
- data/lib/generators/vulcanize/templates/munin/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/common/database.yml +12 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +169 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/apparmor-mysql.conf +46 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/crontab +14 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/monit-mysql.cnf +10 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/my.cnf +163 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/role/mysql_slave/mysql_slave_munin_plugin +51 -0
- data/lib/generators/vulcanize/templates/mysql/config/rubber/rubber-mysql.yml +47 -0
- data/lib/generators/vulcanize/templates/mysql/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/common/mysql_cluster_migrations.rb +13 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/deploy-mysql_cluster.rb +177 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_data/my.cnf +15 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_mgm/ndb_mgmd.cnf +39 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/monit-mysql_cluster_sql.cnf +10 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/my.cnf +23 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/rubber-mysql_cluster.yml +32 -0
- data/lib/generators/vulcanize/templates/mysql_cluster/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/database.yml +16 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/monit-mysql_proxy.cnf +10 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy +153 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.conf +10 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.lua +5 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/deploy-mysql_proxy.rb +52 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/rubber-mysql_proxy.yml +11 -0
- data/lib/generators/vulcanize/templates/mysql_proxy/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb +45 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/role/nginx/crontab +9 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/role/nginx/monit-nginx.conf +8 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/role/nginx/nginx.conf +42 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/nginx-tools.conf +55 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-index.html +30 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-nginx.auth +7 -0
- data/lib/generators/vulcanize/templates/nginx/config/rubber/rubber-nginx.yml +10 -0
- data/lib/generators/vulcanize/templates/nginx/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +46 -0
- data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-memory.conf +34 -0
- data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +7 -0
- data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger.conf +47 -0
- data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +46 -0
- data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +35 -0
- data/lib/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +15 -0
- data/lib/generators/vulcanize/templates/passenger/templates.yml +3 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/common/database.yml +12 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +131 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/crontab +14 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/monit-postgresql.conf +10 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf +89 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql-sysctl.conf +6 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +504 -0
- data/lib/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +45 -0
- data/lib/generators/vulcanize/templates/postgresql/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +37 -0
- data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/crontab +8 -0
- data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/monit-redis.conf +9 -0
- data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +141 -0
- data/lib/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +4 -0
- data/lib/generators/vulcanize/templates/redis/templates.yml +1 -0
- data/lib/generators/vulcanize/templates/resque/config/initializers/resque.rb +15 -0
- data/lib/generators/vulcanize/templates/resque/config/rubber/common/resque.yml +5 -0
- data/lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb +58 -0
- data/lib/generators/vulcanize/templates/resque/config/rubber/role/resque_web/monit-resque_web.conf +14 -0
- data/lib/generators/vulcanize/templates/resque/config/rubber/role/resque_worker/monit-resque_worker.conf +19 -0
- data/lib/generators/vulcanize/templates/resque/config/rubber/rubber-resque.yml +18 -0
- data/lib/generators/vulcanize/templates/resque/script/resque_worker_management.rb +144 -0
- data/lib/generators/vulcanize/templates/resque/templates.rb +1 -0
- data/lib/generators/vulcanize/templates/resque/templates.yml +3 -0
- data/lib/generators/vulcanize/templates/sphinx/config/rubber/common/sphinx.yml +46 -0
- data/lib/generators/vulcanize/templates/sphinx/config/rubber/deploy-sphinx.rb +112 -0
- data/lib/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/crontab +11 -0
- data/lib/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/monit-sphinx.conf +13 -0
- data/lib/generators/vulcanize/templates/sphinx/config/rubber/rubber-sphinx.yml +6 -0
- data/lib/generators/vulcanize/templates/sphinx/templates.yml +1 -0
- data/lib/generators/vulcanize/vulcanize_generator.rb +184 -0
- data/lib/rubber.rb +76 -0
- data/lib/rubber/capistrano.rb +1 -0
- data/lib/rubber/cloud.rb +13 -0
- data/lib/rubber/cloud/aws.rb +355 -0
- data/lib/rubber/cloud/base.rb +16 -0
- data/lib/rubber/configuration.rb +47 -0
- data/lib/rubber/dns.rb +13 -0
- data/lib/rubber/dns/base.rb +84 -0
- data/lib/rubber/dns/dyndns.rb +77 -0
- data/lib/rubber/dns/nettica.rb +117 -0
- data/lib/rubber/dns/zerigo.rb +115 -0
- data/lib/rubber/environment.rb +177 -0
- data/lib/rubber/generator.rb +209 -0
- data/lib/rubber/instance.rb +176 -0
- data/lib/rubber/railtie.rb +14 -0
- data/lib/rubber/recipes/rubber.rb +96 -0
- data/lib/rubber/recipes/rubber/bundles.rb +30 -0
- data/lib/rubber/recipes/rubber/deploy.rb +90 -0
- data/lib/rubber/recipes/rubber/instances.rb +445 -0
- data/lib/rubber/recipes/rubber/load_balancers.rb +44 -0
- data/lib/rubber/recipes/rubber/security_groups.rb +189 -0
- data/lib/rubber/recipes/rubber/setup.rb +534 -0
- data/lib/rubber/recipes/rubber/spot_requests.rb +23 -0
- data/lib/rubber/recipes/rubber/static_ips.rb +190 -0
- data/lib/rubber/recipes/rubber/utils.rb +226 -0
- data/lib/rubber/recipes/rubber/volumes.rb +264 -0
- data/lib/rubber/tasks/rubber.rb +279 -0
- data/lib/rubber/util.rb +72 -0
- data/rails/init.rb +6 -0
- data/test/environment_test.rb +144 -0
- data/test/generator_test.rb +370 -0
- data/test/instance_test.rb +96 -0
- data/test/test_helper.rb +14 -0
- data/test/util_test.rb +19 -0
- data/test/zerigo_test.rb +88 -0
- metadata +494 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
# REQUIRED: The credentials for creating/accessong your app's database
|
3
|
+
#
|
4
|
+
db_user: "#{app_name[0,16]}"
|
5
|
+
db_pass:
|
6
|
+
db_name: "#{app_name}_#{RUBBER_ENV}"
|
7
|
+
|
8
|
+
db_slave_user: "#{('slave_' + db_user)[0,16]}"
|
9
|
+
db_replicator_user: "#{('replicator_' + db_user)[0,16]}"
|
10
|
+
|
11
|
+
# REQUIRED: The command to use to do a full backup of your database using
|
12
|
+
# "rake rubber:backup_db"
|
13
|
+
db_backup_cmd: "nice sudo -u postgres pg_dumpall -U postgres | gzip -c > %backup_file%"
|
14
|
+
|
15
|
+
# REQUIRED: The command to use to restore the database using
|
16
|
+
# "rake rubber:restore_db_s3"
|
17
|
+
# This command will receive the data generated by db_backup_cmd via
|
18
|
+
# its standard input
|
19
|
+
db_restore_cmd: "zcat - | psql -Uroot -h %host% %name%"
|
20
|
+
|
21
|
+
postgresql_ver: 8.4
|
22
|
+
postgresql_conf_dir: "/etc/postgresql/#{postgresql_ver}/main"
|
23
|
+
postgresql_data_dir: /mnt/postgresql/data
|
24
|
+
postgresql_archive_dir: /mnt/postgresql/archive
|
25
|
+
postgresql_pid_file: "/var/run/postgresql/#{postgresql_ver}-main.pid"
|
26
|
+
postgresql_ctl: "/usr/bin/env service postgresql-#{postgresql_ver}"
|
27
|
+
|
28
|
+
# Capistrano needs db:primary role for migrate to work,
|
29
|
+
# so we might as well just make consistent across the board
|
30
|
+
role_dependencies:
|
31
|
+
postgresql_master: [db:primary=true]
|
32
|
+
postgresql_slave: [db]
|
33
|
+
db:primary=true: [postgresql_master]
|
34
|
+
db: [postgresql_slave]
|
35
|
+
|
36
|
+
packages: [postgresql-client, libpq-dev]
|
37
|
+
gems: [pg]
|
38
|
+
|
39
|
+
roles:
|
40
|
+
postgresql_master:
|
41
|
+
db_server_id: 1
|
42
|
+
postgresql_slave:
|
43
|
+
db_server_id: 2
|
44
|
+
db:
|
45
|
+
packages: [postgresql]
|
@@ -0,0 +1 @@
|
|
1
|
+
description: The PostgreSQL database system
|
@@ -0,0 +1,37 @@
|
|
1
|
+
namespace :rubber do
|
2
|
+
|
3
|
+
namespace :redis do
|
4
|
+
|
5
|
+
rubber.allow_optional_tasks(self)
|
6
|
+
|
7
|
+
after "rubber:install_packages", "rubber:redis:custom_install"
|
8
|
+
|
9
|
+
task :custom_install, :roles => :redis do
|
10
|
+
custom_package('http://ftp.us.debian.org/debian/pool/main/r/redis/', 'redis-server', '1.2.6-1', '! -x /usr/bin/redis-server')
|
11
|
+
# force redis config regen so db dir gets recreated when creating staging from a bundle
|
12
|
+
rsudo "rm -f /etc/redis/redis.conf"
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Stops the redis server"
|
16
|
+
task :stop, :roles => :redis do
|
17
|
+
rsudo "/etc/init.d/redis-server stop; exit 0"
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Starts the redis server"
|
21
|
+
task :start, :roles => :redis do
|
22
|
+
rsudo "/etc/init.d/redis-server start"
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Restarts the redis server"
|
26
|
+
task :restart, :roles => :redis do
|
27
|
+
rsudo "/etc/init.d/redis-server restart"
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Reloads the redis server"
|
31
|
+
task :reload, :roles => :redis do
|
32
|
+
rsudo "/etc/init.d/redis-server restart"
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
@read_cmd = 'crontab -l'
|
3
|
+
@write_cmd = 'crontab -'
|
4
|
+
@additive = ['# start-redis-crontab', '# end-redis-crontab']
|
5
|
+
%>
|
6
|
+
|
7
|
+
# backup redis DBs every hour
|
8
|
+
0 * * * * BACKUP_DIR=/mnt/redis_backups BACKUP_NAME=redis BACKUP_CMD="tar -czf \%dir\%/redis_\%time_stamp\%.tgz <%= rubber_env.redis_db_dir %>" <%= RUBBER_ROOT %>/script/cron-rake rubber:backup
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%
|
2
|
+
@path = '/etc/monit/monit.d/monit-redis.conf'
|
3
|
+
%>
|
4
|
+
<% PIDFILE = "/var/run/redis.pid" %>
|
5
|
+
check process redis with pidfile <%= PIDFILE %>
|
6
|
+
group redis-<%= RUBBER_ENV %>
|
7
|
+
start program = "/etc/init.d/redis-server start"
|
8
|
+
stop program = "/etc/init.d/redis-server stop"
|
9
|
+
if failed host <%= rubber_env.host %> port 6379 with timeout 10 seconds for 10 cycles then restart
|
@@ -0,0 +1,141 @@
|
|
1
|
+
<%
|
2
|
+
@path = '/etc/redis/redis.conf'
|
3
|
+
@post = <<-SCRIPT
|
4
|
+
mkdir -p #{rubber_env.redis_db_dir}
|
5
|
+
chown -R redis:redis #{rubber_env.redis_db_dir}
|
6
|
+
/etc/init.d/redis-server restart
|
7
|
+
SCRIPT
|
8
|
+
%>
|
9
|
+
|
10
|
+
# Redis configuration file example
|
11
|
+
|
12
|
+
# By default Redis does not run as a daemon. Use 'yes' if you need it.
|
13
|
+
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
|
14
|
+
daemonize yes
|
15
|
+
|
16
|
+
# When run as a daemon, Redis write a pid file in /var/run/redis.pid by default.
|
17
|
+
# You can specify a custom pid file location here.
|
18
|
+
pidfile /var/run/redis.pid
|
19
|
+
|
20
|
+
# Accept connections on the specified port, default is 6379
|
21
|
+
port 6379
|
22
|
+
|
23
|
+
# If you want you can bind a single interface, if the bind option is not
|
24
|
+
# specified all the interfaces will listen for connections.
|
25
|
+
#
|
26
|
+
# bind 127.0.0.1
|
27
|
+
|
28
|
+
# Close the connection after a client is idle for N seconds (0 to disable)
|
29
|
+
timeout 300
|
30
|
+
|
31
|
+
# Save the DB on disk:
|
32
|
+
#
|
33
|
+
# save <seconds> <changes>
|
34
|
+
#
|
35
|
+
# Will save the DB if both the given number of seconds and the given
|
36
|
+
# number of write operations against the DB occurred.
|
37
|
+
#
|
38
|
+
# In the example below the behaviour will be to save:
|
39
|
+
# after 900 sec (15 min) if at least 1 key changed
|
40
|
+
# after 300 sec (5 min) if at least 10 keys changed
|
41
|
+
# after 60 sec if at least 10000 keys changed
|
42
|
+
save 900 1
|
43
|
+
save 300 10
|
44
|
+
save 60 10000
|
45
|
+
|
46
|
+
# The filename where to dump the DB
|
47
|
+
dbfilename dump.rdb
|
48
|
+
|
49
|
+
# For default save/load DB in/from the working directory
|
50
|
+
# Note that you must specify a directory not a file name.
|
51
|
+
dir <%= rubber_env.redis_db_dir %>
|
52
|
+
|
53
|
+
# Set server verbosity to 'debug'
|
54
|
+
# it can be one of:
|
55
|
+
# debug (a lot of information, useful for development/testing)
|
56
|
+
# notice (moderately verbose, what you want in production probably)
|
57
|
+
# warning (only very important / critical messages are logged)
|
58
|
+
loglevel notice
|
59
|
+
|
60
|
+
# Specify the log file name. Also 'stdout' can be used to force
|
61
|
+
# the demon to log on the standard output. Note that if you use standard
|
62
|
+
# output for logging but daemonize, logs will be sent to /dev/null
|
63
|
+
logfile /var/log/redis/redis-server.log
|
64
|
+
|
65
|
+
# Set the number of databases. The default database is DB 0, you can select
|
66
|
+
# a different one on a per-connection basis using SELECT <dbid> where
|
67
|
+
# dbid is a number between 0 and 'databases'-1
|
68
|
+
databases 16
|
69
|
+
|
70
|
+
################################# REPLICATION #################################
|
71
|
+
|
72
|
+
# Master-Slave replication. Use slaveof to make a Redis instance a copy of
|
73
|
+
# another Redis server. Note that the configuration is local to the slave
|
74
|
+
# so for example it is possible to configure the slave to save the DB with a
|
75
|
+
# different interval, or to listen to another port, and so on.
|
76
|
+
|
77
|
+
# slaveof <masterip> <masterport>
|
78
|
+
|
79
|
+
################################## SECURITY ###################################
|
80
|
+
|
81
|
+
# Require clients to issue AUTH <PASSWORD> before processing any other
|
82
|
+
# commands. This might be useful in environments in which you do not trust
|
83
|
+
# others with access to the host running redis-server.
|
84
|
+
#
|
85
|
+
# This should stay commented out for backward compatibility and because most
|
86
|
+
# people do not need auth (e.g. they run their own servers).
|
87
|
+
|
88
|
+
# requirepass foobared
|
89
|
+
|
90
|
+
################################### LIMITS ####################################
|
91
|
+
|
92
|
+
# Set the max number of connected clients at the same time. By default there
|
93
|
+
# is no limit, and it's up to the number of file descriptors the Redis process
|
94
|
+
# is able to open. The special value '0' means no limts.
|
95
|
+
# Once the limit is reached Redis will close all the new connections sending
|
96
|
+
# an error 'max number of clients reached'.
|
97
|
+
|
98
|
+
# maxclients 128
|
99
|
+
|
100
|
+
# Don't use more memory than the specified amount of bytes.
|
101
|
+
# When the memory limit is reached Redis will try to remove keys with an
|
102
|
+
# EXPIRE set. It will try to start freeing keys that are going to expire
|
103
|
+
# in little time and preserve keys with a longer time to live.
|
104
|
+
# Redis will also try to remove objects from free lists if possible.
|
105
|
+
#
|
106
|
+
# If all this fails, Redis will start to reply with errors to commands
|
107
|
+
# that will use more memory, like SET, LPUSH, and so on, and will continue
|
108
|
+
# to reply to most read-only commands like GET.
|
109
|
+
#
|
110
|
+
# WARNING: maxmemory can be a good idea mainly if you want to use Redis as a
|
111
|
+
# 'state' server or cache, not as a real DB. When Redis is used as a real
|
112
|
+
# database the memory usage will grow over the weeks, it will be obvious if
|
113
|
+
# it is going to use too much memory in the long run, and you'll have the time
|
114
|
+
# to upgrade. With maxmemory after the limit is reached you'll start to get
|
115
|
+
# errors for write operations, and this may even lead to DB inconsistency.
|
116
|
+
|
117
|
+
# maxmemory <bytes>
|
118
|
+
|
119
|
+
############################### ADVANCED CONFIG ###############################
|
120
|
+
|
121
|
+
# Glue small output buffers together in order to send small replies in a
|
122
|
+
# single TCP packet. Uses a bit more CPU but most of the times it is a win
|
123
|
+
# in terms of number of queries per second. Use 'yes' if unsure.
|
124
|
+
glueoutputbuf yes
|
125
|
+
|
126
|
+
# Use object sharing. Can save a lot of memory if you have many common
|
127
|
+
# string in your dataset, but performs lookups against the shared objects
|
128
|
+
# pool so it uses more CPU and can be a bit slower. Usually it's a good
|
129
|
+
# idea.
|
130
|
+
#
|
131
|
+
# When object sharing is enabled (shareobjects yes) you can use
|
132
|
+
# shareobjectspoolsize to control the size of the pool used in order to try
|
133
|
+
# object sharing. A bigger pool size will lead to better sharing capabilities.
|
134
|
+
# In general you want this value to be at least the double of the number of
|
135
|
+
# very common strings you have in your dataset.
|
136
|
+
#
|
137
|
+
# WARNING: object sharing is experimental, don't enable this feature
|
138
|
+
# in production before of Redis 1.0-stable. Still please try this feature in
|
139
|
+
# your development environment so that we can test it better.
|
140
|
+
shareobjects no
|
141
|
+
shareobjectspoolsize 1024
|
@@ -0,0 +1 @@
|
|
1
|
+
description: The redis module
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'resque'
|
3
|
+
|
4
|
+
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
|
5
|
+
rails_env = ENV['RAILS_ENV'] || 'development'
|
6
|
+
|
7
|
+
redis_host = 'localhost:6379'
|
8
|
+
|
9
|
+
resque_yml = rails_root + '/config/resque.yml'
|
10
|
+
if File.exist? resque_yml
|
11
|
+
resque_config = YAML.load_file(resque_yml)
|
12
|
+
redis_host = resque_config[rails_env]
|
13
|
+
end
|
14
|
+
|
15
|
+
Resque.redis = redis_host
|
@@ -0,0 +1,58 @@
|
|
1
|
+
|
2
|
+
namespace :rubber do
|
3
|
+
|
4
|
+
namespace :resque do
|
5
|
+
|
6
|
+
rubber.allow_optional_tasks(self)
|
7
|
+
|
8
|
+
namespace :worker do
|
9
|
+
|
10
|
+
rubber.allow_optional_tasks(self)
|
11
|
+
|
12
|
+
before "deploy:stop", "rubber:resque:worker:stop"
|
13
|
+
after "deploy:start", "rubber:resque:worker:start"
|
14
|
+
after "deploy:restart", "rubber:resque:worker:restart"
|
15
|
+
|
16
|
+
desc "Starts resque workers"
|
17
|
+
task :start, :roles => :resque_worker do
|
18
|
+
rsudo "cd #{current_path} && RUBBER_ENV=#{rails_env} ./script/resque_worker_management.rb start", :as => rubber_env.app_user
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "Stops resque workers"
|
22
|
+
task :stop, :roles => :resque_worker do
|
23
|
+
rsudo "cd #{current_path} && RUBBER_ENV=#{rails_env} ./script/resque_worker_management.rb stop", :as => rubber_env.app_user
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "Restarts resque workers"
|
27
|
+
task :restart, :roles => :resque_worker do
|
28
|
+
rsudo "cd #{current_path} && RUBBER_ENV=#{rails_env} ./script/resque_worker_management.rb restart", :as => rubber_env.app_user
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
namespace :web do
|
33
|
+
rubber.allow_optional_tasks(self)
|
34
|
+
|
35
|
+
before "deploy:stop", "rubber:resque:web:stop"
|
36
|
+
after "deploy:start", "rubber:resque:web:start"
|
37
|
+
after "deploy:restart", "rubber:resque:web:restart"
|
38
|
+
|
39
|
+
desc "Starts resque web tools"
|
40
|
+
task :start, :roles => :resque_web do
|
41
|
+
rsudo "RAILS_ENV=#{RUBBER_ENV} resque-web --pid-file /var/run/resque_web.pid --port #{rubber_env.resque_web_port} --no-launch #{current_path}/config/initializers/resque.rb"
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Stops resque web tools"
|
45
|
+
task :stop, :roles => :resque_web do
|
46
|
+
rsudo "RAILS_ENV=#{RUBBER_ENV} resque-web --pid-file /var/run/resque_web.pid --kill"
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "Restarts resque web tools"
|
50
|
+
task :restart, :roles => :resque_web do
|
51
|
+
rubber.resque.web.stop
|
52
|
+
rubber.resque.web.start
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
data/lib/generators/vulcanize/templates/resque/config/rubber/role/resque_web/monit-resque_web.conf
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
<%
|
2
|
+
@path = '/etc/monit/monit.d/monit-resque_web.conf'
|
3
|
+
|
4
|
+
PIDFILE = "/var/run/resque_web.pid"
|
5
|
+
start_program = "HOME=/root resque-web --pid-file #{PIDFILE} --port #{rubber_env.resque_web_port} --no-launch #{RUBBER_ROOT}/config/initializers/resque.rb"
|
6
|
+
stop_program = "HOME=/root resque-web --pid-file #{PIDFILE} --kill"
|
7
|
+
%>
|
8
|
+
|
9
|
+
check process resque_web with pidfile <%= PIDFILE %>
|
10
|
+
group resque_web
|
11
|
+
start program = "/bin/bash -l -c '<%= start_program %>'"
|
12
|
+
stop program = "/bin/bash -l -c '<%= stop_program %>'"
|
13
|
+
|
14
|
+
if totalmem > 350.0 MB for 15 cycles then restart
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%
|
2
|
+
@path = '/etc/monit/monit.d/monit-resque_worker.conf'
|
3
|
+
%>
|
4
|
+
|
5
|
+
<% rubber_env.resque_workers.each_with_index do |worker, i| %>
|
6
|
+
<%
|
7
|
+
PIDFILE = "#{RUBBER_ROOT}/tmp/pids/resque_worker_#{i}.pid"
|
8
|
+
|
9
|
+
start_program = "/usr/bin/sudo -H -u #{rubber_env.app_user} bash -l -c 'cd #{RUBBER_ROOT} && ./script/resque_worker_management.rb start #{i}'"
|
10
|
+
stop_program = "/usr/bin/sudo -H -u #{rubber_env.app_user} bash -l -c 'cd #{RUBBER_ROOT} && ./script/resque_worker_management.rb stop #{i} TERM'"
|
11
|
+
%>
|
12
|
+
|
13
|
+
check process resque_worker_<%= i %> with pidfile <%= PIDFILE %>
|
14
|
+
group resque_worker
|
15
|
+
start program = "<%= start_program %>"
|
16
|
+
stop program = "<%= stop_program %>"
|
17
|
+
|
18
|
+
if totalmem > 350.0 MB for 15 cycles then restart
|
19
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
resque_web_port: 5678
|
2
|
+
|
3
|
+
# list of workers with the queues to be run on each - on each worker instance,
|
4
|
+
# a worker is run for each item in this list to handle the queues specified
|
5
|
+
#
|
6
|
+
resque_workers:
|
7
|
+
-
|
8
|
+
queues: *
|
9
|
+
poll_interval: 1
|
10
|
+
-
|
11
|
+
queues: *
|
12
|
+
poll_interval: 1
|
13
|
+
|
14
|
+
gems: [yajl-ruby resque]
|
15
|
+
|
16
|
+
role_dependencies:
|
17
|
+
web_tools: [resque_web]
|
18
|
+
|
@@ -0,0 +1,144 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
STDOUT.sync = true
|
4
|
+
STDERR.sync = true
|
5
|
+
|
6
|
+
def load_env(rubber_only=true)
|
7
|
+
env = ENV["RUBBER_ENV"] ||= "development"
|
8
|
+
root = File.expand_path('../..', __FILE__)
|
9
|
+
rails_env_file = File.join(root, 'config', 'environment.rb')
|
10
|
+
|
11
|
+
if ! rubber_only && File.exists?(rails_env_file)
|
12
|
+
require(rails_env_file)
|
13
|
+
else
|
14
|
+
require "bundler/setup" if File.exist?(File.join(root, "Gemfile"))
|
15
|
+
require "rubber"
|
16
|
+
Rubber::initialize(root, env)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def start_all(workers)
|
22
|
+
puts "Starting all workers"
|
23
|
+
# fork then load rails env so script runs quick, yet we don't overload
|
24
|
+
# machine by loading env for each worker
|
25
|
+
daemonize(log_file('all')) do
|
26
|
+
load_env(false)
|
27
|
+
puts "Preloaded environment for all workers"
|
28
|
+
|
29
|
+
workers.each_with_index do |worker, i|
|
30
|
+
start(worker, i)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def start(worker, index)
|
36
|
+
puts "Starting worker #{index}/#{worker.queues}"
|
37
|
+
|
38
|
+
log_file = log_file(index)
|
39
|
+
pid_file = pid_file(index)
|
40
|
+
|
41
|
+
queues = worker.queues.to_s.split(',')
|
42
|
+
|
43
|
+
daemonize(log_file, pid_file) do
|
44
|
+
# load env for each worker, if starting multiple, this will be a no-op due
|
45
|
+
# to start_all preloading the env
|
46
|
+
load_env(false)
|
47
|
+
resque_worker = Resque::Worker.new(*queues)
|
48
|
+
resque_worker.verbose = ENV['LOGGING'] || ENV['VERBOSE']
|
49
|
+
resque_worker.very_verbose = ENV['VVERBOSE']
|
50
|
+
|
51
|
+
puts "*** Starting worker #{resque_worker}"
|
52
|
+
resque_worker.work(worker.poll_interval.to_i || 5) # interval, will block
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
def stop_all(workers, signal)
|
58
|
+
puts "Stopping all workers"
|
59
|
+
workers.size.times do |i|
|
60
|
+
stop(i, signal)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Resque workers respond to a few different signals:
|
65
|
+
#
|
66
|
+
# QUIT - Wait for child to finish processing then exit
|
67
|
+
# TERM / INT - Immediately kill child then exit
|
68
|
+
# USR1 - Immediately kill child but don't exit
|
69
|
+
# USR2 - Don't start to process any new jobs
|
70
|
+
# CONT - Start to process new jobs again after a USR2
|
71
|
+
def stop(index, signal)
|
72
|
+
puts "Stopping worker #{index}"
|
73
|
+
|
74
|
+
pid_file = pid_file(index)
|
75
|
+
pid = File.read(pid_file).to_i rescue nil
|
76
|
+
if pid
|
77
|
+
puts "Killing worker #{index}: pid #{pid} - #{signal}"
|
78
|
+
begin
|
79
|
+
Process.kill(signal, pid)
|
80
|
+
rescue Exception => e
|
81
|
+
puts e
|
82
|
+
end
|
83
|
+
File.delete(pid_file) if File.exist?(pid_file)
|
84
|
+
else
|
85
|
+
puts "No pid file for worker #{index}: #{pid_file}"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def daemonize(log_file, pid_file=nil)
|
90
|
+
return if fork
|
91
|
+
Process::setsid
|
92
|
+
exit!(0) if fork
|
93
|
+
Dir::chdir(Rubber.root)
|
94
|
+
File.umask 0000
|
95
|
+
FileUtils.touch log_file
|
96
|
+
STDIN.reopen log_file
|
97
|
+
STDOUT.reopen log_file, "a"
|
98
|
+
STDERR.reopen log_file, "a"
|
99
|
+
STDOUT.sync = true
|
100
|
+
STDERR.sync = true
|
101
|
+
|
102
|
+
File.open(pid_file, 'w') {|f| f.write("#{Process.pid}") } if pid_file
|
103
|
+
|
104
|
+
yield if block_given?
|
105
|
+
exit(0)
|
106
|
+
end
|
107
|
+
|
108
|
+
def pid_file(index)
|
109
|
+
File.expand_path "#{Rubber.root}/tmp/pids/resque_worker_#{index}.pid"
|
110
|
+
end
|
111
|
+
|
112
|
+
def log_file(index)
|
113
|
+
File.expand_path "#{Rubber.root}/log/resque_worker_#{index}.log"
|
114
|
+
end
|
115
|
+
|
116
|
+
action = ARGV[0]
|
117
|
+
worker_index = ARGV[1] ? ARGV[1].to_i : nil
|
118
|
+
signal = ARGV[2] || "QUIT"
|
119
|
+
if action.nil? || ! %w[start stop restart].include?(action)
|
120
|
+
puts "Usage: script/resque_worker_management.rb [start|stop|restart]"
|
121
|
+
end
|
122
|
+
|
123
|
+
# load just the rubber env so things run quickly
|
124
|
+
load_env(true)
|
125
|
+
workers = Rubber.config.resque_workers
|
126
|
+
|
127
|
+
case action
|
128
|
+
when 'start'
|
129
|
+
worker_index ? start(workers[worker_index], worker_index) : start_all(workers)
|
130
|
+
# sleep a bit to allow daemonization to complete
|
131
|
+
sleep 0.5
|
132
|
+
when 'stop'
|
133
|
+
worker_index ? stop(worker_index, signal) : stop_all(workers, signal)
|
134
|
+
when 'restart'
|
135
|
+
if worker_index
|
136
|
+
stop(worker_index, signal)
|
137
|
+
start(workers[worker_index], worker_index)
|
138
|
+
else
|
139
|
+
stop_all(workers, signal)
|
140
|
+
start_all(workers)
|
141
|
+
end
|
142
|
+
# sleep a bit to allow daemonization to complete
|
143
|
+
sleep 0.5
|
144
|
+
end
|