rubber 1.3.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (277) hide show
  1. data/CHANGELOG +7 -0
  2. data/VERSION +1 -1
  3. data/bin/vulcanize +16 -32
  4. data/generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb +6 -6
  5. data/generators/vulcanize/templates/apache/config/rubber/role/apache/monit-apache.conf +2 -2
  6. data/generators/vulcanize/templates/apache/config/rubber/role/apache/ports.conf +3 -0
  7. data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache-vhost.conf +29 -16
  8. data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-index.html +1 -1
  9. data/generators/vulcanize/templates/base/Rakefile +21 -0
  10. data/generators/vulcanize/templates/base/config/rubber/common/crontab +6 -1
  11. data/generators/vulcanize/templates/base/config/rubber/common/monit-postfix.conf +2 -2
  12. data/generators/vulcanize/templates/base/config/rubber/common/rubber.profile +3 -4
  13. data/generators/vulcanize/templates/base/config/rubber/deploy-setup.rb +27 -48
  14. data/generators/vulcanize/templates/base/config/rubber/deploy-util.rb +97 -0
  15. data/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +25 -0
  16. data/generators/vulcanize/templates/base/config/rubber/rubber.yml +7 -12
  17. data/generators/vulcanize/templates/base/script/cron-runner +1 -1
  18. data/generators/vulcanize/templates/base/templates.rb +9 -0
  19. data/generators/vulcanize/templates/base/templates.yml +5 -0
  20. data/generators/vulcanize/templates/cassandra/config/rubber/deploy-cassandra.rb +88 -0
  21. data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.in.sh +58 -0
  22. data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.yaml +210 -0
  23. data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/log4j-server.properties +45 -0
  24. data/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/monit-cassandra.conf +8 -0
  25. data/generators/vulcanize/templates/cassandra/config/rubber/rubber-cassandra.yml +18 -0
  26. data/generators/vulcanize/templates/cassandra/templates.yml +1 -0
  27. data/generators/vulcanize/templates/{complete_passenger_mysql → complete_passenger}/config/rubber/role/haproxy/haproxy-passenger.conf +1 -1
  28. data/generators/vulcanize/templates/{complete_passenger_mysql → complete_passenger}/config/rubber/rubber-complete.yml +0 -0
  29. data/generators/vulcanize/templates/complete_passenger/templates.rb +9 -0
  30. data/generators/vulcanize/templates/complete_passenger/templates.yml +9 -0
  31. data/generators/vulcanize/templates/complete_passenger_mysql/templates.yml +1 -7
  32. data/generators/vulcanize/templates/complete_passenger_postgresql/templates.yml +4 -0
  33. data/generators/vulcanize/templates/cruise/config/rubber/deploy-cruise.rb +3 -3
  34. data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/my.cnf +1 -1
  35. data/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb +5 -5
  36. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/monit-haproxy.conf +2 -2
  37. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslog-haproxy.conf +1 -1
  38. data/generators/vulcanize/templates/jetty/config/rubber/deploy-jetty.rb +4 -4
  39. data/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached.conf +1 -1
  40. data/generators/vulcanize/templates/mongrel/config/rubber/deploy-mongrel.rb +4 -4
  41. data/generators/vulcanize/templates/monit/config/rubber/common/monit.conf +2 -0
  42. data/generators/vulcanize/templates/monit/config/rubber/deploy-monit.rb +3 -3
  43. data/generators/vulcanize/templates/munin/config/rubber/common/monit-munin.conf +2 -2
  44. data/generators/vulcanize/templates/munin/config/rubber/common/munin-node.conf +1 -1
  45. data/generators/vulcanize/templates/munin/config/rubber/common/munin-plugins.conf +4 -2
  46. data/generators/vulcanize/templates/munin/config/rubber/deploy-munin.rb +4 -4
  47. data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-plugins.conf +2 -2
  48. data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin.conf +1 -0
  49. data/generators/vulcanize/templates/munin/config/rubber/rubber-munin.yml +1 -1
  50. data/generators/vulcanize/templates/munin/script/munin/example_mysql_query.rb +6 -8
  51. data/generators/vulcanize/templates/mysql/config/rubber/common/database.yml +1 -0
  52. data/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +24 -109
  53. data/generators/vulcanize/templates/mysql/config/rubber/role/db/apparmor-mysql.conf +1 -1
  54. data/generators/vulcanize/templates/mysql/config/rubber/role/db/monit-mysql.cnf +2 -2
  55. data/generators/vulcanize/templates/mysql/config/rubber/rubber-mysql.yml +1 -1
  56. data/generators/vulcanize/templates/mysql_cluster/config/rubber/deploy-mysql_cluster.rb +19 -15
  57. data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/monit-mysql_cluster_sql.cnf +2 -2
  58. data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/monit-mysql_proxy.cnf +2 -2
  59. data/generators/vulcanize/templates/mysql_proxy/config/rubber/deploy-mysql_proxy.rb +3 -3
  60. data/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb +5 -5
  61. data/generators/vulcanize/templates/nginx/config/rubber/role/nginx/monit-nginx.conf +2 -2
  62. data/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +10 -1
  63. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-memory.conf +1 -1
  64. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +2 -2
  65. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger.conf +1 -1
  66. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +3 -3
  67. data/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +2 -2
  68. data/generators/vulcanize/templates/postgresql/config/rubber/common/database.yml +12 -0
  69. data/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +131 -0
  70. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/crontab +14 -0
  71. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/monit-postgresql.conf +10 -0
  72. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf +89 -0
  73. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql-sysctl.conf +6 -0
  74. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +504 -0
  75. data/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +45 -0
  76. data/generators/vulcanize/templates/postgresql/templates.yml +1 -0
  77. data/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +8 -7
  78. data/generators/vulcanize/templates/resque/config/initializers/resque.rb +15 -0
  79. data/generators/vulcanize/templates/resque/config/rubber/common/resque.yml +5 -0
  80. data/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb +46 -27
  81. data/generators/vulcanize/templates/resque/config/rubber/role/resque_web/monit-resque_web.conf +14 -0
  82. data/generators/vulcanize/templates/resque/config/rubber/role/resque_worker/monit-resque_worker.conf +19 -0
  83. data/generators/vulcanize/templates/resque/config/rubber/rubber-resque.yml +14 -6
  84. data/generators/vulcanize/templates/resque/script/resque_worker_management.rb +112 -0
  85. data/generators/vulcanize/templates/resque/templates.rb +1 -0
  86. data/generators/vulcanize/templates/sphinx/config/rubber/deploy-sphinx.rb +7 -8
  87. data/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/monit-sphinx.conf +7 -4
  88. data/generators/vulcanize/vulcanize_generator.rb +154 -49
  89. data/lib/generators/vulcanize/USAGE +6 -0
  90. data/lib/generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb +51 -0
  91. data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/deflate.conf +10 -0
  92. data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/expires.conf +9 -0
  93. data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/headers.conf +6 -0
  94. data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/monit-apache.conf +8 -0
  95. data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/ports.conf +8 -0
  96. data/lib/generators/vulcanize/templates/apache/config/rubber/role/apache/setenvif.conf +52 -0
  97. data/lib/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache-vhost.conf +79 -0
  98. data/lib/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache.auth +7 -0
  99. data/lib/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-index.html +34 -0
  100. data/lib/generators/vulcanize/templates/apache/config/rubber/rubber-apache.yml +6 -0
  101. data/lib/generators/vulcanize/templates/apache/templates.yml +1 -0
  102. data/lib/generators/vulcanize/templates/base/Capfile +14 -0
  103. data/lib/generators/vulcanize/templates/base/Rakefile +21 -0
  104. data/lib/generators/vulcanize/templates/base/config/deploy.rb +55 -0
  105. data/lib/generators/vulcanize/templates/base/config/rubber/common/crontab +22 -0
  106. data/lib/generators/vulcanize/templates/base/config/rubber/common/monit-postfix.conf +8 -0
  107. data/lib/generators/vulcanize/templates/base/config/rubber/common/rubber.profile +13 -0
  108. data/lib/generators/vulcanize/templates/base/config/rubber/deploy-setup.rb +63 -0
  109. data/lib/generators/vulcanize/templates/base/config/rubber/deploy-util.rb +97 -0
  110. data/lib/generators/vulcanize/templates/base/config/rubber/rubber-dns.yml +78 -0
  111. data/lib/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +25 -0
  112. data/lib/generators/vulcanize/templates/base/config/rubber/rubber.yml +235 -0
  113. data/lib/generators/vulcanize/templates/base/lib/tasks/rubber.rake +15 -0
  114. data/lib/generators/vulcanize/templates/base/script/cron-rake +18 -0
  115. data/lib/generators/vulcanize/templates/base/script/cron-runner +18 -0
  116. data/lib/generators/vulcanize/templates/base/script/cron-sh +67 -0
  117. data/lib/generators/vulcanize/templates/base/templates.rb +9 -0
  118. data/lib/generators/vulcanize/templates/base/templates.yml +6 -0
  119. data/lib/generators/vulcanize/templates/cassandra/config/rubber/deploy-cassandra.rb +88 -0
  120. data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.in.sh +58 -0
  121. data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/cassandra.yaml +210 -0
  122. data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/log4j-server.properties +45 -0
  123. data/lib/generators/vulcanize/templates/cassandra/config/rubber/role/cassandra/monit-cassandra.conf +8 -0
  124. data/lib/generators/vulcanize/templates/cassandra/config/rubber/rubber-cassandra.yml +18 -0
  125. data/lib/generators/vulcanize/templates/cassandra/templates.yml +1 -0
  126. data/lib/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf +23 -0
  127. data/lib/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/nginx/nginx-mongrel.conf +113 -0
  128. data/lib/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/rubber-complete.yml +41 -0
  129. data/lib/generators/vulcanize/templates/complete_mongrel_mysql/templates.yml +6 -0
  130. data/lib/generators/vulcanize/templates/complete_passenger/config/rubber/role/haproxy/haproxy-passenger.conf +21 -0
  131. data/lib/generators/vulcanize/templates/complete_passenger/config/rubber/rubber-complete.yml +40 -0
  132. data/lib/generators/vulcanize/templates/complete_passenger/templates.rb +9 -0
  133. data/lib/generators/vulcanize/templates/complete_passenger/templates.yml +9 -0
  134. data/lib/generators/vulcanize/templates/complete_passenger_mysql/templates.yml +4 -0
  135. data/lib/generators/vulcanize/templates/complete_passenger_postgresql/templates.yml +4 -0
  136. data/lib/generators/vulcanize/templates/cruise/config/rubber/deploy-cruise.rb +72 -0
  137. data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/cruise +40 -0
  138. data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/my.cnf +165 -0
  139. data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/production.rb +8 -0
  140. data/lib/generators/vulcanize/templates/cruise/config/rubber/role/cruise/site_config.rb +76 -0
  141. data/lib/generators/vulcanize/templates/cruise/config/rubber/role/web_tools/cruise-nginx.conf +11 -0
  142. data/lib/generators/vulcanize/templates/cruise/config/rubber/rubber-cruise.yml +18 -0
  143. data/lib/generators/vulcanize/templates/cruise/templates.yml +1 -0
  144. data/lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb +45 -0
  145. data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-base.conf +26 -0
  146. data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-default.conf +8 -0
  147. data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/monit-haproxy.conf +9 -0
  148. data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslog-haproxy.conf +11 -0
  149. data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslogd-default.conf +21 -0
  150. data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/web_tools/haproxy-nginx.conf +10 -0
  151. data/lib/generators/vulcanize/templates/haproxy/config/rubber/rubber-haproxy.yml +7 -0
  152. data/lib/generators/vulcanize/templates/haproxy/templates.yml +1 -0
  153. data/lib/generators/vulcanize/templates/jetty/config/rubber/deploy-jetty.rb +59 -0
  154. data/lib/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.sh +589 -0
  155. data/lib/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.xml +199 -0
  156. data/lib/generators/vulcanize/templates/jetty/config/rubber/role/jetty/monit-jetty.conf +9 -0
  157. data/lib/generators/vulcanize/templates/jetty/config/rubber/rubber-jetty.yml +10 -0
  158. data/lib/generators/vulcanize/templates/jetty/templates.yml +1 -0
  159. data/lib/generators/vulcanize/templates/memcached/config/memcached.yml +28 -0
  160. data/lib/generators/vulcanize/templates/memcached/config/rubber/common/memcached.yml +14 -0
  161. data/lib/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached.conf +52 -0
  162. data/lib/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached_munin_plugin +249 -0
  163. data/lib/generators/vulcanize/templates/memcached/config/rubber/rubber-memcached.yml +7 -0
  164. data/lib/generators/vulcanize/templates/memcached/templates.yml +1 -0
  165. data/lib/generators/vulcanize/templates/minimal_mysql/templates.yml +7 -0
  166. data/lib/generators/vulcanize/templates/minimal_nodb/templates.yml +6 -0
  167. data/lib/generators/vulcanize/templates/mongrel/config/rubber/deploy-mongrel.rb +75 -0
  168. data/lib/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/mongrel_cluster.yml +12 -0
  169. data/lib/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/monit-mongrel.conf +20 -0
  170. data/lib/generators/vulcanize/templates/mongrel/config/rubber/rubber-mongrel.yml +9 -0
  171. data/lib/generators/vulcanize/templates/mongrel/templates.yml +1 -0
  172. data/lib/generators/vulcanize/templates/monit/config/rubber/common/monit-default.conf +15 -0
  173. data/lib/generators/vulcanize/templates/monit/config/rubber/common/monit.conf +252 -0
  174. data/lib/generators/vulcanize/templates/monit/config/rubber/deploy-monit.rb +33 -0
  175. data/lib/generators/vulcanize/templates/monit/config/rubber/role/web_tools/monit-admin-nginx.conf +10 -0
  176. data/lib/generators/vulcanize/templates/monit/config/rubber/rubber-monit.yml +6 -0
  177. data/lib/generators/vulcanize/templates/monit/templates.yml +1 -0
  178. data/lib/generators/vulcanize/templates/munin/config/rubber/common/monit-munin.conf +8 -0
  179. data/lib/generators/vulcanize/templates/munin/config/rubber/common/munin-node.conf +48 -0
  180. data/lib/generators/vulcanize/templates/munin/config/rubber/common/munin-plugins.conf +11 -0
  181. data/lib/generators/vulcanize/templates/munin/config/rubber/deploy-munin.rb +46 -0
  182. data/lib/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-nginx.conf +8 -0
  183. data/lib/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-plugins.conf +31 -0
  184. data/lib/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin.conf +81 -0
  185. data/lib/generators/vulcanize/templates/munin/config/rubber/rubber-munin.yml +8 -0
  186. data/lib/generators/vulcanize/templates/munin/script/munin/example_mysql_query.rb +55 -0
  187. data/lib/generators/vulcanize/templates/munin/script/munin/example_simple.rb +24 -0
  188. data/lib/generators/vulcanize/templates/munin/templates.yml +1 -0
  189. data/lib/generators/vulcanize/templates/mysql/config/rubber/common/database.yml +12 -0
  190. data/lib/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +169 -0
  191. data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/apparmor-mysql.conf +46 -0
  192. data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/crontab +14 -0
  193. data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/monit-mysql.cnf +10 -0
  194. data/lib/generators/vulcanize/templates/mysql/config/rubber/role/db/my.cnf +163 -0
  195. data/lib/generators/vulcanize/templates/mysql/config/rubber/role/mysql_slave/mysql_slave_munin_plugin +51 -0
  196. data/lib/generators/vulcanize/templates/mysql/config/rubber/rubber-mysql.yml +47 -0
  197. data/lib/generators/vulcanize/templates/mysql/templates.yml +1 -0
  198. data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/common/mysql_cluster_migrations.rb +13 -0
  199. data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/deploy-mysql_cluster.rb +177 -0
  200. data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_data/my.cnf +15 -0
  201. data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_mgm/ndb_mgmd.cnf +39 -0
  202. data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/monit-mysql_cluster_sql.cnf +10 -0
  203. data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/my.cnf +23 -0
  204. data/lib/generators/vulcanize/templates/mysql_cluster/config/rubber/rubber-mysql_cluster.yml +32 -0
  205. data/lib/generators/vulcanize/templates/mysql_cluster/templates.yml +1 -0
  206. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/database.yml +16 -0
  207. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/monit-mysql_proxy.cnf +10 -0
  208. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy +153 -0
  209. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.conf +10 -0
  210. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.lua +5 -0
  211. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/deploy-mysql_proxy.rb +52 -0
  212. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/rubber-mysql_proxy.yml +11 -0
  213. data/lib/generators/vulcanize/templates/mysql_proxy/templates.yml +1 -0
  214. data/lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb +45 -0
  215. data/lib/generators/vulcanize/templates/nginx/config/rubber/role/nginx/crontab +9 -0
  216. data/lib/generators/vulcanize/templates/nginx/config/rubber/role/nginx/monit-nginx.conf +8 -0
  217. data/lib/generators/vulcanize/templates/nginx/config/rubber/role/nginx/nginx.conf +42 -0
  218. data/lib/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/nginx-tools.conf +55 -0
  219. data/lib/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-index.html +30 -0
  220. data/lib/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-nginx.auth +7 -0
  221. data/lib/generators/vulcanize/templates/nginx/config/rubber/rubber-nginx.yml +10 -0
  222. data/lib/generators/vulcanize/templates/nginx/templates.yml +1 -0
  223. data/lib/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +46 -0
  224. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-memory.conf +34 -0
  225. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +7 -0
  226. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger.conf +47 -0
  227. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +46 -0
  228. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +35 -0
  229. data/lib/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +15 -0
  230. data/lib/generators/vulcanize/templates/passenger/templates.yml +3 -0
  231. data/lib/generators/vulcanize/templates/postgresql/config/rubber/common/database.yml +12 -0
  232. data/lib/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +131 -0
  233. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/crontab +14 -0
  234. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/monit-postgresql.conf +10 -0
  235. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf +89 -0
  236. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql-sysctl.conf +6 -0
  237. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +504 -0
  238. data/lib/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +45 -0
  239. data/lib/generators/vulcanize/templates/postgresql/templates.yml +1 -0
  240. data/lib/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +37 -0
  241. data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/crontab +8 -0
  242. data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/monit-redis.conf +9 -0
  243. data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +141 -0
  244. data/lib/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +4 -0
  245. data/lib/generators/vulcanize/templates/redis/templates.yml +1 -0
  246. data/lib/generators/vulcanize/templates/resque/config/initializers/resque.rb +15 -0
  247. data/lib/generators/vulcanize/templates/resque/config/rubber/common/resque.yml +5 -0
  248. data/lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb +58 -0
  249. data/lib/generators/vulcanize/templates/resque/config/rubber/role/resque_web/monit-resque_web.conf +14 -0
  250. data/lib/generators/vulcanize/templates/resque/config/rubber/role/resque_worker/monit-resque_worker.conf +19 -0
  251. data/lib/generators/vulcanize/templates/resque/config/rubber/rubber-resque.yml +18 -0
  252. data/lib/generators/vulcanize/templates/resque/script/resque_worker_management.rb +112 -0
  253. data/lib/generators/vulcanize/templates/resque/templates.rb +1 -0
  254. data/lib/generators/vulcanize/templates/resque/templates.yml +3 -0
  255. data/lib/generators/vulcanize/templates/sphinx/config/rubber/common/sphinx.yml +46 -0
  256. data/lib/generators/vulcanize/templates/sphinx/config/rubber/deploy-sphinx.rb +112 -0
  257. data/lib/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/crontab +11 -0
  258. data/lib/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/monit-sphinx.conf +13 -0
  259. data/lib/generators/vulcanize/templates/sphinx/config/rubber/rubber-sphinx.yml +6 -0
  260. data/lib/generators/vulcanize/templates/sphinx/templates.yml +1 -0
  261. data/lib/generators/vulcanize/vulcanize_generator.rb +172 -0
  262. data/lib/rubber.rb +42 -6
  263. data/lib/rubber/cloud/aws.rb +4 -0
  264. data/lib/rubber/dns/zerigo.rb +9 -3
  265. data/lib/rubber/environment.rb +1 -1
  266. data/lib/rubber/generator.rb +8 -8
  267. data/lib/rubber/instance.rb +1 -1
  268. data/lib/rubber/railtie.rb +14 -0
  269. data/lib/rubber/recipes/rubber.rb +6 -0
  270. data/lib/rubber/recipes/rubber/deploy.rb +3 -3
  271. data/lib/rubber/recipes/rubber/setup.rb +22 -17
  272. data/lib/rubber/recipes/rubber/utils.rb +37 -14
  273. data/lib/rubber/util.rb +36 -1
  274. data/rails/init.rb +1 -4
  275. metadata +244 -35
  276. data/generators/vulcanize/templates/resque/config/rubber/deploy-resque-worker-default.rb +0 -38
  277. data/generators/vulcanize/templates/resque/config/rubber/role/resque_worker_default/monit-resque_worker_default.conf +0 -19
@@ -0,0 +1,46 @@
1
+ <%
2
+ @path = '/etc/apparmor.d/usr.sbin.mysqld'
3
+ @post = "service apparmor restart"
4
+ @backup = false
5
+ %>
6
+
7
+ #include <tunables/global>
8
+
9
+ /usr/sbin/mysqld {
10
+ #include <abstractions/base>
11
+ #include <abstractions/nameservice>
12
+ #include <abstractions/user-tmp>
13
+ #include <abstractions/mysql>
14
+ #include <abstractions/winbind>
15
+
16
+ capability dac_override,
17
+ capability sys_resource,
18
+ capability setgid,
19
+ capability setuid,
20
+
21
+ network tcp,
22
+
23
+ /etc/hosts.allow r,
24
+ /etc/hosts.deny r,
25
+
26
+ /etc/mysql/*.pem r,
27
+ /etc/mysql/conf.d/ r,
28
+ /etc/mysql/conf.d/* r,
29
+ /etc/mysql/my.cnf r,
30
+ /usr/sbin/mysqld mr,
31
+ /usr/share/mysql/** r,
32
+ /var/log/mysql.log rw,
33
+ /var/log/mysql.err rw,
34
+ /var/lib/mysql/ r,
35
+ /var/lib/mysql/** rwk,
36
+ /var/log/mysql/ r,
37
+ /var/log/mysql/* rw,
38
+ /var/run/mysqld/mysqld.pid w,
39
+ /var/run/mysqld/mysqld.sock w,
40
+
41
+ /sys/devices/system/cpu/ r,
42
+ /sys/devices/system/cpu/** r,
43
+
44
+ <%= rubber_env.db_root_dir %>/ r,
45
+ <%= rubber_env.db_root_dir %>/** rwk,
46
+ }
@@ -0,0 +1,14 @@
1
+ <%
2
+ @read_cmd = 'crontab -l'
3
+ @write_cmd = 'crontab -'
4
+ @additive = ["# rubber-mysql-start", "# rubber-mysql-end"]
5
+ %>
6
+
7
+ <%
8
+ # Backup db every 3 hours to secondary db if available, else primary db
9
+ backup_db_host = rubber_instances.for_role('db', {}).first rescue nil
10
+ backup_db_host ||= rubber_instances.for_role('db', 'primary' => true).first
11
+ if backup_db_host.name == rubber_env.host
12
+ %>
13
+ 0 */3 * * * BACKUP_DIR=/mnt/db_backups DBUSER=<%= rubber_env.db_user %> DBPASS=<%= rubber_env.db_pass %> DBNAME=<%= rubber_env.db_name %> DBHOST=<%= backup_db_host.full_name %> <%= RUBBER_ROOT %>/script/cron-rake rubber:backup_db
14
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <%
2
+ @path = '/etc/monit/monit.d/monit-mysql.conf'
3
+ %>
4
+
5
+ check process mysql with pidfile /var/run/mysqld/mysqld.pid
6
+ group mysql-<%= RUBBER_ENV %>
7
+ start program = "/usr/sbin/service mysql restart"
8
+ stop program = "/usr/sbin/service mysql stop"
9
+ if failed host 127.0.0.1 port 3306 protocol mysql then alert
10
+ if 5 restarts within 5 cycles then timeout
@@ -0,0 +1,163 @@
1
+ <%
2
+ data_dir = rubber_env.db_data_dir
3
+ log_dir = rubber_env.db_log_dir
4
+ server_id = rubber_env.db_server_id
5
+ @path = '/etc/mysql/my.cnf'
6
+ @post = "mkdir -p #{log_dir}; chown mysql:adm #{log_dir}; chmod 2750 #{log_dir}"
7
+ %>
8
+
9
+ # Generated by rubber for host <%= rubber_instances[rubber_env.host].external_ip %>
10
+ #
11
+ # The MySQL database server configuration file.
12
+ #
13
+ # You can copy this to one of:
14
+ # - "/etc/mysql/my.cnf" to set global options,
15
+ # - "~/.my.cnf" to set user-specific options.
16
+ #
17
+ # One can use all long options that the program supports.
18
+ # Run program with --help to get a list of available options and with
19
+ # --print-defaults to see which it would actually understand and use.
20
+ #
21
+ # For explanations see
22
+ # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
23
+
24
+ # This will be passed to all mysql clients
25
+ # It has been reported that passwords should be enclosed with ticks/quotes
26
+ # escpecially if they contain "#" chars...
27
+ # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
28
+ [client]
29
+ default-character-set = utf8
30
+ port = 3306
31
+ socket = /var/run/mysqld/mysqld.sock
32
+
33
+ # Here is entries for some specific programs
34
+ # The following values assume you have at least 32M ram
35
+
36
+ # This was formally known as [safe_mysqld]. Both versions are currently parsed.
37
+ [mysqld_safe]
38
+ socket = /var/run/mysqld/mysqld.sock
39
+ nice = 0
40
+
41
+ [mysqld]
42
+ #
43
+ # * Basic Settings
44
+ #
45
+ default-character-set = utf8
46
+ user = mysql
47
+ pid-file = /var/run/mysqld/mysqld.pid
48
+ socket = /var/run/mysqld/mysqld.sock
49
+ port = 3306
50
+ basedir = /usr
51
+ datadir = <%= data_dir %>
52
+ tmpdir = /tmp
53
+ language = /usr/share/mysql/english
54
+ skip-external-locking
55
+
56
+ #
57
+ # Instead of skip-networking the default is now to listen only on
58
+ # localhost which is more compatible and is not less secure.
59
+ # bind-address = 127.0.0.1
60
+ #
61
+ # * Fine Tuning
62
+ #
63
+ key_buffer = 16M
64
+ max_allowed_packet = 32M
65
+ thread_stack = 128K
66
+ thread_cache_size = 8
67
+ #table_cache=500
68
+ #max_heap_table_size=16M
69
+ #tmp_table_size=32M
70
+
71
+ #max_connections = 100
72
+ #table_cache = 64
73
+ #thread_concurrency = 10
74
+ #
75
+ # * Query Cache Configuration
76
+ #
77
+ query_cache_limit = 1M
78
+ query_cache_size = 16M
79
+ #
80
+ # * Logging and Replication
81
+ #
82
+ # Both location gets rotated by the cronjob.
83
+ # Be aware that this log type is a performance killer.
84
+ #log = /var/log/mysql/mysql.log
85
+ #
86
+ # Error logging goes to syslog. This is a Debian improvement :)
87
+ #
88
+ # Here you can see queries with especially long duration
89
+ log_slow_queries = /var/log/mysql/mysql-slow.log
90
+ long_query_time = 2
91
+ log-queries-not-using-indexes
92
+ #
93
+ # The following can be used as easy to replay backup logs or for replication.
94
+ # note: if you are setting up a replication slave, see README.Debian about
95
+ # other settings you may need to change.
96
+ server-id = <%= server_id %>
97
+ log_bin = <%= log_dir %>/mysql-bin.log
98
+ relay_log = <%= log_dir %>/mysql-relay-bin.log
99
+
100
+ # WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian!
101
+ expire_logs_days = 10
102
+ max_binlog_size = 100M
103
+ #binlog_do_db = include_database_name
104
+ #binlog_ignore_db = include_database_name
105
+
106
+
107
+ # * InnoDB
108
+ #
109
+ # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
110
+ # Read the manual for more InnoDB related options. There are many!
111
+ # You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
112
+ #skip-innodb
113
+
114
+ # Set buffer pool size to 50-80% of your computer's memory
115
+ #innodb_buffer_pool_size=512M
116
+ #innodb_additional_mem_pool_size=64M
117
+
118
+ # Set the log file size to about 25% of the buffer pool size
119
+ #innodb_log_file_size=128M
120
+ #innodb_log_buffer_size=32M
121
+ #innodb_flush_log_at_trx_commit=2
122
+
123
+ #
124
+ # * Security Features
125
+ #
126
+ # Read the manual, too, if you want chroot!
127
+ # chroot = /var/lib/mysql/
128
+ #
129
+ # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
130
+ #
131
+ # ssl-ca=/etc/mysql/cacert.pem
132
+ # ssl-cert=/etc/mysql/server-cert.pem
133
+ # ssl-key=/etc/mysql/server-key.pem
134
+
135
+
136
+
137
+ [mysqldump]
138
+ quick
139
+ quote-names
140
+ max_allowed_packet = 16M
141
+
142
+ [mysql]
143
+ #no-auto-rehash # faster start of mysql but no tab completition
144
+
145
+ [isamchk]
146
+ key_buffer = 16M
147
+
148
+ #
149
+ # * NDB Cluster
150
+ #
151
+ # See /usr/share/doc/mysql-server-*/README.Debian for more information.
152
+ #
153
+ # The following configuration is read by the NDB Data Nodes (ndbd processes)
154
+ # not from the NDB Management Nodes (ndb_mgmd processes).
155
+ #
156
+ # [MYSQL_CLUSTER]
157
+ # ndb-connectstring=127.0.0.1
158
+
159
+
160
+ #
161
+ # * IMPORTANT: Additional settings that can override those from this file!
162
+ #
163
+ !includedir /etc/mysql/conf.d/
@@ -0,0 +1,51 @@
1
+ <%
2
+ @path = "/etc/munin/plugins/mysql_slave"
3
+ @perms = 0755
4
+ %>#!/bin/sh
5
+ #
6
+ # Plugin to monitor the slave delay
7
+ #
8
+ # Parameters:
9
+ #
10
+ # config
11
+ # autoconf
12
+ #
13
+ # Configuration variables
14
+ #
15
+ # mysqlopts - Options to pass to mysql
16
+ #
17
+ #%# family=auto
18
+ #%# capabilities=autoconf
19
+
20
+ MYSQLOPTS="$mysqlopts"
21
+ MYSQLADMIN=${mysqladmin:-mysqladmin}
22
+
23
+ if [ "$1" = "autoconf" ]; then
24
+ $MYSQLADMIN --version 2>/dev/null >/dev/null
25
+ if [ $? -eq 0 ]
26
+ then
27
+ $MYSQLADMIN $MYSQLOPTS status 2>/dev/null >/dev/null
28
+ if [ $? -eq 0 ]
29
+ then
30
+ echo yes
31
+ exit 0
32
+ else
33
+ echo "no (could not connect to mysql)"
34
+ fi
35
+ else
36
+ echo "no (mysqladmin not found)"
37
+ fi
38
+ exit 1
39
+ fi
40
+
41
+ if [ "$1" = "config" ]; then
42
+ echo 'graph_title MySQL Slave Delay'
43
+ echo 'graph_vlabel seconds'
44
+ echo 'graph_category mysql'
45
+ echo 'slave.label slave delay'
46
+ echo 'graph_args --base 1000'
47
+ exit 0
48
+ fi
49
+
50
+ /usr/bin/printf "slave.value "
51
+ echo "show slave status\G"| mysql $MYSQLOPTS | grep "Seconds_Behind_Master" | awk '{print $2}'
@@ -0,0 +1,47 @@
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 mysqldump -h %host% -u %user% --password=%pass% %name% | gzip -c > %backup_file%"
14
+ # REQUIRED: The command to use to restore the database using
15
+ # "rake rubber:restore_db_s3"
16
+ # This command will receive the data generated by db_backup_cmd via
17
+ # its standard input
18
+ db_restore_cmd: "zcat - | mysql -h %host% -u %user% --password=%pass% %name%"
19
+
20
+ # REQUIRED: The directory to store the db data in
21
+ #
22
+ db_root_dir: /mnt/mysql
23
+ db_data_dir: "#{db_root_dir}/data"
24
+ db_log_dir: "#{db_root_dir}/log"
25
+
26
+ # Capistrano needs db:primary role for migrate to work,
27
+ # so we might as well just make consistent across the board
28
+ role_dependencies:
29
+ mysql_master: [db:primary=true]
30
+ mysql_slave: [db]
31
+ db:primary=true: [mysql_master]
32
+ db: [mysql_slave]
33
+
34
+ packages: [mysql-client, libmysqlclient15-dev]
35
+ gems: [mysql]
36
+
37
+ roles:
38
+ mysql_master:
39
+ db_server_id: 1
40
+ mysql_slave:
41
+ db_server_id: 2
42
+ db:
43
+ packages: [
44
+ mysql-server,
45
+ maatkit, # useful mysql tools for replication
46
+ libdbi-perl, libdbd-mysql, libcache-cache-perl # for extended munin plugins
47
+ ]
@@ -0,0 +1 @@
1
+ description: The mysql module
@@ -0,0 +1,13 @@
1
+ <%
2
+ @path = "#{RUBBER_ROOT}/config/initializers/mysql_cluster_migrations.rb"
3
+ %>
4
+
5
+ # mysql adapter in rails hardcodes engine to be innodb, so if we want all
6
+ # rails tables to be clustered, we need to override this behavior
7
+ #
8
+ class ActiveRecord::ConnectionAdapters::MysqlAdapter
9
+ def create_table(table_name, options = {}) #:nodoc:
10
+ super(table_name, options.reverse_merge(:options => "ENGINE=ndbcluster"))
11
+ end
12
+ end
13
+
@@ -0,0 +1,177 @@
1
+
2
+ namespace :rubber do
3
+
4
+ namespace :mysql_cluster do
5
+
6
+ rubber.allow_optional_tasks(self)
7
+
8
+ after "rubber:create", "rubber:mysql_cluster:set_db_role"
9
+
10
+ # Capistrano needs db:primary role for migrate to work
11
+ task :set_db_role do
12
+ sql_instances = rubber_instances.for_role("mysql_sql")
13
+ sql_instances.each do |instance|
14
+ if ! instance.role_names.find {|n| n == 'db'}
15
+ role = Rubber::Configuration::RoleItem.new('db')
16
+ primary_exists = rubber_instances.for_role("db", "primary" => true).size > 0
17
+ role.options["primary"] = true unless primary_exists
18
+ instance.roles << role
19
+ end
20
+ end
21
+ rubber_instances.save()
22
+ load_roles() unless rubber_env.disable_auto_roles
23
+ end
24
+
25
+ before "rubber:install_packages", "rubber:mysql_cluster:install"
26
+
27
+ task :install, :roles => [:mysql_mgm, :mysql_data, :mysql_sql] do
28
+ # Setup apt sources to get a newer version of mysql cluster
29
+ # https://launchpad.net/~mysql-cge-testing/+archive
30
+ #
31
+
32
+ sources = <<-SOURCES
33
+ # for mysql cluster 6.2
34
+ # deb http://ppa.launchpad.net/mysql-cge-testing/ubuntu hardy main
35
+ # deb-src http://ppa.launchpad.net/mysql-cge-testing/ubuntu hardy main
36
+
37
+ # for mysql cluster 6.3
38
+ deb http://ppa.launchpad.net/ndb-bindings/ubuntu hardy main
39
+ deb-src http://ppa.launchpad.net/ndb-bindings/ubuntu hardy main
40
+ SOURCES
41
+ sources.gsub!(/^ */, '')
42
+ put(sources, "/etc/apt/sources.list.d/mysql_cluster.list")
43
+ end
44
+
45
+ after "rubber:bootstrap", "rubber:mysql_cluster:bootstrap"
46
+
47
+ task :bootstrap, :roles => [:mysql_mgm, :mysql_data, :mysql_sql] do
48
+ # mysql package install starts mysql, so stop it
49
+ rsudo "service mysql stop" rescue nil
50
+
51
+ # After everything installed on machines, we need the source tree
52
+ # on hosts in order to run rubber:config for bootstrapping the db
53
+ rubber.update_code_for_bootstrap
54
+
55
+ # Conditionaly bootstrap for each node/role only if that node has not
56
+ # been boostrapped for that role before
57
+
58
+ rubber_instances.for_role("mysql_mgm").each do |ic|
59
+ task_name = "_bootstrap_mysql_mgm_#{ic.full_name}".to_sym()
60
+ task task_name, :hosts => ic.full_name do
61
+ exists = capture("if grep -c rubber.*mysql_mgm /etc/mysql/ndb_mgmd.cnf &> /dev/null; then echo exists; fi")
62
+ if exists.strip.size == 0
63
+ rubber.run_config(:RUBBER_ENV => RUBBER_ENV, :FILE => "role/mysql_mgm", :deploy_path => release_path)
64
+ rsudo "service mysql-ndb-mgm start"
65
+ end
66
+ end
67
+ send task_name
68
+ end
69
+
70
+ rubber_instances.for_role("mysql_data").each do |ic|
71
+ task_name = "_bootstrap_mysql_data_#{ic.full_name}".to_sym()
72
+ task task_name, :hosts => ic.full_name do
73
+ exists = capture("if grep -c rubber.*mysql_data /etc/mysql/my.cnf &> /dev/null; then echo exists; fi")
74
+ if exists.strip.size == 0
75
+ rubber.run_config(:RUBBER_ENV => RUBBER_ENV, :FILE => "role/mysql_data", :deploy_path => release_path)
76
+ rsudo "service mysql-ndb start-initial"
77
+ end
78
+ end
79
+ send task_name
80
+ end
81
+
82
+ rubber_instances.for_role("mysql_sql").each do |ic|
83
+ task_name = "_bootstrap_mysql_sql_#{ic.full_name}".to_sym()
84
+ task task_name, :hosts => ic.full_name do
85
+ exists = capture("if grep -c rubber.*mysql_sql /etc/mysql/my.cnf &> /dev/null; then echo exists; fi")
86
+ if exists.strip.size == 0
87
+ rubber.run_config(:RUBBER_ENV => RUBBER_ENV, :FILE => "role/mysql_sql", :deploy_path => release_path)
88
+ rsudo "service mysql start"
89
+ env = rubber_cfg.environment.bind()
90
+ # For mysql 5.0 cluster, need to create users and database for EVERY sql node
91
+ pass = "identified by '#{env.db_pass}'" if env.db_pass
92
+ rubber.sudo_script "create_mysql_sql_db", <<-ENDSCRIPT
93
+ mysql -u root -e "create database #{env.db_name};"
94
+ mysql -u root -e "grant all on *.* to '#{env.db_user}'@'%' #{pass};"
95
+ mysql -u root -e "grant select on *.* to '#{env.db_slave_user}'@'%' #{pass};"
96
+ mysql -u root -e "grant replication slave on *.* to '#{env.db_replicator_user}'@'%' #{pass};"
97
+ mysql -u root -e "flush privileges;"
98
+ ENDSCRIPT
99
+
100
+ end
101
+ end
102
+ send task_name
103
+ end
104
+
105
+ end
106
+
107
+ desc <<-DESC
108
+ Starts the mysql cluster management daemon on the management node
109
+ DESC
110
+ task :start_mgm, :roles => :mysql_mgm do
111
+ rsudo "service mysql-ndb-mgm start"
112
+ end
113
+
114
+ desc <<-DESC
115
+ Starts the mysql cluster storage daemon on the data nodes
116
+ DESC
117
+ task :start_data, :roles => :mysql_data do
118
+ rsudo "service mysql-ndb start"
119
+ end
120
+
121
+ desc <<-DESC
122
+ Starts the mysql cluster sql daemon on the sql nodes
123
+ DESC
124
+ task :start_sql, :roles => :mysql_sql do
125
+ rsudo "service mysql start"
126
+ end
127
+
128
+ desc <<-DESC
129
+ Stops the mysql cluster management daemon on the management node
130
+ DESC
131
+ task :stop_mgm, :roles => :mysql_mgm do
132
+ rsudo "service mysql-ndb-mgm stop"
133
+ end
134
+
135
+ desc <<-DESC
136
+ Stops the mysql cluster storage daemon on the data nodes
137
+ DESC
138
+ task :stop_data, :roles => :mysql_data do
139
+ rsudo "service mysql-ndb stop"
140
+ end
141
+
142
+ desc <<-DESC
143
+ Stops the mysql cluster sql daemon on the sql nodes
144
+ DESC
145
+ task :stop_sql, :roles => :mysql_sql do
146
+ rsudo "service mysql stop"
147
+ end
148
+
149
+ desc <<-DESC
150
+ Stops all the mysql cluster daemons
151
+ DESC
152
+ task :stop do
153
+ stop_sql
154
+ stop_data
155
+ stop_mgm
156
+ end
157
+
158
+ desc <<-DESC
159
+ Starts all the mysql cluster daemons
160
+ DESC
161
+ task :start do
162
+ start_mgm
163
+ start_data
164
+ start_sql
165
+ end
166
+
167
+ desc <<-DESC
168
+ Restarts all the mysql cluster daemons
169
+ DESC
170
+ task :restart do
171
+ stop
172
+ start
173
+ end
174
+
175
+ end
176
+
177
+ end