#
# drbd.conf example
#
# parameters you _need_ to change are the hostname, device, disk,
# address and port in the "on <hostname> {}" sections, as well as
# the disk-size.
# 
# you ought to know about the protocol, inittimeout,
# skip-wait and load-only; and the fsckcmd.
#
# you probably want to set the sync-min/-max, and maybe -nice.
#
# Common Trouble:
# increase the tl-size if you encounter "tl-size too small!!".
# 
# increase timeout and maybe ping-int in net{}, if you see
# problems with "conection lost/connection enabled"
# (or change your setup to reduce network latency; make sure full
#  duplex behaves as such; check average roundtrip times while
#  network is saturated ...)
#

# global {
    # use this if you want to define more resources later
    # without reloading the module.
    # by default we load the module with exactly as many devices
    # as configured mentioned in this file.
    # minor_count=5

    # this is for people who set up a drbd device via the
    # loopback network interface or between two VMs on the same
    # box, for testing/simulating/presentation
    # otherwise it could trigger a run_tasq_queue deadlock.
    # I'm not sure whether this deadlock can happen with two
    # nodes, but it seems at least extremly unlikely; and since
    # the io_hints boost performance, keep them enabled.
    # disable_io_hints
# }

#
# this need not be drbd#, you may use phony resource names,
# like "resource web" or "resource mail", too
#

resource drbd0 {

  # transfer protocol to use.
  # C: write IO is reported as completed, if we know it has
  #    reached _both_ local and remote DISK.
  #    * for critical transactional data.
  # B: write IO is reported as completed, if it has reached
  #    local DISK and remote buffer cache.
  #    * for most cases.
  # A: write IO is reported as completed, if it has reached
  #    local DISK and local tcp send buffer. (see also sndbuf-size)
  #    * for high latency networks
  protocol = B

  # command to run by the datadisk script prior to mounting the
  # device. with journaling fs, you might want to replace this
  # with /bin/true ...
  fsckcmd  = fsck -p -y

  # if inittimeout is positive will _force_ Primary status if
  # connection could not be established within that time
  # (seconds).  *this may compromise your data integrity*
  #
  # a negative value indicates that drbd should stay WFConnection
  # Secondary/Unknown and just continue the boot process, thus
  # leaving the decision to the cluster manager
  #
  # not given/0: wait until the partner node shows up, or
  # some operator intervenes; do not timeout.
  # inittimeout=60

  # skip-wait is actually skip-wait-for-sync ...
  # we wait for connection regardless (but see inittimeout above)
  # skip-wait

  # load-only: load the configuration data to the module only.
  # if you have a reasonably intelligent cluster manager,
  # you may want to use this instead of a negative
  # inittimeout for an unattended setup. this will not slow
  # down the boot process even if the partner node is not
  # seen.
  # load-only

  # what should be done in case the cluster starts up in
  # degraded mode, but knows it has inconsistent data
  # the default is: do nothing here, but leave it to the
  # cluster manager/operator.
  # incon-degr-cmd=halt -f

  disk {
    # if the lower level device reports io-error, we panic!
    # (standby node takes over)
    # comment this out, if you want to survive this, e.g. you do testing
    # only, or you have other means to cope with that.
    do-panic

    # the device size in bytes, default unit is k (1 block == 1024 bytes)
    # should be the minimum of the sizes of the lower level devices of
    # the nodes.
    # (since we often use 4k as logical block size,
    #  and I see "access beyond end of device" in some rare cases, when
    #  someone tries to access the last logical block with full block
    #  size, but it is some sectors shorter -- not drbd's fault, anyways)
    # it is probably best rounded _down_ to the next multiple of 4
    #####
    #####  Modifed by Paul on 05/26/2004
    #####
    ## disk-size = 4194304k
    disk-size = 376960k
  }

        # you can reconfigure the sync rate at runtime using
        # drbdsetup on the primary.

  net {
    # this is the size of the tcp socket send buffer
    # increase it _carefully_ if you want to use proto A over a
    # high latency network with reasonable write throughput.
    # defaults to 2*65535; you might try even 1M, but if your kernel or
    # network driver chokes on that, you have been warned. 
    # sndbuf-size = 512k 

    # if skip-sync is present (or = 1),
    # it will NOT do the first automatical sync.
    # you have to request the synchronisation explicitly.
    # subsequent reconnects (one node was down, then comes back,
    # temporary network failure, ...) WILL take place automatically.
    #
    # if skip-sync is >= 2, automatical sync will NEVER take
    # place, you have to request each of them by hand.
    # this is for testing purposes only, obviously.
    # skip-sync

    # sync-rate         # _deprecated_ synonym for sync-max
    # sync-nice  = -18  # if synchronization is high priority for you
    # sync-min   = 4M   # syncer tries hard to not drop below this rate
    # sync-max   = 100M # if you don't care about network saturation
                        # -max has to be larger than -min, obviously
    sync-min    = 500k
    sync-max    = 1M    # maximal average syncer bandwidth
    tl-size     = 5000  # transfer log size, ensures strict write ordering
    timeout     = 30    # 0.1 seconds - default was 60
    connect-int = 5     # seconds - default was 10
    ping-int    = 5     # seconds - default was 10

  }

  on suse1 {
    device  = /dev/nb0
    disk    = /dev/hdb1
    address = 207.86.37.41
    port    = 7788
  }

  on suse2 {
    device  = /dev/nb0
    disk    = /dev/sda3
    address = 207.86.37.42
    port    = 7788
  }
}
