This file is indexed.

/usr/share/doc/drbd-doc/users-guide/s-configure-resource.html is in drbd-doc 8.4~20140825-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>5.3. Configuring your resource</title><link rel="stylesheet" type="text/css" href="default.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="drbd-users-guide.html" title="The DRBD User’s Guide" /><link rel="up" href="ch-configure.html" title="Chapter 5. Configuring DRBD" /><link rel="prev" href="s-prepare-network.html" title="5.2. Preparing your network configuration" /><link rel="next" href="s-first-time-up.html" title="5.4. Enabling your resource for the first time" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.3. Configuring your resource</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="s-prepare-network.html">Prev</a> </td><th width="60%" align="center">Chapter 5. Configuring DRBD</th><td width="20%" align="right"> <a accesskey="n" href="s-first-time-up.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s-configure-resource"></a>5.3. Configuring your resource</h2></div></div></div><p>All aspects of DRBD are controlled in its configuration file,
<code class="literal">/etc/drbd.conf</code>. Normally, this configuration file is just a skeleton
with the following contents:</p><pre class="screen">include "/etc/drbd.d/global_common.conf";
include "/etc/drbd.d/*.res";</pre><p>By convention, <code class="literal">/etc/drbd.d/global_common.conf</code> contains the
<a class="link" href="s-configure-resource.html#s-drbdconf-global" title="5.3.2. The global section"><code class="literal">global</code></a> and <a class="link" href="s-configure-resource.html#s-drbdconf-common" title="5.3.3. The common section"><code class="literal">common</code></a>
sections of the DRBD configuration, whereas the <code class="literal">.res</code> files contain
one <a class="link" href="s-configure-resource.html#s-drbdconf-resource" title="5.3.4. The resource sections"><code class="literal">resource</code></a> section each.</p><p>It is also possible to use <code class="literal">drbd.conf</code> as a flat configuration file
without any <code class="literal">include</code> statements at all. Such a configuration,
however, quickly becomes cluttered and hard to manage, which is why
the multiple-file approach is the preferred one.</p><p>Regardless of which approach you employ, you should always make sure
that <code class="literal">drbd.conf</code>, and any other files it includes, are <span class="emphasis"><em>exactly
identical</em></span> on all participating cluster nodes.</p><p>The DRBD source tarball contains an example configuration file in the
<code class="literal">scripts</code> subdirectory. Binary installation packages will either
install this example configuration directly in <code class="literal">/etc</code>, or in a
package-specific documentation directory such as
<code class="literal">/usr/share/doc/packages/drbd</code>.</p><p>This section describes only those few aspects of the configuration
file which are absolutely necessary to understand in order to get DRBD
up and running. The configuration file’s syntax and contents are
documented in great detail in <code class="literal">drbd.conf(5)</code>.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="s-drbdconf-example"></a>5.3.1. Example configuration</h3></div></div></div><p>For the purposes of this guide, we assume a
minimal setup in line with the examples given in the
previous sections:</p><p><strong>Simple DRBD configuration (<code class="literal">/etc/drbd.d/global_common.conf</code>). </strong>
</p><pre class="screen">global {
  usage-count yes;
}
common {
  net {
    protocol C;
  }
}</pre><p>
</p><p><strong>Simple DRBD resource configuration (<code class="literal">/etc/drbd.d/r0.res</code>). </strong>
</p><pre class="screen">resource r0 {
  on alice {
    device    /dev/drbd1;
    disk      /dev/sda7;
    address   10.1.1.31:7789;
    meta-disk internal;
  }
  on bob {
    device    /dev/drbd1;
    disk      /dev/sda7;
    address   10.1.1.32:7789;
    meta-disk internal;
  }
}</pre><p>
</p><p>This example configures DRBD in the following fashion:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
You "opt in" to be included in DRBD’s usage statistics (see
  <a class="xref" href="s-configure-resource.html#fp-usage-count" title="usage-count"><code class="literal">usage-count</code></a>).
</li><li class="listitem">
Resources are configured to use fully synchronous replication
  (<a class="link" href="s-replication-protocols.html" title="2.3. Replication modes">Protocol C</a>) unless explicitly specified
  otherwise.
</li><li class="listitem">
Our cluster consists of two nodes, <code class="literal">alice and bob</code>.
</li><li class="listitem">
We have a resource arbitrarily named <code class="literal">r0</code> which uses <code class="literal">/dev/sda7</code> as
  the lower-level device, and is configured with
  <a class="link" href="ch-internals.html#s-internal-meta-data" title="17.1.1. Internal meta data">internal meta data</a>.
</li><li class="listitem">
The resource uses TCP port 7789 for its network connections, and
  binds to the IP addresses 10.1.1.31 and 10.1.1.32, respectively.
</li></ul></div><p>The configuration above implicitly creates one volume in the
resource, numbered zero (<code class="literal">0</code>). For multiple volumes in one resource,
modify the syntax as follows:</p><p><strong>Multi-volume DRBD resource configuration (<code class="literal">/etc/drbd.d/r0.res</code>). </strong>
</p><pre class="screen">resource r0 {
  volume 0 {
    device    /dev/drbd1;
    disk      /dev/sda7;
    meta-disk internal;
  }
  volume 1 {
    device    /dev/drbd2;
    disk      /dev/sda8;
    meta-disk internal;
  }
  on alice {
    address   10.1.1.31:7789;
  }
  on bob {
    address   10.1.1.32:7789;
  }
}</pre><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>Volumes may also be added to existing resources on the fly. For
an example see <a class="xref" href="s-lvm-add-pv.html" title="10.5. Adding a new DRBD volume to an existing Volume Group">Section 10.5, “Adding a new DRBD volume to an existing Volume Group”</a>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="s-drbdconf-global"></a>5.3.2. The <code class="literal">global</code> section</h3></div></div></div><p>This section is allowed only once in the configuration. It is normally
in the <code class="literal">/etc/drbd.d/global_common.conf</code> file. In a single-file
configuration, it should go to the very top of the configuration
file. Of the few options available in this section, only one is of
relevance to most users:</p><p><a id="fp-usage-count"></a><strong><code class="literal">usage-count</code></strong>The DRBD project keeps statistics about the usage of various DRBD
versions. This is done by contacting an HTTP server every time a new
DRBD version is installed on a system. This can be disabled by setting
<code class="literal">usage-count no;</code>.  The default is <code class="literal">usage-count ask;</code> which will
prompt you every time you upgrade DRBD.</p><p>DRBD’s usage statistics are, of course, publicly available: see
<a class="ulink" href="http://usage.drbd.org" target="_blank">http://usage.drbd.org</a>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="s-drbdconf-common"></a>5.3.3. The <code class="literal">common</code> section</h3></div></div></div><p>This section provides a shorthand method to define configuration
settings inherited by every resource. It is normally found in
<code class="literal">/etc/drbd.d/global_common.conf</code>. You may define any option you can
also define on a per-resource basis.</p><p>Including a <code class="literal">common</code> section is not strictly required, but strongly
recommended if you are using more than one resource. Otherwise, the
configuration quickly becomes convoluted by repeatedly-used options.</p><p>In the example above, we included <code class="literal">net { protocol C; }</code> in the
<code class="literal">common</code> section, so every resource configured (including <code class="literal">r0</code>)
inherits this option unless it has another <code class="literal">protocol</code> option
configured explicitly. For other synchronization protocols available,
see <a class="xref" href="s-replication-protocols.html" title="2.3. Replication modes">Section 2.3, “Replication modes”</a>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="s-drbdconf-resource"></a>5.3.4. The <code class="literal">resource</code> sections</h3></div></div></div><p>A per-resource configuration file is usually named
<code class="literal">/etc/drbd.d/&lt;resource&gt;.res</code>.  Any DRBD resource you define must be
named by specifying resource name in the configuration. You may use
any arbitrary identifier, however the name must not contain characters
other than those found in the US-ASCII character set, and must also
not include whitespace.</p><p>Every resource configuration must also have two <code class="literal">on &lt;host&gt;</code> sub-sections
(one for every cluster node). All other configuration settings are
either inherited from the <code class="literal">common</code> section (if it exists), or derived
from DRBD’s default settings.</p><p>In addition, options with equal values on both hosts
can be specified directly in the <code class="literal">resource</code> section. Thus, we can
further condense our example configuration as follows:</p><pre class="screen">resource r0 {
  device    /dev/drbd1;
  disk      /dev/sda7;
  meta-disk internal;
  on alice {
    address   10.1.1.31:7789;
  }
  on bob {
    address   10.1.1.32:7789;
  }
}</pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="s-prepare-network.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch-configure.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="s-first-time-up.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.2. Preparing your network configuration </td><td width="20%" align="center"><a accesskey="h" href="drbd-users-guide.html">Home</a></td><td width="40%" align="right" valign="top"> 5.4. Enabling your resource for the first time</td></tr></table></div></body></html>