<!DOCTYPE RefEntry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" []>
<refentry id="re-drbdconf">
<refentryinfo><date>15 Oct 2008</date></refentryinfo>

<refmeta>
 <refentrytitle>drbd.conf</refentrytitle>
 <manvolnum>5</manvolnum>
</refmeta>

<refnamediv>
 <refname>drbd.conf</refname>
 <refpurpose>Configuration file for DRBD's devices</refpurpose>
 <indexterm><primary>drbd.conf</primary></indexterm>
</refnamediv>
<refsect1>
 <title>Introduction</title>
 <para>
 The file <option>/etc/drbd.conf</option> is read by
 <option>drbdadm</option>.
 </para>
 <para>
 The file format was designed as to allow to have
 a verbatim copy of the file on both nodes of the cluster.
 It is highly recommended to do so in order to keep your configuration
 manageable. The file <option>/etc/drbd.conf</option> should be the same on both  nodes of the cluster. Changes to <option>/etc/drbd.conf</option> do not apply
 immediately.
<example>
<title>A small drbd.conf file</title>
<programlisting>
global { usage-count yes; }
common { syncer { rate 10M; } }
resource r0 {
	protocol C;
	net {
		cram-hmac-alg sha1;
		shared-secret "FooFunFactory";
	}
	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;
	}
}
</programlisting>
</example>
 In this example, there is a single DRBD resource (called r0) which uses
 protocol C for the connection between its devices.
 The device which runs
 on host <replaceable>alice</replaceable> uses
 <replaceable>/dev/drbd1</replaceable> as devices for its application, and
 <replaceable>/dev/sda7</replaceable> as low-level storage for the data.
 The IP addresses are used to specify the networking interfaces to be used.
 An eventually running resync process should use about 10MByte/second of IO
 bandwidth.
 </para>
 <para>
 There may be multiple resource sections in a single drbd.conf file.
 For more examples, please have a look at the
 <ulink url="http://www.drbd.org/users-guide/">
 <citetitle>DRBD User's Guide</citetitle></ulink>.
 </para>
</refsect1>
<refsect1>
 <title>File Format</title>
  <para>
  The file consists of sections and parameters.
  A section begins with a keyword, sometimes an additional name, and an
  opening brace (<quote>{</quote>).
  A section ends with a closing brace (<quote>}</quote>.
  The braces enclose the parameters.
  </para>
  <para>
  section [name] { parameter value; [...] }
  </para>
  <para>
  A parameter starts with the identifier of the parameter followed
  by whitespace. Every subsequent character
  is considered
  as part of the parameter's value. A special case are Boolean
  parameters which only consist of the identifier.
  Parameters are terminated by a semicolon (<quote>;</quote>).
  </para>
  <para>Some parameter values have default units which might be overruled
  by K, M or G. These units are defined in the usual way (K = 2^10 = 1024,
  M =  1024 K, G = 1024 M).
  </para>
  <para>
  Comments may be placed into the configuration file and must
  begin with a hash sign (<quote>#</quote>). Subsequent characters are ignored
  until the end of the line.
  </para>
 <refsect2>
 <title>Sections</title>
<variablelist>
<varlistentry>
  <term><option>skip</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>skip</secondary></indexterm>
    Comments out chunks of text, even spanning more than one line.
    Characters between the keyword <option>skip</option> and the opening
    brace (<quote>{</quote>) are ignored. Everything enclosed by the braces
    is skipped.
    This comes in handy, if you just want to comment out
    some 'resource [name] {...}' section: just precede it with 'skip'.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>global</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>global</secondary></indexterm>
    Configures some global parameters. Currently only
    <option>minor-count</option>, <option>dialog-refresh</option>,
    <option>disable-ip-verification</option> and <option>usage-count</option>
    are allowed here. You may only have one global section, preferably
    as the first section.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>common</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>common</secondary></indexterm>
    All resources inherit the options set in this section.
    The common section might have 
    a <option>startup</option>,
    a <option>syncer</option>,
    a <option>handlers</option>,
    a <option>net</option> and a <option>disk</option> section.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>resource <replaceable>name</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>resource</secondary></indexterm>
    Configures a DRBD resource.
    Each resource section needs to have two
    <option>on <replaceable>host</replaceable></option> sections
    and may have
    a <option>startup</option>,
    a <option>syncer</option>,
    a <option>handlers</option>,
    a <option>net</option> and a <option>disk</option> section.
    Required parameter in this section: <option>protocol</option>.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>on <replaceable>host-name</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>on</secondary></indexterm>
    Carries the necessary configuration parameters for a DRBD
    device of the enclosing resource.
    <replaceable>host-name</replaceable> is mandatory and must match the
    Linux host name (uname -n) of one of the nodes.
    Required parameters in this section: <option>device</option>,
    <option>disk</option>, <option>address</option>, <option>meta-disk</option>,
    <option>flexible-meta-disk</option>.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>disk</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>disk</secondary></indexterm>
    This section is used to fine tune DRBD's properties
    in respect to the low level storage. Please
    refer to <citerefentry><refentrytitle>drbdsetup</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry> for detailed description of
    the parameters.
    Optional parameter: <option>on-io-error</option>,
    <option>size</option>, <option>fencing</option>, <option>use-bmbv</option>,
    <option>no-disk-flushes</option>, <option>no-md-flushes</option>.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>net</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>net</secondary></indexterm>
    This section is used to fine tune DRBD's properties. Please
    refer to <citerefentry><refentrytitle>drbdsetup</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry> for a detailed description
    of this section's parameters.
    Optional parameters:
    <option>sndbuf-size</option>, <option>timeout</option>,
    <option>connect-int</option>, <option>ping-int</option>,
    <option>ping-timeout</option>,
    <option>max-buffers</option>, <option>max-epoch-size</option>,
    <option>ko-count</option>, <option>allow-two-primaries</option>,
    <option>cram-hmac-alg</option>, <option>shared-secret</option>,
    <option>after-sb-0pri</option>, <option>after-sb-1pri</option>,
    <option>after-sb-2pri</option>
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>startup</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>startup</secondary></indexterm>
    This section is used to fine tune DRBD's properties. Please
    refer to <citerefentry><refentrytitle>drbdsetup</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry> for a detailed description
    of this section's parameters.
    Optional parameters:
    <option>wfc-timeout</option>, <option>degr-wfc-timeout</option>,
    <option>wait-after-sb</option> and <option>become-primary-on</option>.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>syncer</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>syncer</secondary></indexterm>
    This section is used to fine tune the synchronization daemon
    for the device. Please
    refer to <citerefentry><refentrytitle>drbdsetup</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry> for a detailed description
    of this section's parameters.
    Optional parameters:
    <option>rate</option>, <option>after</option>, <option>al-extents</option>.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>handlers</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>handlers</secondary></indexterm>
    In this section you can define handlers (executables) that are executed
    by the DRBD system in response to certain events.
    Optional parameters:
    <option>pri-on-incon-degr</option>, <option>pri-lost-after-sb</option>,
    <option>pri-lost</option>, <option>outdate-peer</option>,
    <option>local-io-error</option>, <option>split-brain</option>.
  </para>
  </listitem>
</varlistentry>

</variablelist>
</refsect2>

 <refsect2>
 <title>Parameters</title>

<variablelist>

<varlistentry>
  <term><option>minor-count <replaceable>count</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>minor-count </secondary></indexterm>
    <replaceable>count</replaceable> may be a number from 1 to 255.
  </para>
  <para>Use <replaceable>minor-count</replaceable>
   if you want to define massively more resources later without reloading
   the DRBD kernel
   module. Per default the module loads with 11 more resources than you have currently
   in your config but at least 32.</para>
   </listitem>
</varlistentry>

<varlistentry>
  <term><option>dialog-refresh <replaceable>time</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>dialog-refresh </secondary></indexterm>
    <replaceable>time</replaceable> may be 0 or a positive number.
  </para>
  <para>The user dialog redraws the second count every
   <replaceable>time</replaceable> seconds (or does no redraws if
   <replaceable>time</replaceable> is 0). The default value is 1.</para>
   </listitem>
</varlistentry>

<varlistentry>
  <term><option>disable-ip-verification</option></term>
  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>disable-ip-verification</secondary></indexterm>
  <para>Use <replaceable>disable-ip-verification</replaceable>
   if, for some obscure reasons, drbdadm can/might not use ip or ifconfig
   to do a sanity check for the IP address. You can disable the IP verification  with 
   this option.
   </para>
   </listitem>
</varlistentry>

<varlistentry>
  <term><option>usage-count <replaceable>val</replaceable></option></term>
  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>usage-count </secondary></indexterm>
  <para>Please participate in
  <ulink url="http://usage.drbd.org">
  <citetitle>DRBD's online usage counter</citetitle></ulink>.
  The most convenient way to do so
  is to set this option to <option>yes</option>. Valid options are:
  <option>yes</option>, <option>no</option> and <option>ask</option>.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>protocol <replaceable>prot-id</replaceable></option></term>
  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>protocol</secondary></indexterm>
  <para>On the TCP/IP link the specified <replaceable>protocol</replaceable>
  is used. Valid protocol specifiers are A, B, and C.</para>
  <para>Protocol A: write IO is reported as completed, if it has
  reached local disk and local TCP send buffer.</para>
  <para>Protocol B: write IO is reported as completed, if it has reached
  local disk and remote buffer cache.</para>
  <para>Protocol C: write IO is reported as completed, if it has
  reached both local and remote disk.</para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>pri-on-incon-degr-cmd <replaceable>command</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>pri-on-incon-degr-cmd</secondary></indexterm>
    In case a node starts up in degraded mode (degr-wfc-timeout is set) and
    its local replica of the data is inconsistent, it executes the
    <replaceable>command</replaceable>. If the command exits without
    error, drbddisk expects the DRBD device to be in primary state.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>device <replaceable>name</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>device</secondary></indexterm>
    The name of the block device node of the resource being described.
    You must use this device with your application (file system) and
    you must not use the low level block device which is specified with the
    <option>disk</option> parameter.
  </para>
  <para>
    The device nodes must have the same major number as the DRBD
    driver. With the current implementation major 147 is used
    and the corresponding device nodes are usually named
    <option>/dev/drbd0</option>, <option>/dev/drbd1</option>, etc.
    ( All releases before drbd-0.7.1 used major 43 and the device
    files /dev/nb*. )
  </para>
  <para>Installation scripts of the DRBD package require that
  <option>/dev/drbd0</option> to <option>/dev/drbd8</option> are
  predefined in your system. To be sure, issue something like ls /dev/drbd*.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>disk <replaceable>name</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>disk</secondary></indexterm>
    DRBD uses this block device to actually store and retrieve the data.
    Never access such a device while DRBD is running on top of it. This
    holds also true for <citerefentry><refentrytitle>dumpe2fs</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry> and similar commands.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>address <replaceable>IP:port</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>address</secondary></indexterm>
    A resource needs one <replaceable>IP</replaceable> address per device,
    which is used to wait for
    incoming connections from the partner device respectively to reach
    the partner device.
  </para>
  <para>
    Each DRBD resource needs a TCP <replaceable>port</replaceable>
    which is used to connect to the node's partner device.
    Two different DRBD resources may not use the same
     <replaceable>IP:port</replaceable> combination on the same node.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>meta-disk <replaceable>internal</replaceable></option></term>
  <term><option>flexible-meta-disk <replaceable>internal</replaceable></option></term>
  <term><option>meta-disk <replaceable>device [index]</replaceable></option></term>
  <term><option>flexible-meta-disk <replaceable>device </replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>meta-disk</secondary></indexterm>
  <indexterm><primary>drbd.conf</primary><secondary>flexible-meta-disk</secondary></indexterm>
    Internal means that the last part of the backing device is used to store
    the meta-data. You must not use <replaceable>[index]</replaceable> with
    internal. Note: Regardless of whether you use the <option>meta-disk</option> or
    the <option>flexible-meta-disk</option> keyword, it will always be of
    the size needed for the remaining storage size.
  </para>
  <para>
   You can use a single block <replaceable>device</replaceable> to store
   meta-data of multiple DRBD devices.
   E.g. use meta-disk /dev/sde6[0]; and meta-disk /dev/sde6[1];
   for two different resources. In this case the meta-disk
   would need to be at least 256 MB in size.
  </para>

  <para>
   With the <option>flexible-meta-disk</option> keyword you specify
   a block device as meta-data storage. You usually use this with LVM,
   which allows you to have many variable sized block devices.
   The required size of the meta-disk block device is
   36kB + Backing-Storage-size / 32k. Round this number to the next 4kb
   boundary up and you have the exact size.
   Rule of the thumb: 32kByte per 1GByte of storage, round up to the next
   MB.</para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>on-io-error <replaceable>handler</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>on-io-error</secondary></indexterm>
  <replaceable>handler</replaceable> is taken, if the lower level
    device reports io-error to the upper layers.
  </para>
  <para>
  <replaceable>handler</replaceable> may be pass_on, call-local-io-error
  or detach.
  </para>
  <para>pass_on: Report the io-error to the upper layers. On Primary report
  it to the mounted file system. On Secondary ignore it.</para>
  <para>call-local-io-error: Call the handler script
         <option>local-io-error</option>.</para>
  <para>detach: The node drops its low level device, and continues in diskless mode.</para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>fencing <replaceable>fencing_policy</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>fencing</secondary></indexterm>
  Under <option>fencing</option> we understand preventive
  measures to avoid situations where both nodes are primary
  and disconnected (AKA split brain).
  </para>
  <para>Valid fencing policies are:</para>
  <variablelist>
    <varlistentry><term><option>dont-care</option></term>
      <listitem><para>
	This is the default policy. No fencing actions are undertaken.
      </para></listitem></varlistentry>
    <varlistentry><term><option>resource-only</option></term>
      <listitem><para>
	If a node becomes a disconnected primary, it tries to outdate
	the peer's disk. This is done by calling the outdate-peer
	handler. The handler is supposed to reach the other node over
	alternative communication paths and call 'drbdadm outdate
	res' there.
      </para></listitem></varlistentry>
    <varlistentry><term><option>resource-and-stonith</option></term>
      <listitem><para>
	If a node becomes a disconnected primary, it freezes all
	its IO operations and calls its outdate-peer handler. The
	outdate-peer handler is supposed to reach the peer over
	alternative communication paths and call 'drbdadm outdate
	res' there. In case it cannot reach the peer it should
	stonith the peer. IO is resumed as soon as the situation
	is resolved. In case your handler fails, you can resume
	IO with the <option>resume-io</option> command.
      </para></listitem></varlistentry>
    </variablelist>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>use-bmbv</option></term>
  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>use-bmbv</secondary></indexterm>
    <para>
      In case the backing storage's driver has a merge_bvec_fn() function,
       DRBD has to pretend that it can only process IO requests in
      units not lager than 4kByte. (At time of writing the only known drivers which have such a function
      are: md (software raid driver), dm (device mapper - LVM) and DRBD
      itself)</para>
    <para>
      To get best performance out of DRBD on top of software RAID (or any
      other driver with a merge_bvec_fn() function) you might enable this
      function, if you know for sure that the merge_bvec_fn() function will
      deliver the same results on all nodes of your cluster. I.e. the
      physical disks of the software RAID are of exactly the same
      type. <emphasis>Use this option only if you know what you are
      doing.</emphasis>
    </para>
   </listitem>
</varlistentry>

<varlistentry>
  <term><option>no-disk-flushes</option></term>
  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>no-disk-flushes</secondary></indexterm>
    <para>
      In case you are sure that your storage subsystem has
      battery-backed write cache, and you know from measurements that it
      really honors flush instructions by flushing data out from its
      non-volatile write cache to disk, you have double security. You might then
      reduce this to single security by disabling forced disk flushes with this
      option. It might improve performance in this case.</para>
    <para>
      If you use this option on plain disk drives, which have
      volatile write caches (enabled by default), you are at risk to lose
      your data with every power loss. <emphasis>Only use this option of you
      understand each and every statement in these two
      paragraphs.</emphasis>
      </para>
   </listitem>
</varlistentry>

<varlistentry>
  <term><option>no-md-flushes</option></term>
  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>no-md-flushes</secondary></indexterm>
    <para>
      Disables the use of disk flushes and barrier BIOs when accessing
      the meta data device. See the notes on <option>no-disk-flushes</option>.
    </para>
   </listitem>
</varlistentry>

<varlistentry>
  <term><option>sndbuf-size <replaceable>size</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>sndbuf-size </secondary></indexterm>
  <replaceable>size</replaceable> is the size of the TCP socket send buffer.
  The default value is 128K. You can specify smaller or larger values. Larger values
  are appropriate for reasonable write throughput with protocol A over high
  latency networks. Very large values like 1M may cause problems. Also values
  below 32K do not make much sense. Since 8.0.13 setting the <replaceable>size</replaceable>
  value to 0 means that the kernel should autotune this.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>timeout <replaceable>time</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>timeout</secondary></indexterm>
If the partner node fails to send an expected response packet within
<replaceable>time</replaceable> 10<superscript>ths</superscript>
of a second, the partner node
is considered dead and therefore the TCP/IP connection is abandoned. This must be lower than <replaceable>connect-int</replaceable> and <replaceable>ping-int</replaceable>.
The default value is 60 = 6 seconds, the unit 0.1 seconds.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>connect-int <replaceable>time</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>connect-int</secondary></indexterm>
In case it is not possible to connect to the remote DRBD device immediately,
DRBD keeps on trying to connect. With this option you can set the time
between two tries. The default value is 10 seconds, the unit is 1 second.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>ping-int <replaceable>time</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>ping-int</secondary></indexterm>
If the TCP/IP connection linking a DRBD device pair is idle for more than
<replaceable>time</replaceable> seconds, DRBD will generate a keep-alive
packet to check if its partner is still alive. The default is 10 seconds,
the unit is 1 second.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>ping-timeout <replaceable>time</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>ping-timeout</secondary></indexterm>
    The time the peer has time to answer to a keep-alive packet. In case
    the peer's reply is not received within this time period, it is
    considered as dead. The default value is 500ms, the default unit is 100ms.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>max-buffers <replaceable>number</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>max-buffers </secondary></indexterm>
  Maximum number of requests to be allocated by DRBD. Unit is PAGE_SIZE,
  which is 4 KB on most systems.
  The minimum is hard coded to 32 (=128 KB).
  For high-performance installations it might help, if you
  increase that number. These buffers are used to hold
  data blocks while they are written to disk.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>ko-count <replaceable>number</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>ko-count </secondary></indexterm>
	      In case the secondary node fails to complete a single write
	      request for <replaceable>count</replaceable> times the
	      <replaceable>timeout</replaceable>, it is expelled from the
	      cluster. (I.e. the primary node goes into StandAlone mode.)
	      The default value is 0, which disables this feature.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>max-epoch-size <replaceable>number</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>max-epoch-size </secondary></indexterm>
  The highest number of data blocks between two write barriers.
  If you set this smaller than 10, you might decrease your performance.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>allow-two-primaries</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>allow-two-primaries</secondary></indexterm>
    With this option set you may assign primary role to both nodes. You only should
    use this option if you use a shared storage file system on top of
    DRBD. At the time of writing the only ones are: OCFS2 and GFS. If you
    use this option with any other file system, you are going to crash your
    nodes and to corrupt your data!
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>unplug-watermark <replaceable>number</replaceable></option></term>
  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>unplug-watermark </secondary></indexterm>
    <para>
      When the number of pending write requests on the standby
      (secondary) node exceeds the unplug-watermark, we trigger
      the request processing of our backing storage device.
      Some storage controllers deliver better performance with small
      values, others deliver best performance when the value is set to
      the same value as max-buffers. Minimum 16, default 128, maximum
      131072.
    </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>cram-hmac-alg</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>cram-hmac-alg</secondary></indexterm>
    You need to specify the HMAC algorithm to enable peer authentication
    at all. You are strongly encouraged to use peer authentication. The HMAC
    algorithm will be used for the challenge response authentication
    of the peer. You may specify any digest algorithm that is named in
    /proc/crypto.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>shared-secret</option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>shared-secret</secondary></indexterm>
    The shared secret used in peer authentication. May be up to 64 characters.
    Note that peer authentication is disabled as long as no cram-hmac-alg
    (see above) is specified.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>after-sb-0pri </option><replaceable>policy</replaceable></term>
	  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>after-sb-0pri </secondary></indexterm>
	    <para>
	    possible policies are:
	    </para>
            <variablelist>
              <varlistentry><term><option>disconnect</option></term>
	        <listitem><para>
		  No automatic resynchronization, simply disconnect.
		</para></listitem></varlistentry>
	        <varlistentry><term><option>discard-younger-primary</option></term>
		<listitem><para>
		  Auto sync from the node that was primary before the split-brain situation happened.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-older-primary</option></term>
		<listitem><para>
		Auto sync from the node that became primary as second during
		the split-brain situation.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-zero-changes</option></term>
		<listitem><para>
		In case one node did not write anything since the split
		brain became evident, sync from the node that wrote something
		to the node that did not write anything. In case none wrote
		anything this policy uses a random decision to perform
		a "resync" of 0 blocks. In case both have written something
		this policy disconnects the nodes.
		</para></listitem></varlistentry>

		<varlistentry><term><option>discard-least-changes</option></term>
		<listitem><para>
		Auto sync from the node that touched more blocks during the
		split brain situation.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-node-NODENAME</option></term>
		<listitem><para>
		Auto sync to the named node.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
</varlistentry>

<varlistentry>
  <term><option>after-sb-1pri </option><replaceable>policy</replaceable></term>
	  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>after-sb-1pri </secondary></indexterm>
	    <para>
	    possible policies are:
	    </para>
            <variablelist>
              <varlistentry><term><option>disconnect</option></term>
	        <listitem><para>
		  No automatic resynchronization, simply disconnect.
		</para></listitem></varlistentry>
	        <varlistentry><term><option>consensus</option></term>
		<listitem><para>
		  Discard the version of the secondary if the outcome
                  of the <option>after-sb-0pri</option> algorithm would also
		  destroy the current secondary's data. Otherwise disconnect.
		</para></listitem></varlistentry>
		<varlistentry><term><option>violently-as0p</option></term>
		<listitem><para>
                  Always take the decision of the <option>after-sb-0pri</option>
                  algorithm. Even if that causes an erratic change of
                  the primary's view of the data.  This is only useful if
                  you use a 1node FS (i.e.  not OCFS2 or GFS) with the
                  allow-two-primaries flag, _AND_ if you really know what you
                  are doing.  This is DANGEROUS and MAY CRASH YOUR MACHINE
                  if you have an FS mounted on the primary node.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-secondary</option></term>
		<listitem><para>
		  Discard the secondary's version.
		</para></listitem></varlistentry>
		<varlistentry><term><option>call-pri-lost-after-sb</option></term>
		<listitem><para>
		  Always honor the outcome of the <option>after-sb-0pri
		  </option> algorithm. In case it decides the current
		  secondary has the right data, it calls the "pri-lost-after-sb"
		  handler on the current primary.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
</varlistentry>

<varlistentry>
  <term><option>after-sb-2pri </option><replaceable>policy</replaceable></term>
	  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>after-sb-2pri </secondary></indexterm>
	    <para>
	    possible policies are:
	    </para>
            <variablelist>
              <varlistentry><term><option>disconnect</option></term>
	        <listitem><para>
		  No automatic resynchronization, simply disconnect.
		</para></listitem></varlistentry>
              <varlistentry><term><option>violently-as0p</option></term>
	        <listitem><para>
                  Always take the decision of the <option>after-sb-0pri</option>
                  algorithm. Even if that causes an erratic change of
                  the primary's view of the data.  This is only useful if
                  you use a 1node FS (i.e.  not OCFS2 or GFS) with the
                  allow-two-primaries flag, _AND_ if you really know what you
                  are doing.  This is DANGEROUS and MAY CRASH YOUR MACHINE
                  if you have an FS mounted on the primary node.
		</para></listitem></varlistentry>
	        <varlistentry><term><option>call-pri-lost-after-sb</option></term>
		<listitem><para>
                   Call the "pri-lost-after-sb" helper program on one of the
    	           machines. This program is expected to reboot the
    	           machine, i.e. make it secondary.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
</varlistentry>

	<varlistentry>
	  <term><option>always-asbp</option></term>
	  <listitem>
	    <para>
	      Normally the automatic after-split-brain policies are only 
	      used if current states of the UUIDs do not indicate the 
	      presence of a third node.
	    </para>
	    <para>
	      With this option you request that the automatic 
	      after-split-brain policies are used as long as the data
	      sets of the nodes are somehow related. This might cause
	      a full sync, if the UUIDs indicate the presence of a third
	      node. (Or double faults led to strange UUID sets.)
	    </para>
	  </listitem>
	</varlistentry>

<varlistentry>
  <term><option>rr-conflict </option><replaceable>policy</replaceable></term>
	  <listitem>
  <indexterm><primary>drbd.conf</primary><secondary>rr-conflict </secondary></indexterm>
	    <para>
	    To solve the cases when the outcome of the resync decision is
	    incompatible with the current role assignment in the cluster.
	    </para>
            <variablelist>
              <varlistentry><term><option>disconnect</option></term>
	        <listitem><para>
		  No automatic resynchronization, simply disconnect.
		</para></listitem></varlistentry>
              <varlistentry><term><option>violently</option></term>
	        <listitem><para>
                   Sync to the primary node is allowed, violating the
    	           assumption that data on a block device are stable for one
    	           of the nodes. <emphasis>Dangerous, do not use.</emphasis>
		</para></listitem></varlistentry>
	        <varlistentry><term><option>call-pri-lost</option></term>
		<listitem><para>
                   Call the "pri-lost" helper program on one of the
    	           machines. This program is expected to reboot the
    	           machine, i.e. make it secondary.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
</varlistentry>

<varlistentry>
  <term><option>wfc-timeout <replaceable>time</replaceable></option></term>
  <listitem><para>Wait for connection timeout.
  <indexterm><primary>drbd.conf</primary><secondary>wfc-timeout </secondary></indexterm>
  The init script <citerefentry><refentrytitle>drbd</refentrytitle>
  <manvolnum>8</manvolnum></citerefentry> blocks the boot process
  until the DRBD resources are connected.
  When the cluster manager starts later,
  it does not see a resource with internal split-brain.
  In case you want to limit the wait time, do it here.
  Default is 0, which means unlimited. The unit is seconds.
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>degr-wfc-timeout <replaceable>time</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>degr-wfc-timeout </secondary></indexterm>
  Wait for connection timeout, if this node was a degraded cluster.
  In case a degraded cluster (= cluster with only one node left)
  is rebooted, this timeout value is used instead of wfc-timeout,
  because the peer is less likely to show up in time,
  if it had been dead before.
  The default value is 60, the unit is seconds. Value 0 means unlimited.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>wait-after-sb</option></term>
  <listitem><para>
  By setting this option you can make the init script to continue 
  to wait even if the device pair had a split brain situation
  and therefore refuses to connect.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>become-primary-on <replaceable>node-name</replaceable></option></term>
  <listitem><para>
  Sets on which node the device should be promoted to primary role by
  the init script. The <replaceable>node-name</replaceable> might either
  be a host name or the key word <option>both</option>. When this option is 
  not set the devices stay in secondary role on both nodes. Usually
  one delegates the role assignment to a cluster manager (e.g. heartbeat).
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>rate <replaceable>rate</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>rate </secondary></indexterm>
  To ensure a smooth operation of the application on top of DRBD,
  it is possible to limit the bandwidth which may be used by
  background synchronizations. The default is 250 KB/sec, the
  default unit is KB/sec. Optional suffixes K, M, G are allowed.
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>after <replaceable>res-name</replaceable></option></term>
  <listitem><para>
  <indexterm><primary>drbd.conf</primary><secondary>after </secondary></indexterm>
  By default, resynchronization of all devices would run in parallel.
  By defining a sync-after dependency, the resynchronization of this
  resource will start only if the resource <replaceable>res-name</replaceable>
  is already in connected state (= finished its resynchronization).
  </para></listitem>
</varlistentry>

<varlistentry>
  <term><option>al-extents <replaceable>extents</replaceable></option></term>
  <listitem><para>DRBD automatically performs hot area detection. With this
  <indexterm><primary>drbd.conf</primary><secondary>al-extents </secondary></indexterm>
  parameter you control how big the hot area (= active set) can
  get. Each extent marks 4M of the backing storage (= low-level device).
  In case a primary node leaves the cluster unexpectedly, the areas covered
  by the active set must be resynced upon rejoining of the failed
  node. The data structure is stored in the meta-data area, therefore each
  change of the active set is a write operation
  to the meta-data device. A higher number of extents gives
  longer resync times but less updates to the meta-data. The
  default number of <replaceable>extents</replaceable> is
  127. (Minimum: 7, Maximum: 3843)
  </para>
  </listitem>
</varlistentry>

<varlistentry>
  <term><option>pri-on-incon-degr <replaceable>cmd</replaceable></option></term>
  <listitem><para> This handler is called if the node is primary, degraded
  <indexterm><primary>drbd.conf</primary><secondary>pri-on-incon-degr </secondary></indexterm>
  and if the local copy of the data is inconsistent.</para></listitem>
  </varlistentry>

<varlistentry>
  <term><option>pri-lost-after-sb <replaceable>cmd</replaceable></option></term>
  <listitem><para> The node is currently primary, but lost the after split
  <indexterm><primary>drbd.conf</primary><secondary>pri-lost-after-sb </secondary></indexterm>
  brain auto recovery procedure. As as consequence, it should be abandoned.
  </para></listitem> </varlistentry>

<varlistentry>
  <term><option>pri-lost <replaceable>cmd</replaceable></option></term>
  <listitem><para> The node is currently primary, but DRBD's algorithm
  <indexterm><primary>drbd.conf</primary><secondary>pri-lost </secondary></indexterm>
  thinks that it should become sync target. As a consequence it should
  give up its primary role.
  </para></listitem> </varlistentry>

<varlistentry>
  <term><option>outdate-peer <replaceable>cmd</replaceable></option></term>
  <listitem><para> The handler is part of the <option>fencing</option>
  <indexterm><primary>drbd.conf</primary><secondary>outdate-peer </secondary></indexterm>
  mechanism.  This handler is called in case the node needs to outdate the
  peer's disk. It should use other communication paths than DRBD's network
  link.  </para></listitem> </varlistentry>

<varlistentry>
  <term><option>local-io-error <replaceable>cmd</replaceable></option></term>
  <listitem><para> DRBD got an IO error from the local IO subsystem.
  <indexterm><primary>drbd.conf</primary><secondary>local-io-error </secondary></indexterm>
  </para></listitem> </varlistentry>

<varlistentry>
  <term><option>split-brain <replaceable>cmd</replaceable></option></term>
  <listitem><para> DRBD detected a split brain situation. Manual recovery is necessary. 
      This handler should alert someone on duty.
  <indexterm><primary>drbd.conf</primary><secondary>split-brain </secondary></indexterm>
  </para></listitem> </varlistentry>

</variablelist>
</refsect2>
</refsect1>
<refsect1>
<title>Version</title>
<simpara>This document was revised for version 8.0.14 of the DRBD distribution.
</simpara>
</refsect1>
<refsect1>
<title>Author</title>
<simpara>Written by Philipp Reisner <email>philipp.reisner@linbit.com</email>
        and Lars Ellenberg <email>lars.ellenberg@linbit.com</email>.
</simpara>
</refsect1>
<refsect1>
<title>Reporting Bugs</title>
<simpara>Report bugs to <email>drbd-user@lists.linbit.com</email>.
</simpara>
</refsect1>
<refsect1>
<title>Copyright</title>
<simpara>
Copyright 2001-2008 LINBIT Information Technologies,
Philipp Reisner, Lars Ellenberg. This  is  free software;
see the source for copying conditions.  There is NO warranty;
not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</simpara>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
    <citerefentry><refentrytitle>drbd</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry>,
    <citerefentry><refentrytitle>drbddisk</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry>,
    <citerefentry><refentrytitle>drbdsetup</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry>,
    <citerefentry><refentrytitle>drbdadm</refentrytitle>
    <manvolnum>8</manvolnum></citerefentry>,
    <ulink url="http://www.drbd.org/users-guide/">
    <citetitle>DRBD User's Guide</citetitle></ulink>,
    <ulink url="http://www.drbd.org/">
    <citetitle>DRBD web site</citetitle></ulink>
</para>
</refsect1>
</refentry>






