le1t0-deprec 2.1.6.001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. data/CHANGELOG +444 -0
  2. data/COPYING +19 -0
  3. data/LICENSE +339 -0
  4. data/README +154 -0
  5. data/THANKS +17 -0
  6. data/bin/depify +139 -0
  7. data/docs/EXAMPLE-installing_tracks.txt +41 -0
  8. data/docs/README.nagios +22 -0
  9. data/docs/README.rails +17 -0
  10. data/docs/config_gen_explained.txt +39 -0
  11. data/docs/deprec-1.x/deprec-1.x.quickstart +50 -0
  12. data/docs/deprec-1.x/notes.txt +12 -0
  13. data/docs/old/deprec_banner.gif +0 -0
  14. data/docs/windows_linux.txt +350 -0
  15. data/docs/xen/traffic_monitoring_with_vnstat.txt +95 -0
  16. data/docs/xen/xen-tools-notes.txt +31 -0
  17. data/docs/xen/xen_on_hardy.txt +39 -0
  18. data/lib/deprec.rb +42 -0
  19. data/lib/deprec/capistrano_extensions.rb +446 -0
  20. data/lib/deprec/recipes.rb +7 -0
  21. data/lib/deprec/recipes/aoe.rb +79 -0
  22. data/lib/deprec/recipes/app/mongrel.rb +213 -0
  23. data/lib/deprec/recipes/app/passenger.rb +190 -0
  24. data/lib/deprec/recipes/ar_sendmail.rb +67 -0
  25. data/lib/deprec/recipes/aspell.rb +22 -0
  26. data/lib/deprec/recipes/canonical.rb +68 -0
  27. data/lib/deprec/recipes/cap.rb +39 -0
  28. data/lib/deprec/recipes/chef.rb +68 -0
  29. data/lib/deprec/recipes/collectd.rb +112 -0
  30. data/lib/deprec/recipes/db/couchdb.rb +107 -0
  31. data/lib/deprec/recipes/db/mysql.rb +194 -0
  32. data/lib/deprec/recipes/db/postgresql.rb +104 -0
  33. data/lib/deprec/recipes/db/sqlite.rb +37 -0
  34. data/lib/deprec/recipes/ddclient.rb +51 -0
  35. data/lib/deprec/recipes/deprec.rb +167 -0
  36. data/lib/deprec/recipes/deprecated.rb +71 -0
  37. data/lib/deprec/recipes/drbd.rb +137 -0
  38. data/lib/deprec/recipes/dummy.rb +22 -0
  39. data/lib/deprec/recipes/example.rb +115 -0
  40. data/lib/deprec/recipes/git.rb +97 -0
  41. data/lib/deprec/recipes/gitosis.rb.disabled +55 -0
  42. data/lib/deprec/recipes/glusterfs.rb +176 -0
  43. data/lib/deprec/recipes/god.rb +70 -0
  44. data/lib/deprec/recipes/haproxy.rb +115 -0
  45. data/lib/deprec/recipes/heartbeat.rb +138 -0
  46. data/lib/deprec/recipes/imagemagick/imagemagick_bin.rb +24 -0
  47. data/lib/deprec/recipes/imagemagick/imagemagick_src.rb +39 -0
  48. data/lib/deprec/recipes/integrity.rb +108 -0
  49. data/lib/deprec/recipes/iptables.rb +94 -0
  50. data/lib/deprec/recipes/java.rb +23 -0
  51. data/lib/deprec/recipes/keepalived.rb +78 -0
  52. data/lib/deprec/recipes/ldap.rb +52 -0
  53. data/lib/deprec/recipes/logrotate.rb +56 -0
  54. data/lib/deprec/recipes/lvm.rb +20 -0
  55. data/lib/deprec/recipes/memcache.rb +49 -0
  56. data/lib/deprec/recipes/mongodb.rb +94 -0
  57. data/lib/deprec/recipes/monit.rb +135 -0
  58. data/lib/deprec/recipes/mysql_proxy.rb +67 -0
  59. data/lib/deprec/recipes/nagios.rb +361 -0
  60. data/lib/deprec/recipes/network.rb +116 -0
  61. data/lib/deprec/recipes/ntp.rb +103 -0
  62. data/lib/deprec/recipes/php.rb +58 -0
  63. data/lib/deprec/recipes/postfix.rb +115 -0
  64. data/lib/deprec/recipes/profiles.rb +125 -0
  65. data/lib/deprec/recipes/raid/amcc_3ware.rb +21 -0
  66. data/lib/deprec/recipes/rails.rb +330 -0
  67. data/lib/deprec/recipes/redhat_cluster.rb +228 -0
  68. data/lib/deprec/recipes/redis.rb +90 -0
  69. data/lib/deprec/recipes/ruby/mri.rb +55 -0
  70. data/lib/deprec/recipes/ruby/ree.rb +40 -0
  71. data/lib/deprec/recipes/rvm.rb +32 -0
  72. data/lib/deprec/recipes/s3utils.rb +63 -0
  73. data/lib/deprec/recipes/sphinx/thinking_sphinx.rb +105 -0
  74. data/lib/deprec/recipes/sphinx/ultrasphinx.rb +86 -0
  75. data/lib/deprec/recipes/ssh.rb +147 -0
  76. data/lib/deprec/recipes/ssl.rb +56 -0
  77. data/lib/deprec/recipes/starling.rb +119 -0
  78. data/lib/deprec/recipes/svn.rb +171 -0
  79. data/lib/deprec/recipes/syslog.rb +63 -0
  80. data/lib/deprec/recipes/trac.rb.disabled +277 -0
  81. data/lib/deprec/recipes/tsung.rb +74 -0
  82. data/lib/deprec/recipes/ubuntu.rb +90 -0
  83. data/lib/deprec/recipes/users.rb +90 -0
  84. data/lib/deprec/recipes/utils.rb +58 -0
  85. data/lib/deprec/recipes/vnstat.rb +85 -0
  86. data/lib/deprec/recipes/web/apache.rb +143 -0
  87. data/lib/deprec/recipes/web/nginx.rb +172 -0
  88. data/lib/deprec/recipes/wordpress.rb.notworking +96 -0
  89. data/lib/deprec/recipes/wpmu.rb +103 -0
  90. data/lib/deprec/recipes/xen.rb +364 -0
  91. data/lib/deprec/recipes/xentools.rb +101 -0
  92. data/lib/deprec/recipes_minus_rails.rb +125 -0
  93. data/lib/deprec/templates/aoe/aoe-init +55 -0
  94. data/lib/deprec/templates/aoe/fence_aoemask +351 -0
  95. data/lib/deprec/templates/apache/namevirtualhosts.conf +5 -0
  96. data/lib/deprec/templates/apache/ports.conf.erb +5 -0
  97. data/lib/deprec/templates/apache/status.conf.erb +17 -0
  98. data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +9 -0
  99. data/lib/deprec/templates/ar_sendmail/monit.conf.erb +5 -0
  100. data/lib/deprec/templates/chef/chef.json.erb +1 -0
  101. data/lib/deprec/templates/chef/solo.rb +2 -0
  102. data/lib/deprec/templates/collectd/collectd-init.d +153 -0
  103. data/lib/deprec/templates/collectd/collectd.conf.erb +686 -0
  104. data/lib/deprec/templates/ddclient/ddclient.conf.erb +11 -0
  105. data/lib/deprec/templates/ddclient/ddclient.erb +15 -0
  106. data/lib/deprec/templates/deprec/caprc.erb +14 -0
  107. data/lib/deprec/templates/drbd/drbd.conf.erb +531 -0
  108. data/lib/deprec/templates/glusterfs/glusterfsd-init.erb +95 -0
  109. data/lib/deprec/templates/gnbd_client/cluster.conf.erb +21 -0
  110. data/lib/deprec/templates/gnbd_client/clvm-default.erb +3 -0
  111. data/lib/deprec/templates/gnbd_client/cman-default.erb +6 -0
  112. data/lib/deprec/templates/gnbd_client/gnbdimports.conf.erb +1 -0
  113. data/lib/deprec/templates/gnbd_server/cluster.conf.erb +20 -0
  114. data/lib/deprec/templates/gnbd_server/clvm-default.erb +3 -0
  115. data/lib/deprec/templates/gnbd_server/cman-default.erb +6 -0
  116. data/lib/deprec/templates/gnbd_server/gnbd-server-default.erb +1 -0
  117. data/lib/deprec/templates/gnbd_server/gnbdexports.conf.erb +1 -0
  118. data/lib/deprec/templates/god/god-conf.erb +2 -0
  119. data/lib/deprec/templates/god/god-init.erb +47 -0
  120. data/lib/deprec/templates/haproxy/haproxy-init.d +120 -0
  121. data/lib/deprec/templates/haproxy/haproxy.cfg.erb +31 -0
  122. data/lib/deprec/templates/heartbeat/authkeys.erb +2 -0
  123. data/lib/deprec/templates/heartbeat/ha.cf.erb +15 -0
  124. data/lib/deprec/templates/heartbeat/haresources.erb +1 -0
  125. data/lib/deprec/templates/integrity/apache_vhost.erb +4 -0
  126. data/lib/deprec/templates/integrity/config.ru.erb +21 -0
  127. data/lib/deprec/templates/integrity/config.yml.erb +43 -0
  128. data/lib/deprec/templates/iptables/firewall-default.erb +13 -0
  129. data/lib/deprec/templates/iptables/firewall-init.erb +171 -0
  130. data/lib/deprec/templates/keepalived/keepalived.conf.erb +18 -0
  131. data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
  132. data/lib/deprec/templates/mongodb/mongodb-init.d +88 -0
  133. data/lib/deprec/templates/mongrel/apache_vhost.conf.erb +148 -0
  134. data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
  135. data/lib/deprec/templates/mongrel/mongrel_cluster-init-script +54 -0
  136. data/lib/deprec/templates/mongrel/mongrel_cluster.yml.erb +10 -0
  137. data/lib/deprec/templates/mongrel/monit.conf.erb +17 -0
  138. data/lib/deprec/templates/mongrel/nginx_vhost.conf.erb +41 -0
  139. data/lib/deprec/templates/monit/monit-init-script +104 -0
  140. data/lib/deprec/templates/monit/monitrc.erb +250 -0
  141. data/lib/deprec/templates/monit/nothing.monitrc +0 -0
  142. data/lib/deprec/templates/mysql/create_databases.sql +20 -0
  143. data/lib/deprec/templates/mysql/database.yml.prod +6 -0
  144. data/lib/deprec/templates/mysql/database.yml.stage +6 -0
  145. data/lib/deprec/templates/mysql/my.cnf.erb +140 -0
  146. data/lib/deprec/templates/mysql/sphinx.conf.prod +542 -0
  147. data/lib/deprec/templates/mysql/sphinx.conf.stage +542 -0
  148. data/lib/deprec/templates/mysql_proxy/mysql-proxy-default.erb +4 -0
  149. data/lib/deprec/templates/nagios/README +32 -0
  150. data/lib/deprec/templates/nagios/cgi.cfg.erb +357 -0
  151. data/lib/deprec/templates/nagios/check_linux_free_memory.pl +118 -0
  152. data/lib/deprec/templates/nagios/check_mongrel_cluster.rb +82 -0
  153. data/lib/deprec/templates/nagios/htpasswd.users +1 -0
  154. data/lib/deprec/templates/nagios/mrtg.cfg +180 -0
  155. data/lib/deprec/templates/nagios/nagios.cfg.erb +1325 -0
  156. data/lib/deprec/templates/nagios/nrpe.cfg.erb +222 -0
  157. data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
  158. data/lib/deprec/templates/nagios/objects/commands.cfg.erb +265 -0
  159. data/lib/deprec/templates/nagios/objects/contacts.cfg.erb +89 -0
  160. data/lib/deprec/templates/nagios/objects/hosts.cfg.erb +114 -0
  161. data/lib/deprec/templates/nagios/objects/localhost.cfg.erb +116 -0
  162. data/lib/deprec/templates/nagios/objects/services.cfg.erb +165 -0
  163. data/lib/deprec/templates/nagios/objects/timeperiods.cfg.erb +94 -0
  164. data/lib/deprec/templates/nagios/resource.cfg.erb +34 -0
  165. data/lib/deprec/templates/network/hostname.erb +1 -0
  166. data/lib/deprec/templates/network/hosts.erb +2 -0
  167. data/lib/deprec/templates/network/interfaces.erb +18 -0
  168. data/lib/deprec/templates/network/resolv.conf.erb +6 -0
  169. data/lib/deprec/templates/nginx/logrotate.conf.erb +13 -0
  170. data/lib/deprec/templates/nginx/mime.types.erb +70 -0
  171. data/lib/deprec/templates/nginx/nginx-init-script +62 -0
  172. data/lib/deprec/templates/nginx/nginx.conf.erb +125 -0
  173. data/lib/deprec/templates/nginx/nginx.logrotate.d +12 -0
  174. data/lib/deprec/templates/nginx/nothing.conf +1 -0
  175. data/lib/deprec/templates/nginx/rails_nginx_vhost.conf.erb +41 -0
  176. data/lib/deprec/templates/ntp/ntp.conf.erb +42 -0
  177. data/lib/deprec/templates/passenger/apache_vhost.erb +29 -0
  178. data/lib/deprec/templates/passenger/logrotate.conf.erb +12 -0
  179. data/lib/deprec/templates/passenger/passenger.conf.erb +21 -0
  180. data/lib/deprec/templates/passenger/passenger.load.erb +3 -0
  181. data/lib/deprec/templates/postfix/aliases.erb +3 -0
  182. data/lib/deprec/templates/postfix/dynamicmaps.cf.erb +8 -0
  183. data/lib/deprec/templates/postfix/main.cf.erb +36 -0
  184. data/lib/deprec/templates/postfix/master.cf.erb +77 -0
  185. data/lib/deprec/templates/redis/redis-conf.erb +132 -0
  186. data/lib/deprec/templates/redis/redis-init.erb +50 -0
  187. data/lib/deprec/templates/s3utils/s3cfg +35 -0
  188. data/lib/deprec/templates/s3utils/s3config.yml +3 -0
  189. data/lib/deprec/templates/sphinx/monit.conf.erb +5 -0
  190. data/lib/deprec/templates/ssh/ssh_config.erb +50 -0
  191. data/lib/deprec/templates/ssh/sshd_config.erb +78 -0
  192. data/lib/deprec/templates/ssl/make-ssl-cert +138 -0
  193. data/lib/deprec/templates/ssl/ssl-cert-snakeoil.key +15 -0
  194. data/lib/deprec/templates/ssl/ssl-cert-snakeoil.pem +19 -0
  195. data/lib/deprec/templates/starling/monit.conf.erb +14 -0
  196. data/lib/deprec/templates/starling/starling-init-script.erb +71 -0
  197. data/lib/deprec/templates/subversion/svn.apache.vhost.erb +43 -0
  198. data/lib/deprec/templates/syslog/syslog.conf.erb +71 -0
  199. data/lib/deprec/templates/syslog/syslogd.erb +13 -0
  200. data/lib/deprec/templates/trac/apache_vhost.conf.erb +24 -0
  201. data/lib/deprec/templates/trac/nginx_vhost.conf.erb +26 -0
  202. data/lib/deprec/templates/trac/trac.ini.erb +169 -0
  203. data/lib/deprec/templates/trac/trac_deprec.png +0 -0
  204. data/lib/deprec/templates/trac/tracd-init.erb +43 -0
  205. data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
  206. data/lib/deprec/templates/tsung/tsung.xml.erb +47 -0
  207. data/lib/deprec/templates/vnstat/config.php +57 -0
  208. data/lib/deprec/templates/wordpress/apache2_wordpress_vhost.conf.erb +31 -0
  209. data/lib/deprec/templates/wordpress/wp-config.php.erb +31 -0
  210. data/lib/deprec/templates/wpmu/apache_vhost.conf.erb +13 -0
  211. data/lib/deprec/templates/xen/network-bridge-wrapper +3 -0
  212. data/lib/deprec/templates/xen/xend-config.sxp.erb +195 -0
  213. data/lib/deprec/templates/xen/xend-init.erb +57 -0
  214. data/lib/deprec/templates/xen/xendomains.erb +137 -0
  215. data/lib/deprec/templates/xentools/100-ubuntu-setup +26 -0
  216. data/lib/deprec/templates/xentools/15-disable-hwclock +40 -0
  217. data/lib/deprec/templates/xentools/30-disable-gettys +57 -0
  218. data/lib/deprec/templates/xentools/31-ubuntu-setup +32 -0
  219. data/lib/deprec/templates/xentools/40-setup-networking +145 -0
  220. data/lib/deprec/templates/xentools/98-custom +17 -0
  221. data/lib/deprec/templates/xentools/xen-tools.conf.erb +278 -0
  222. data/lib/deprec/templates/xentools/xm.tmpl.erb +138 -0
  223. data/lib/deprec_cmd_completion.sh +26 -0
  224. data/lib/deprec_minus_rails.rb +12 -0
  225. data/lib/vmbuilder_plugins/all.rb +20 -0
  226. data/lib/vmbuilder_plugins/apt.rb +93 -0
  227. data/lib/vmbuilder_plugins/emerge.rb +76 -0
  228. data/lib/vmbuilder_plugins/gem.rb +100 -0
  229. data/lib/vmbuilder_plugins/std.rb +203 -0
  230. metadata +304 -0
@@ -0,0 +1,11 @@
1
+ # Configuration file for ddclient generated by deprec
2
+ #
3
+ # /etc/ddclient.conf
4
+
5
+ pid=/var/run/ddclient.pid
6
+ protocol=dyndns2
7
+ use=if, if=<%= ddclient_interface %>
8
+ server=members.dyndns.org
9
+ login=<%= ddclient_user %>
10
+ password='<%= ddclient_pass %>'
11
+ <%= Array(ddclient_domains).join(',') %>
@@ -0,0 +1,15 @@
1
+ # Configuration for ddclient scripts
2
+ # generated from debconf on Sun Jan 18 09:20:43 UTC 2009
3
+ #
4
+ # /etc/default/ddclient
5
+
6
+ # Set to "true" if ddclient should be run every time a new ppp connection is
7
+ # established. This might be useful, if you are using dial-on-demand
8
+ run_ipup="true"
9
+
10
+ # Set to "true" if ddclient should run in daemon mode
11
+ run_daemon="true"
12
+
13
+ # Set the time interval between the updates of the dynamic DNS name in seconds.
14
+ # This option only takes effect if the ddclient runs in daemon mode.
15
+ daemon_interval="300"
@@ -0,0 +1,14 @@
1
+ ssh_options[:paranoid] = false
2
+ ssh_options[:forward_agent] = true
3
+
4
+
5
+ # Just import the general purpose tasks
6
+ require '/deprec/general_purpose' if respond_to?(:namespace)
7
+
8
+ # Enable all deprec tasks all the time. This will change the
9
+ # behviour of some standard cap tasks (like 'cap deploy') so
10
+ # only enable it if you know what you're doing!
11
+ #
12
+ # require 'deprec/recipes' unless respond_to?(:namespace)
13
+
14
+
@@ -0,0 +1,531 @@
1
+ global {
2
+ usage-count <%= drbd_usage_count ? 'yes' : 'no' %>;
3
+ }
4
+
5
+ <% drbd_resources.each do |drbd| %>
6
+ resource <%= drbd[:drbd_resource] %> {
7
+
8
+ protocol <%= drbd[:drbd_protocol] %>;
9
+
10
+ on <%= drbd[:drbd_drbd1_hostname] %> { # first server hostname
11
+ device <%= drbd[:drbd_drbd1_device] %>; # Name of DRBD device
12
+ disk <%= drbd[:drbd_drbd1_disk] %>; # Partition to use, which was created using fdisk
13
+ address <%= drbd[:drbd_drbd1_address] %>; # IP addres and port number used by drbd
14
+ meta-disk internal; # where to store metadata meta-data
15
+ }
16
+
17
+ on <%= drbd[:drbd_drbd2_hostname] %> { # second server hostname
18
+ device <%= drbd[:drbd_drbd2_device] %>;
19
+ disk <%= drbd[:drbd_drbd2_disk] %>;
20
+ address <%= drbd[:drbd_drbd2_address] %>;
21
+ meta-disk internal;
22
+ }
23
+
24
+ disk {
25
+ on-io-error detach;
26
+ }
27
+
28
+ net {<% if drbd[:drbd_allow_two_primaries] %>
29
+ allow-two-primaries;
30
+ after-sb-0pri discard-zero-changes;
31
+ after-sb-1pri discard-secondary;
32
+ after-sb-2pri disconnect;<% end %>
33
+ max-buffers <%= drbd[:drbd_max_buffers] %>;
34
+ ko-count <%= drbd[:drbd_ko_count] %>;
35
+ }
36
+
37
+ syncer {
38
+ rate <%= drbd[:drbd_rate] %>;
39
+ al-extents <%= drbd[:drbd_al_extents] %>;
40
+ }
41
+
42
+ startup {
43
+ wfc-timeout <%= drbd[:drbd_wfc_timeout] %>;
44
+ degr-wfc-timeout <%= drbd[:drbd_degr_wfc_timeout] %>; # 2 minutos.
45
+ }
46
+ }
47
+
48
+ <% end %>
49
+
50
+ # ORIGINAL CONFIG:
51
+ # #
52
+ # # drbd.conf example
53
+ # #
54
+ # # parameters you _need_ to change are the hostname, device, disk,
55
+ # # meta-disk, address and port in the "on <hostname> {}" sections.
56
+ # #
57
+ # # you ought to know about the protocol, and the various timeouts.
58
+ # #
59
+ # # you probably want to set the rate in the syncer sections
60
+ #
61
+ # #
62
+ # # NOTE common pitfall:
63
+ # # rate is given in units of _byte_ not bit
64
+ # #
65
+ #
66
+ # #
67
+ # # increase timeout and maybe ping-int in net{}, if you see
68
+ # # problems with "connection lost/connection established"
69
+ # # (or change your setup to reduce network latency; make sure full
70
+ # # duplex behaves as such; check average roundtrip times while
71
+ # # network is saturated; and so on ...)
72
+ # #
73
+ #
74
+ # skip {
75
+ # As you can see, you can also comment chunks of text
76
+ # with a 'skip[optional nonsense]{ skipped text }' section.
77
+ # This comes in handy, if you just want to comment out
78
+ # some 'resource <some name> {...}' section:
79
+ # just precede it with 'skip'.
80
+ #
81
+ # The basic format of option assignment is
82
+ # <option name><linear whitespace><value>;
83
+ #
84
+ # It should be obvious from the examples below,
85
+ # but if you really care to know the details:
86
+ #
87
+ # <option name> :=
88
+ # valid options in the respective scope
89
+ # <value> := <num>|<string>|<choice>|...
90
+ # depending on the set of allowed values
91
+ # for the respective option.
92
+ # <num> := [0-9]+, sometimes with an optional suffix of K,M,G
93
+ # <string> := (<name>|\"([^\"\\\n]*|\\.)*\")+
94
+ # <name> := [/_.A-Za-z0-9-]+
95
+ # }
96
+ #
97
+ # #
98
+ # # At most ONE global section is allowed.
99
+ # # It must precede any resource section.
100
+ # #
101
+ # global {
102
+ # # By default we load the module with a minor-count of 32. In case you
103
+ # # have more devices in your config, the module gets loaded with
104
+ # # a minor-count that ensures that you have 10 minors spare.
105
+ # # In case 10 spare minors are too little for you, you can set the
106
+ # # minor-count exeplicit here. ( Note, in contrast to DRBD-0.7 an
107
+ # # unused, spare minor has only a very little overhead of allocated
108
+ # # memory (a single pointer to be exact). )
109
+ # #
110
+ # # minor-count 64;
111
+ #
112
+ # # The user dialog counts and displays the seconds it waited so
113
+ # # far. You might want to disable this if you have the console
114
+ # # of your server connected to a serial terminal server with
115
+ # # limited logging capacity.
116
+ # # The Dialog will print the count each 'dialog-refresh' seconds,
117
+ # # set it to 0 to disable redrawing completely. [ default = 1 ]
118
+ # #
119
+ # # dialog-refresh 5; # 5 seconds
120
+ #
121
+ # # You might disable one of drbdadm's sanity check.
122
+ # # disable-ip-verification;
123
+ #
124
+ # # Participate in DRBD's online usage counter at http://usage.drbd.org
125
+ # # possilbe options: ask, yes, no. Default is ask. In case you do not
126
+ # # know, set it to ask, and follow the on screen instructions later.
127
+ # usage-count yes;
128
+ # }
129
+ #
130
+ #
131
+ # #
132
+ # # The common section can have all the sections a resource can have but
133
+ # # not the host section (started with the "on" keyword).
134
+ # # The common section must precede all resources.
135
+ # # All resources inherit the settings from the common section.
136
+ # # Whereas settings in the resources have precedence over the common
137
+ # # setting.
138
+ # #
139
+ #
140
+ # common {
141
+ # syncer { rate 10M; }
142
+ # }
143
+ #
144
+ # #
145
+ # # this need not be r#, you may use phony resource names,
146
+ # # like "resource web" or "resource mail", too
147
+ # #
148
+ #
149
+ # resource r0 {
150
+ #
151
+ # # transfer protocol to use.
152
+ # # C: write IO is reported as completed, if we know it has
153
+ # # reached _both_ local and remote DISK.
154
+ # # * for critical transactional data.
155
+ # # B: write IO is reported as completed, if it has reached
156
+ # # local DISK and remote buffer cache.
157
+ # # * for most cases.
158
+ # # A: write IO is reported as completed, if it has reached
159
+ # # local DISK and local tcp send buffer. (see also sndbuf-size)
160
+ # # * for high latency networks
161
+ # #
162
+ # #**********
163
+ # # uhm, benchmarks have shown that C is actually better than B.
164
+ # # this note shall disappear, when we are convinced that B is
165
+ # # the right choice "for most cases".
166
+ # # Until then, always use C unless you have a reason not to.
167
+ # # --lge
168
+ # #**********
169
+ # #
170
+ # protocol C;
171
+ #
172
+ # handlers {
173
+ # # what should be done in case the node is primary, degraded
174
+ # # (=no connection) and has inconsistent data.
175
+ # pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
176
+ #
177
+ # # The node is currently primary, but lost the after split brain
178
+ # # auto recovery procedure. As as consequence it should go away.
179
+ # pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
180
+ #
181
+ # # In case you have set the on-io-error option to "call-local-io-error",
182
+ # # this script will get executed in case of a local IO error. It is
183
+ # # expected that this script will case a immediate failover in the
184
+ # # cluster.
185
+ # local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
186
+ #
187
+ # # Commands to run in case we need to downgrade the peer's disk
188
+ # # state to "Outdated". Should be implemented by the superior
189
+ # # communication possibilities of our cluster manager.
190
+ # # The provided script uses ssh, and is for demonstration/development
191
+ # # purposis.
192
+ # # outdate-peer "/usr/lib/drbd/outdate-peer.sh on amd 192.168.22.11 192.168.23.11 on alf 192.168.22.12 192.168.23.12";
193
+ # #
194
+ # # Update: Now there is a solution that relies on heartbeat's
195
+ # # communication layers. You should really use this.
196
+ # outdate-peer "/usr/lib/heartbeat/drbd-peer-outdater -t 5";
197
+ #
198
+ # # The node is currently primary, but should become sync target
199
+ # # after the negotiating phase. Alert someone about this incident.
200
+ # #pri-lost "echo pri-lost. Have a look at the log files. | mail -s 'DRBD Alert' root";
201
+ #
202
+ # # Notify someone in case DRBD split brained.
203
+ # #split-brain "echo split-brain. drbdadm -- --discard-my-data connect $DRBD_RESOURCE ? | mail -s 'DRBD Alert' root";
204
+ # }
205
+ #
206
+ # startup {
207
+ # # Wait for connection timeout.
208
+ # # The init script blocks the boot process until the resources
209
+ # # are connected. This is so when the cluster manager starts later,
210
+ # # it does not see a resource with internal split-brain.
211
+ # # In case you want to limit the wait time, do it here.
212
+ # # Default is 0, which means unlimited. Unit is seconds.
213
+ # #
214
+ # # wfc-timeout 0;
215
+ #
216
+ # # Wait for connection timeout if this node was a degraded cluster.
217
+ # # In case a degraded cluster (= cluster with only one node left)
218
+ # # is rebooted, this timeout value is used.
219
+ # #
220
+ # degr-wfc-timeout 120; # 2 minutes.
221
+ #
222
+ # # In case there was a split brain situation the devices will
223
+ # # drop their network configuration instead of connecting. Since
224
+ # # this means that the network is working, the cluster manager
225
+ # # should be able to communicate as well. Therefore the default
226
+ # # of DRBD's init script is to terminate in this case. To make
227
+ # # it to continue waiting in this case set this option.
228
+ # #
229
+ # # wait-after-sb;
230
+ #
231
+ # # In case you are using DRBD for GFS/OCFS2 you want that the
232
+ # # startup script promotes it to primary. Nodenames are also
233
+ # # possible instead of "both".
234
+ # # become-primary-on both;
235
+ # }
236
+ #
237
+ # disk {
238
+ # # if the lower level device reports io-error you have the choice of
239
+ # # "pass_on" -> Report the io-error to the upper layers.
240
+ # # Primary -> report it to the mounted file system.
241
+ # # Secondary -> ignore it.
242
+ # # "call-local-io-error"
243
+ # # -> Call the script configured by the name "local-io-error".
244
+ # # "detach" -> The node drops its backing storage device, and
245
+ # # continues in disk less mode.
246
+ # #
247
+ # on-io-error detach;
248
+ #
249
+ # # Controls the fencing policy, default is "dont-care". Before you
250
+ # # set any policy you need to make sure that you have a working
251
+ # # outdate-peer handler. Possible values are:
252
+ # # "dont-care" -> Never call the outdate-peer handler. [ DEFAULT ]
253
+ # # "resource-only" -> Call the outdate-peer handler if we primary and
254
+ # # loose the connection to the secondary. As well
255
+ # # whenn a unconnected secondary wants to become
256
+ # # primary.
257
+ # # "resource-and-stonith"
258
+ # # -> Calls the outdate-peer handler and freezes local
259
+ # # IO immediately after loss of connection. This is
260
+ # # necessary if your heartbeat can STONITH the other
261
+ # # node.
262
+ # # fencing resource-only;
263
+ #
264
+ # # In case you only want to use a fraction of the available space
265
+ # # you might use the "size" option here.
266
+ # #
267
+ # # size 10G;
268
+ # }
269
+ #
270
+ # net {
271
+ # # this is the size of the tcp socket send buffer
272
+ # # increase it _carefully_ if you want to use protocol A over a
273
+ # # high latency network with reasonable write throughput.
274
+ # # defaults to 2*65535; you might try even 1M, but if your kernel or
275
+ # # network driver chokes on that, you have been warned.
276
+ # # sndbuf-size 512k;
277
+ #
278
+ # # timeout 60; # 6 seconds (unit = 0.1 seconds)
279
+ # # connect-int 10; # 10 seconds (unit = 1 second)
280
+ # # ping-int 10; # 10 seconds (unit = 1 second)
281
+ # # ping-timeout 5; # 500 ms (unit = 0.1 seconds)
282
+ #
283
+ # # Maximal number of requests (4K) to be allocated by DRBD.
284
+ # # The minimum is hardcoded to 32 (=128 kByte).
285
+ # # For high performance installations it might help if you
286
+ # # increase that number. These buffers are used to hold
287
+ # # datablocks while they are written to disk.
288
+ # #
289
+ # # max-buffers 2048;
290
+ #
291
+ # # When the number of outstanding requests on a standby (secondary)
292
+ # # node exceeds bdev-threshold, we start to kick the backing device
293
+ # # to start its request processing. This is an advanced tuning
294
+ # # parameter to get more performance out of capable storage controlers.
295
+ # # Some controlers like to be kicked often, other controlers
296
+ # # deliver better performance when they are kicked less frequently.
297
+ # # Set it to the value of max-buffers to get the least possible
298
+ # # number of run_task_queue_disk() / q->unplug_fn(q) calls.
299
+ # #
300
+ # # unplug-watermark 128;
301
+ #
302
+ #
303
+ # # The highest number of data blocks between two write barriers.
304
+ # # If you set this < 10 you might decrease your performance.
305
+ # # max-epoch-size 2048;
306
+ #
307
+ # # if some block send times out this many times, the peer is
308
+ # # considered dead, even if it still answers ping requests.
309
+ # # ko-count 4;
310
+ #
311
+ # # If you want to use OCFS2/openGFS on top of DRBD enable
312
+ # # this optione, and only enable it if you are going to use
313
+ # # one of these filesystems. Do not enable it for ext2,
314
+ # # ext3,reiserFS,XFS,JFS etc...
315
+ # # allow-two-primaries;
316
+ #
317
+ # # This enables peer authentication. Without this everybody
318
+ # # on the network could connect to one of your DRBD nodes with
319
+ # # a program that emulates DRBD's protocoll and could suck off
320
+ # # all your data.
321
+ # # Specify one of the kernel's digest algorithms, e.g.:
322
+ # # md5, sha1, sha256, sha512, wp256, wp384, wp512, michael_mic ...
323
+ # # an a shared secret.
324
+ # # Authentication is only done once after the TCP connection
325
+ # # is establised, there are no disadvantages from using authentication,
326
+ # # therefore I suggest to enable it in any case.
327
+ # # cram-hmac-alg "sha1";
328
+ # # shared-secret "FooFunFactory";
329
+ #
330
+ # # In case the nodes of your cluster nodes see each other again, after
331
+ # # an split brain situation in which both nodes where primary
332
+ # # at the same time, you have two diverged versions of your data.
333
+ # #
334
+ # # In case both nodes are secondary you can control DRBD's
335
+ # # auto recovery strategy by the "after-sb-0pri" options. The
336
+ # # default is to disconnect.
337
+ # # "disconnect" ... No automatic resynchronisation, simply disconnect.
338
+ # # "discard-younger-primary"
339
+ # # Auto sync from the node that was primary before
340
+ # # the split brain situation happened.
341
+ # # "discard-older-primary"
342
+ # # Auto sync from the node that became primary
343
+ # # as second during the split brain situation.
344
+ # # "discard-least-changes"
345
+ # # Auto sync from the node that touched more
346
+ # # blocks during the split brain situation.
347
+ # # "discard-node-NODENAME"
348
+ # # Auto sync _to_ the named node.
349
+ # after-sb-0pri disconnect;
350
+ #
351
+ # # In one of the nodes is already primary, then the auto-recovery
352
+ # # strategie is controled by the "after-sb-1pri" options.
353
+ # # "disconnect" ... always disconnect
354
+ # # "consensus" ... discard the version of the secondary if the outcome
355
+ # # of the "after-sb-0pri" algorithm would also destroy
356
+ # # the current secondary's data. Otherwise disconnect.
357
+ # # "violently-as0p" Always take the decission of the "after-sb-0pri"
358
+ # # algorithm. Even if that causes case an erratic change
359
+ # # of the primarie's view of the data.
360
+ # # This is only usefull if you use an 1node FS (i.e.
361
+ # # not OCFS2 or GFS) with the allow-two-primaries
362
+ # # flag, _AND_ you really know what you are doing.
363
+ # # This is DANGEROUS and MAY CRASH YOUR MACHINE if you
364
+ # # have a FS mounted on the primary node.
365
+ # # "discard-secondary"
366
+ # # discard the version of the secondary.
367
+ # # "call-pri-lost-after-sb" Always honour the outcome of the "after-sb-0pri"
368
+ # # algorithm. In case it decides the the current
369
+ # # secondary has the right data, it panics the
370
+ # # current primary.
371
+ # # "suspend-primary" ???
372
+ # after-sb-1pri disconnect;
373
+ #
374
+ # # In case both nodes are primary you control DRBD's strategy by
375
+ # # the "after-sb-2pri" option.
376
+ # # "disconnect" ... Go to StandAlone mode on both sides.
377
+ # # "violently-as0p" Always take the decission of the "after-sb-0pri".
378
+ # # "call-pri-lost-after-sb" ... Honor the outcome of the "after-sb-0pri"
379
+ # # algorithm and panic the other node.
380
+ #
381
+ # after-sb-2pri disconnect;
382
+ #
383
+ # # To solve the cases when the outcome of the resync descissions is
384
+ # # incompatible to the current role asignment in the cluster.
385
+ # # "disconnect" ... No automatic resynchronisation, simply disconnect.
386
+ # # "violently" .... Sync to the primary node is allowed, violating the
387
+ # # assumption that data on a block device is stable
388
+ # # for one of the nodes. DANGEROUS, DO NOT USE.
389
+ # # "call-pri-lost" Call the "pri-lost" helper program on one of the
390
+ # # machines. This program is expected to reboot the
391
+ # # machine. (I.e. make it secondary.)
392
+ # rr-conflict disconnect;
393
+ #
394
+ # # DRBD-0.7's behaviour is equivalent to
395
+ # # after-sb-0pri discard-younger-primary;
396
+ # # after-sb-1pri consensus;
397
+ # # after-sb-2pri disconnect;
398
+ # }
399
+ #
400
+ # syncer {
401
+ # # Limit the bandwith used by the resynchronisation process.
402
+ # # default unit is kByte/sec; optional suffixes K,M,G are allowed.
403
+ # #
404
+ # # Even though this is a network setting, the units are based
405
+ # # on _byte_ (octet for our french friends) not bit.
406
+ # # We are storage guys.
407
+ # #
408
+ # # Note that on 100Mbit ethernet, you cannot expect more than
409
+ # # 12.5 MByte total transfer rate.
410
+ # # Consider using GigaBit Ethernet.
411
+ # #
412
+ # rate 10M;
413
+ #
414
+ # # Normally all devices are resynchronized parallel.
415
+ # # To achieve better resynchronisation performance you should resync
416
+ # # DRBD resources which have their backing storage on one physical
417
+ # # disk sequentially. The express this use the "after" keyword.
418
+ # after "r2";
419
+ #
420
+ # # Configures the size of the active set. Each extent is 4M,
421
+ # # 257 Extents ~> 1GB active set size. In case your syncer
422
+ # # runs @ 10MB/sec, all resync after a primary's crash will last
423
+ # # 1GB / ( 10MB/sec ) ~ 102 seconds ~ One Minute and 42 Seconds.
424
+ # # BTW, the hash algorithm works best if the number of al-extents
425
+ # # is prime. (To test the worst case performace use a power of 2)
426
+ # al-extents 257;
427
+ # }
428
+ #
429
+ # on amd {
430
+ # device /dev/drbd0;
431
+ # disk /dev/hde5;
432
+ # address 192.168.22.11:7788;
433
+ # flexible-meta-disk internal;
434
+ #
435
+ # # meta-disk is either 'internal' or '/dev/ice/name [idx]'
436
+ # #
437
+ # # You can use a single block device to store meta-data
438
+ # # of multiple DRBD's.
439
+ # # E.g. use meta-disk /dev/hde6[0]; and meta-disk /dev/hde6[1];
440
+ # # for two different resources. In this case the meta-disk
441
+ # # would need to be at least 256 MB in size.
442
+ # #
443
+ # # 'internal' means, that the last 128 MB of the lower device
444
+ # # are used to store the meta-data.
445
+ # # You must not give an index with 'internal'.
446
+ # }
447
+ #
448
+ # on alf {
449
+ # device /dev/drbd0;
450
+ # disk /dev/hdc5;
451
+ # address 192.168.22.12:7788;
452
+ # meta-disk internal;
453
+ # }
454
+ # }
455
+ #
456
+ # #
457
+ # # yes, you may also quote the resource name.
458
+ # # but don't include whitespace, unless you mean it :)
459
+ # #
460
+ # resource "r1" {
461
+ # protocol C;
462
+ # startup {
463
+ # wfc-timeout 0; ## Infinite!
464
+ # degr-wfc-timeout 120; ## 2 minutes.
465
+ # }
466
+ # disk {
467
+ # on-io-error detach;
468
+ # }
469
+ # net {
470
+ # # timeout 60;
471
+ # # connect-int 10;
472
+ # # ping-int 10;
473
+ # # max-buffers 2048;
474
+ # # max-epoch-size 2048;
475
+ # }
476
+ # syncer {
477
+ # }
478
+ #
479
+ # on amd {
480
+ # device /dev/drbd1;
481
+ # disk /dev/hde6;
482
+ # address 192.168.22.11:7789;
483
+ # meta-disk /dev/somewhere [7];
484
+ # }
485
+ #
486
+ # on alf {
487
+ # device /dev/drbd1;
488
+ # disk /dev/hdc6;
489
+ # address 192.168.22.12:7789;
490
+ # meta-disk /dev/somewhere [7];
491
+ # }
492
+ # }
493
+ #
494
+ # resource r2 {
495
+ # protocol C;
496
+ #
497
+ # startup { wfc-timeout 0; degr-wfc-timeout 120; }
498
+ # disk { on-io-error detach; }
499
+ # net { timeout 60; connect-int 10; ping-int 10;
500
+ # max-buffers 2048; max-epoch-size 2048; }
501
+ # syncer { rate 4M; } # sync when r0 and r1 are finished syncing.
502
+ # on amd {
503
+ # address 192.168.22.11:7790;
504
+ # disk /dev/hde7; device /dev/drbd2; meta-disk "internal";
505
+ # }
506
+ # on alf {
507
+ # device "/dev/drbd2"; disk "/dev/hdc7"; meta-disk "internal";
508
+ # address 192.168.22.12:7790;
509
+ # }
510
+ # }
511
+ #
512
+ # resource r3 {
513
+ # protocol C;
514
+ #
515
+ # startup { wfc-timeout 0; degr-wfc-timeout 120; }
516
+ # disk { on-io-error detach; }
517
+ # syncer {
518
+ # }
519
+ # on amd {
520
+ # device /dev/drbd3;
521
+ # disk /dev/hde8;
522
+ # address 192.168.22.11:7791;
523
+ # meta-disk internal;
524
+ # }
525
+ # on alf {
526
+ # device /dev/drbd3;
527
+ # disk /dev/hdc8;
528
+ # address 192.168.22.12:7791;
529
+ # meta-disk /some/where[8];
530
+ # }
531
+ # }