# # drbd.conf example # # parameters you _need_ to change are the hostname, device, disk, # address and port in the "on {}" 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 "connection 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 most cases. # * the only protocol with true transactional semantics. # B: write IO is reported as completed, if it has reached # local DISK and remote buffer cache. # * should perform better than C, # but according to benchmarks, does not. # so use C instead for now. # 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 = C # 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 = /bin/true # 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 disk-size = 4194304k } # 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 # Resynchronization of all devices in one group runs parallel. # Groups are serialized in ascending order. You should avoid # that devices which lower devices share one and the same physical # disk sync in parallel. The default group is 0. I.e. per default # all devices sync parallel. # sync-group = 1 # 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 = 60 # unit: 0.1 seconds connect-int = 10 # unit: seconds ping-int = 10 # unit: seconds ko-count = 4 # if some block send times out this many times, # the peer is considered dead, even if it still # answeres ping requests } on tcube1 { device = /dev/nb0 disk = /dev/hda6 address = 10.1.1.31 port = 7788 } on tcube2 { device = /dev/nb0 disk = /dev/hda6 address = 10.1.1.32 port = 7788 } } resource drbd1 { protocol=C fsckcmd=fsck -p -y on tcube1 { device=/dev/nb1 # btw, don't do this. # did you notice that in this example we have two drbd devices # on the same spindle (hda)? performance will be bad. if you # use several drbd devices, put them on different spindles; # different channels/controllers won't be a bad idea for IDE. disk=/dev/hda7 address=10.1.1.31 port=7789 } on tcube2 { device=/dev/nb1 # and while we are at it, # if drbd throughput is low, please check your disk # throughput first. maybe you need to enable DMA? (-> man hdparm) disk=/dev/hda7 address=10.1.1.32 port=7789 } }