drbd-utils-8.9.6/ 0000755 0001750 0001750 00000000000 12654475367 013526 5 ustar apoikos apoikos drbd-utils-8.9.6/.gitmodules 0000644 0001750 0001750 00000000135 12477305373 015672 0 ustar apoikos apoikos [submodule "drbd-headers"]
path = drbd-headers
url = git://git.linbit.com/drbd-headers.git
drbd-utils-8.9.6/documentation/ 0000755 0001750 0001750 00000000000 12654475367 016377 5 ustar apoikos apoikos drbd-utils-8.9.6/documentation/aspell.en.per 0000644 0001750 0001750 00000003742 12466702073 020762 0 ustar apoikos apoikos personal_ws-1.1 en 285
ArbitraryCnt
BIOs
BLKFLSBUF
BLKGETSIZE
BLKSSZGET
BarrierAck
Bitmap's
BrokenPipe
ConnectedCnt
ConnectedInd
DRBD's
DUnknown
EAGAIN
EBUSY
EINVAL
ENOMEM
EOPNOTSUPP
Ellenberg
FIXME
GBit
GCs
GPL
GmbH
HumanCnt
IDE
JFS
KDIR
KOBJ
LANANA
LBD
LINBIT
MDF
NIC
NICs
NUL
NUM
NetworkFailure
PausedSyncS
PausedSyncT
Philipp
PingAck
ProtocolError
RAIDs
RHEL
RLE
ReIsErFs
Reisner
SETLKW
SIGALRM
SVN
SWAPSPACE
StandAlone
StartingSync
StartingSyncS
StartingSyncT
SyncParam
SyncSource
SyncTarget
SyncUUID
TCQ
TK
TODO
TearDown
TimeoutCnt
UI
UUIDs
UnknownMandatoryTag
UpToDate
VerifyS
VerifyT
WFBitMapS
WFBitMapT
WFConnection
WFReportParams
WFSyncUUID
WantFullSync
ack
acked
acks
actlog
addr
adm
al
alg
api
argc
args
argv
asbp
asender
asprintf
bm
bmbv
bnum
boolean
bsize
buildtag
bvec
cB
calloc
canonicalize
cfg
cgi
chdir
checksum
cmd
cmdname
cn
conf
config
conv
cpu
crypto
cstate
ctl
degr
dereference
dev
devfs
devname
diskless
diskstats
dont
dopd
drbd
drbdX
drbdadm
drbdmeta
drbdsetup
drbdtool
ds
dstate
dt
endian
endianness
enums
etext
evictable
exa
extraversion
fcntl
fd
fdopen
fgets
filesystem
fprintf
fs
fstat
fstype
gc
gcc
gethostbyname
gi
goto
haclient
hacluster
hdr
hexdump
hmac
hostname
http
idx
incon
init
inline
io
ip
ipv
irq
kb
kmalloc
ko
lastState
len
lge
libdisk
linux
lld
llu
ln
longjmp
longoptions
lookup
lr
lru
lu
lvm
malloc
md
mem
memalign
memset
metadata
mkdir
modprobe
multihomed
mutex
netlink
nodenames
noheadings
nop
nosuffix
nv
ok
online
oopsie
optind
ord
outdate
outdating
pagesize
param
parms
pathname
pid
plaintext
posix
pre
prepends
pri
printf
proc
pv
pvs
recurse
recurses
recv
refcnt
refcount
reiser
reiserfs
resize
resync
resynced
rr
runlength
sb
sbin
scmd
sendpage
sizeof
sndbuf
spinlock
ssocks
startup
stderr
stdout
stonith
str
strtoll
struct
subcommand
sublevel
superblock
suse
symlinks
syncer
sys
syscall
sysconf
tl
toc
tracepoint
tri
tty
udev
unconfigure
unconfigured
uniq
urandom
userland
userspace
usr
uuid
uuids
varname
vasprintf
vmalloc
wfc
wget
writeout
xfs
xfsprogs
xml
yylval
drbd-utils-8.9.6/documentation/fencing-by-constraints.txt 0000644 0001750 0001750 00000010027 12466702073 023512 0 ustar apoikos apoikos # vim: set foldenable foldmethod=indent sw=4 ts=8 :
# Copyright 2013 Linbit HA Solutions GmbH
# Lars Ellenberg @ linbit.com
TODO:
someone convert this into proper ascii doc please ;-)
... and draw some pictures ...
How crm-fence-peer.sh, pacemaker, and the OCF Linbit DRBD resource agent
are supposed to work together.
Two node cluster is the trickier one, because it has not real quorum.
Relative Timeouts
--dc-timeout > dead-time resp. stonith-timeout
if stonith enabled, --timeout >= --dc-timeout
if no stonith, then timeout may be small.
Pacemaker operations timeouts
monitor and promote action timeout > max(dc_timeout, timeout)
Node reboot, possibly because of crash or stonith due to communication loss
no peer reachable [no delay]
crm may decide to elect itself, shoot the peer,
and start services.
If DRBD peer disk state is known Outdated or worse, DRBD will
switch itself to UpToDate, allowing it to be promoted,
without further fencing actions.
If DRBD peer disk state is DUnknown, DRBD will be only Consistent.
In case crm decides to promote this instance, the fence-peer callback
runs, finds the peer "unreachable", finds itself Consistent only,
does NOT set any constraint, and DRBD refuses to be promoted.
CRM will now try in an endless loop to promote this instance.
Avoid this by adding
param adjust_master_score="0 10 1000 10000"
to the DRBD resource definition.
no replication link
CRM can see both nodes. [delay: crmadmin -S $peer]
If currently both nodes are Secondary Consistent, CRM will decide to
promote one instance. The fence-peer callback will find the other node
still reachable after timeout, and set the constraint.
If there is already one Primary, and this is a node rejoining the
cluster, there should already be a constraint preventing this node
from being promoted.
Only Replication link breaks during normal operation
Single Primary [delay: crmadmin -S $peer]
fence-peer callback finds DC,
crmadmin -S confirms peer still "reachable",
and sets contraint.
Dual Primary
both fence-peer callbacks find DC,
both see node_state "reachable",
optionaly delay for --network-hickup timeout,
and if DRBD is still disconnected,
both try to set the constraint.
Only one succeeds.
The loser should probably commit suicide,
to reduce the overall recovery time.
--suicide-on-failure-if-primary
Node crash
surviving node is Secondary, [no delay]
If not DC, triggers DC election, elects itself.
Is DC now.
If stonith enabled, shoots the peer.
Promotes this node.
During promotion, fenc-peer callback
finds a DC, and a node_state "unreachable",
so sets the constraint "immediately".
surviving node is Primary (DC) [delay up to timeout]
If stonith enabled, shoots the peer.
fence-peer callback finds DC, after some
time sees node_state "unreachable",
or times out while node_state is still "reachable".
Either way still sets the constraint.
surviving node is Primary (not DC) [delay up to mac(dc_timeout,timeout)]
fence-peer callback loops trying to contact DC.
eventually this node is elected DC.
If stonith enabled, shoots the peer.
Fence-peer callback either times out while no DC is available,
thus fails. Make sure you chose a suitable --dc-timeout.
Or it finds the other node "unreachable",
and sets the constraint.
Total communication loss
To the single node, this looks like node crash, so see above.
The difference is the potential of data divergence.
If DRBD was configured for "fencing resource-and-stonith",
IO on any Primary is frozen while the fence-peer callback runs.
If stonith is enabled, timeouts should be selected so that
we are shot while waiting for the DC to confirm node_state
"unreachable" of the peer, thus combined with freezing IO,
no harmful data diversion can happen at this time.
If there is no stonith enabled, data divergence is unavoidable.
==> Multi-Primary *requires*
both node level fencing (stonith)
AND drbd resource level fencing
Again: Multi-Primary REQUIRES stonith enabled and working.
drbd-utils-8.9.6/documentation/v84/ 0000755 0001750 0001750 00000000000 12654475367 017020 5 ustar apoikos apoikos drbd-utils-8.9.6/documentation/v84/drbdmeta.8 0000644 0001750 0001750 00000014324 12654452472 020667 0 ustar apoikos apoikos '\" t
.\" Title: drbdmeta
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 15 Oct 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBDMETA" "8" "15 Oct 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdmeta \- DRBD\'s meta data management tool .\" drbdmeta
.SH "SYNOPSIS"
.HP \w'\fBdrbdmeta\fR\ 'u
\fBdrbdmeta\fR [\-\-force] [\-\-ignore\-sanity\-checks] {\fIdevice\fR} {v06\ \fIminor\fR | v07\ \fImeta_dev\ index\fR | v08\ \fImeta_dev\ index\fR} {\fIcommand\fR} [\fIcmd\ args\fR...]
.SH "DESCRIPTION"
.PP
Drbdmeta is used to create, display and modify the contents of DRBD\'s meta data storage\&. Usually you do not want to use this command directly, but start it via the frontend
\fBdrbdadm\fR(8)\&.
.PP
This command only works if the DRBD resource is currently down, or at least detached from its backing storage\&. The first parameter is the device node associated to the resource\&. With the second parameter you can select the version of the meta data\&. Currently all major DRBD releases (0\&.6, 0\&.7 and 8) are supported\&.
.SH "OPTIONS"
.PP
\-\-force
.RS 4
.\" drbdmeta: --force
All questions that get asked by drbdmeta are treated as if the user answered \'yes\'\&.
.RE
.PP
\-\-ignore\-sanity\-checks
.RS 4
.\" drbdmeta: --ignore-sanity-checks
Some sanity checks cause drbdmeta to terminate\&. E\&.g\&. if a file system image would get destroyed by creating the meta data\&. By using that option you can force drbdmeta to ignore these checks\&.
.RE
.SH "COMMANDS"
.PP
create\-md \fB\-\-peer\-max\-bio\-size \fR\fB\fIval\fR\fR \fB\-\-al\-stripes \fR\fB\fIval\fR\fR \fB\-\-al\-stripe\-size\-kB \fR\fB\fIval\fR\fR
.RS 4
.\" drbdmeta: create-md
Create\-md initializes the meta data storage\&. This needs to be done before a DRBD resource can be taken online for the first time\&. In case there is already a meta data signature of an older format in place, drbdmeta will ask you if it should convert the older format to the selected format\&.
.sp
If you will use the resource before it is connected to its peer for the first time DRBD may perform better if you use the
\fB\-\-peer\-max\-bio\-size\fR
option\&. For DRBD versions of the peer use up to these values: <8\&.3\&.7 \-> 4k, 8\&.3\&.8 \-> 32k, 8\&.3\&.9 \-> 128k, 8\&.4\&.0 \-> 1M\&.
.sp
If you want to use more than 6433 activity log extents, or live on top of a spriped RAID, you may specify the number of stripes (\fB\-\-al\-stripes\fR, default 1), and the stripe size (\fB\-\-al\-stripe\-size\-kB\fR, default 32)\&. To just use a larger linear on\-disk ring\-buffer, leave the number of stripes at 1, and increase the size only:
\fBdrbdmeta 0 v08 /dev/vg23/lv42 internal create\-md \-\-al\-stripe\-size 1M\fR
.sp
To avoid a single "spindle" from becoming a bottleneck, increase the number of stripes, to achieve an interleaved layout of the on\-disk activity\-log transactions\&. What you give as "stripe\-size" should be what is a\&.k\&.a\&. "chunk size" or "granularity" or "strip unit": the minimum skip to the next "spindle"\&.
\fBdrbdmeta 0 v08 /dev/vg23/lv42 internal create\-md \-\-al\-stripes 7 \-\-al\-stripe\-size 64k\fR
.RE
.PP
get\-gi
.RS 4
.\" drbdmeta: get-gi
Get\-gi shows a short textual representation of the data generation identifier\&. In version 0\&.6 and 0\&.7 these are generation counters, while in version 8 it is a set of UUIDs\&.
.RE
.PP
show\-gi
.RS 4
.\" drbdmeta: show-gi
Show\-gi prints a textual representation of the data generation identifiers including explanatory information\&.
.RE
.PP
dump\-md
.RS 4
.\" drbdmeta: dump-md
Dumps the whole contents of the meta data storage including the stored bit\-map and activity\-log in a textual representation\&.
.RE
.PP
outdate
.RS 4
.\" drbdmeta: outdate
Sets the outdated flag in the meta data\&. This is used by the peer node when it wants to become primary, but cannot communicate with the DRBD stack on this host\&.
.RE
.PP
dstate
.RS 4
.\" drbdmeta: dstate
Prints the state of the data on the backing storage\&. The output is always followed by \'/DUnknown\' since drbdmeta only looks at the local meta data\&.
.RE
.PP
check\-resize
.RS 4
.\" drbdmeta: check-resize
Examines the device size of a backing device, and it\'s last known device size, recorded in a file /var/lib/drbd/drbd\-minor\-??\&.lkbd\&. In case the size of the backing device changed, and the meta data can be found at the old position, it moves the meta data to the right position at the end of the block device\&.
.RE
.SH "EXPERT'S COMMANDS"
.PP
Drbdmeta allows you to modify the meta data as well\&. This is intentionally omitted for the command\'s usage output, since you should only use it if you really know what you are doing\&. By setting the generation identifiers to wrong values, you risk to overwrite your up\-to\-data data with an older version of your data\&.
.PP
set\-gi \fIgi\fR
.RS 4
.\" drbdmeta: set-gi
Set\-gi allows you to set the generation identifier\&.
\fIGi\fR
needs to be a generation counter for the 0\&.6 and 0\&.7 format, and a UUID set for 8\&.x\&. Specify it in the same way as get\-gi shows it\&.
.RE
.PP
restore\-md \fIdump_file\fR
.RS 4
.\" drbdmeta: restore-md
Reads the
\fIdump_file\fR
and writes it to the meta data\&.
.RE
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbdadm\fR(8)
drbd-utils-8.9.6/documentation/v84/drbdsetup.xml 0000644 0001750 0001750 00000243331 12645466445 021541 0 ustar apoikos apoikos
6 May 2011DRBD8.4.0drbdsetup8System AdministrationdrbdsetupSetup tool for DRBD drbdsetupDescriptiondrbdsetup is used to associate DRBD devices with their backing block devices, to set up
DRBD device pairs to mirror their backing block devices, and to inspect the configuration of
running DRBD devices.Notedrbdsetup is a low level tool of the DRBD program suite. It is used by the data disk and
drbd scripts to communicate with the device driver.CommandsEach drbdsetup sub-command might require arguments and bring its own set of options. All
values have default units which might be overruled by K, M or G. These units are defined in
the usual way (e.g. K = 2^10 = 1024).Common optionsAll drbdsetup sub-commands accept these two options In case the specified DRBD device (minor number) does not exist yet, create it
implicitly.new-resourceResources are the primary objects of any DRBD configuration. A resource must be created
with the command before any volumes or minor devices can be created.
Connections are referenced by name.new-minorA minor is used as a synonym for replicated block device. It is
represented in the /dev/ directory by a block device. It is the application's interface to
the DRBD-replicated block devices. These block devices get addressed by their minor numbers
on the drbdsetup commandline.A pair of replicated block devices may have different minor numbers on the two
machines. They are associated by a common volume-number. Volume numbers
are local to each connection. Minor numbers are global on one node.del-resourceDestroys a resource object. This is only possible if the resource has no
volumes.del-minorMinors can only be destroyed if its disk is detached.attach, disk-optionsdrbdsetupdiskAttach associates device with
lower_device to store its data blocks on. The
(or ) should only be used if you wish not to use as much as
possible from the backing block devices. If you do not use , the
device is only ready for use as soon as it was connected to its
peer once. (See the command.)With the disk-options command it is possible to change the options of a minor while it
is attached.You can override DRBD's size determination method with this option. If you need
to use the device before it was ever connected to its peer, use this option to pass
the size of the DRBD device to the driver. Default unit is
sectors (1s = 512 bytes).If you use the size parameter in drbd.conf, we
strongly recommend to add an explicit unit postfix. drbdadm and drbdsetup used to have
mismatching default units.If the driver of the lower_device
reports an error to DRBD, DRBD will mark the disk as inconsistent,
call a helper program, or detach the device from its backing storage and perform all
further IO by requesting it from the peer. The valid
err_handlers are: ,
and .Under we understand preventive measures to avoid
situations where both nodes are primary and disconnected (AKA split brain).Valid fencing policies are:This is the default policy. No fencing actions are done.If a node becomes a disconnected primary, it tries to outdate the peer's
disk. This is done by calling the fence-peer handler. The handler is supposed to
reach the other node over alternative communication paths and call 'drbdadm
outdate res' there.If a node becomes a disconnected primary, it freezes all its IO operations
and calls its fence-peer handler. The fence-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 command.DRBD has four implementations to express write-after-write dependencies to its
backing storage device. DRBD will use the first method that is supported by the
backing storage device and that is not disabled. By default the flush
method is used.Since drbd-8.4.2 is disabled by default
because since linux-2.6.36 (or 2.6.32 RHEL6) there is no reliable way to determine if queuing
of IO-barriers works. Dangerous only enable if you are
told so by one that knows for sure.When selecting the method you should not only base your decision on the
measurable performance. In case your backing storage device has a volatile write cache
(plain disks, RAID of plain disks) you should use one of the first two. In case your
backing storage device has battery-backed write cache you may go with option 3.
Option 4 (disable everything, use "none") is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .Unfortunately device mapper (LVM) might not support barriers.The letter after "wo:" in /proc/drbd indicates with method is currently in use
for a device: b, f, d, n. The implementations:barrierThe first requires that the driver of the backing storage device support
barriers (called 'tagged command queuing' in SCSI and 'native command queuing'
in SATA speak). The use of this method can be enabled by setting the
options to .flushThe second requires that the backing device support disk flushes (called
'force unit access' in the drive vendors speak). The use of this method can be
disabled setting to .drainThe third method is simply to let write requests drain before write
requests of a new reordering domain are issued. That was the only implementation
before 8.0.9.noneThe fourth method is to not express write-after-write dependencies to
the backing store at all, by also specifying .
This is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .Disables the use of disk flushes and barrier BIOs when accessing the meta data
device. See the notes on .In some special circumstances the device mapper stack manages to pass BIOs to
DRBD that violate the constraints that are set forth by DRBD's merge_bvec() function
and which have more than one bvec. A known example is: phys-disk -> DRBD -> LVM
-> Xen -> missaligned partition (63) -> DomU FS. Then you might see "bio
would need to, but cannot, be split:" in the Dom0's kernel log.The best workaround is to proper align the partition within the VM (E.g. start
it at sector 1024). That costs 480 KiB of storage. Unfortunately the default of most
Linux partitioning tools is to start the first partition at an odd number (63).
Therefore most distributions install helpers for virtual linux machines will end up
with missaligned partitions. The second best workaround is to limit DRBD's max bvecs
per BIO (i.e., the option) to 1, but that might cost
performance.The default value of is 0, which means that there
is no user imposed limitation.To ensure smooth operation of the application on top of DRBD, it is possible to
limit the bandwidth that may be used by background synchronization. The default is 250
KiB/sec, the default unit is KiB/sec.Start resync on this device only if the device with
minor is already in connected state. Otherwise this device
waits in SyncPause state.DRBD automatically performs hot area detection. With this parameter you control
how big the hot area (=active set) can get. Each extent marks 4M of the backing
storage. 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
extents is 1237. (Minimum: 7, Maximum: 65534)See also
drbd.conf5
and
drbdmeta8
for additional limitations and necessary preparation.
DRBD's activity log transaction writing makes it possible, that
after the crash of a primary node a partial (bit-map based) resync is
sufficient to bring the node back to up-to-date.
Setting to might increase
normal operation performance but causes DRBD to do a full resync
when a crashed primary gets reconnected. The default value is .
The dynamic resync speed controller gets enabled with setting
plan_time to a positive value. It aims to fill the buffers
along the data path with either a constant amount of data
fill_target, or aims to have a constant delay time of
delay_target along the path. The controller has an upper
bound of max_rate.By plan_time the agility of the controller is
configured. Higher values yield for slower/lower responses of the controller to
deviation from the target value. It should be at least 5 times RTT. For regular data
paths a fill_target in the area of 4k to 100k is
appropriate. For a setup that contains drbd-proxy it is advisable to use
delay_target instead. Only when
fill_target is set to 0 the controller will use
delay_target. 5 times RTT is a reasonable starting value.
Max_rate should be set to the bandwidth available between
the DRBD-hosts and the machines hosting DRBD-proxy, or to the available
disk-bandwidth.The default value of plan_time is 0, the default unit
is 0.1 seconds. Fill_target has 0 and sectors as default
unit. Delay_target has 1 (100ms) and 0.1 as default unit.
Max_rate has 10240 (100MiB/s) and KiB/s as default
unit.We track the disk IO rate caused by the resync, so we can detect non-resync IO
on the lower level device. If the lower level device seems to be busy, and the current
resync rate is above min_rate, we throttle the
resync.The default value of min_rate is 4M, the default unit
is k. If you want to not throttle at all, set it to zero, if you want to throttle
always, set it to one.,
If the lower-level device on which a DRBD device stores its data does
not finish an I/O request within the defined
, DRBD treats this as a failure. The
lower-level device is detached, and the device's disk state advances to
Diskless. If DRBD is connected to one or more peers, the failed request
is passed on to one of them.This option is dangerous and may lead to kernel panic!"Aborting" requests, or force-detaching the disk, is intended for
completely blocked/hung local backing devices which do no longer
complete requests at all, not even do error completions. In this
situation, usually a hard-reset and failover is the only way out.By "aborting", basically faking a local error-completion,
we allow for a more graceful swichover by cleanly migrating services.
Still the affected node has to be rebooted "soon".By completing these requests, we allow the upper layers to re-use
the associated data pages.If later the local backing device "recovers", and now DMAs some data
from disk into the original request pages, in the best case it will
just put random data into unused pages; but typically it will corrupt
meanwhile completely unrelated data, causing all sorts of damage.Which means delayed successful completion,
especially for READ requests, is a reason to panic().
We assume that a delayed *error* completion is OK,
though we still will complain noisily about it.The default value of
is 0, which stands for an infinite timeout.
Timeouts are specified in units of 0.1 seconds. This option is available
since DRBD 8.3.12.
Setting to
will cause DRBD to always fall-back to zero-out on the receiving side,
and to not even announce discard capabilities on the Primary,
if the respective backend announces discard_zeroes_data=false.
Setting to
will allow DRBD to use discards, and to announce discard_zeroes=true,
even on backends that announce discard_zeroes_data=false.
We used to ignore the discard_zeroes_data setting completely.
To not break established and expected behaviour,
the default value is .
This option is available since 8.4.7.
See also drbd.conf5.
The supported methods for load balancing of
read requests are , ,
, and
, ,
, ,
,
and . The default value of is .
This option is available since 8.4.1.
When is set to a non zero, positive
value then DRBD tries to do a resync operation in requests of this size.
In case such a block contains only zero bytes on the sync source node,
the sync target node will issue a discard/trim/unmap command for
the area.The value is constrained by the discard granularity of the backing
block device. In case is not a
multiplier of the discard granularity of the backing block device DRBD
rounds it up. The feature only gets active if the backing block device
reads back zeroes after a discard command. The default value of is 0. This option is available since 8.4.7.
connect, net-optionsdrbdsetupnetConnect sets up the device to listen on
af:local_addr:port for incoming connections and to try to connect
to af:remote_addr:port. If port is
omitted, 7788 is used as default. If af is omitted
gets used. Other supported address families are ,
for Dolphin Interconnect Solutions' "super sockets" and
for Sockets Direct Protocol (Infiniband).The net-options command allows you to change options while the connection is
established.On the TCP/IP link the specified protocol is used.
Valid protocol specifiers are A, B, and C.Protocol A: write IO is reported as completed, if it has reached local disk and
local TCP send buffer.Protocol B: write IO is reported as completed, if it has reached local disk and
remote buffer cache.Protocol C: write IO is reported as completed, if it has reached both local and
remote disk.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
retries. The default value is 10. The unit is seconds.If the TCP/IP connection linking a DRBD device pair is idle for more than
time seconds, DRBD will generate a keep-alive packet to
check if its partner is still alive. The default value is 10. The unit is
seconds.If the partner node fails to send an expected response packet within
val tenths of a second, the partner node is considered dead
and therefore the TCP/IP connection is abandoned. The default value is 60 (= 6
seconds).The socket send buffer is used to store packets sent to the secondary node,
which are not yet acknowledged (from a network point of view) by the secondary node.
When using protocol A, it might be necessary to increase the size of this data
structure in order to increase asynchronicity between primary and secondary nodes. But
keep in mind that more asynchronicity is synonymous with more data loss in the case of
a primary node failure. Since 8.0.13 resp. 8.2.7 setting the
size value to 0 means that the kernel should autotune this.
The default size is 0, i.e. autotune.Packets received from the network are stored in the socket receive buffer first.
From there they are consumed by DRBD. Before 8.3.2 the receive buffer's size was
always set to the size of the socket send buffer. Since 8.3.2 they can be tuned
independently. A value of 0 means that the kernel should autotune this. The default
size is 0, i.e. autotune.In case the secondary node fails to complete a single write request for
count times the timeout, it is
expelled from the cluster, i.e. the primary node goes into StandAlone mode.
To disable this feature, you should explicitly set it to 0; defaults may change between versions.
With this option the maximal number of write requests between
two barriers is limited. Typically set to the same as
, or the allowed maximum.
Values smaller than 10 can lead to degraded performance.
The default value is 2048.
With this option the maximal number of buffer pages allocated by DRBD's receiver
thread is limited. Typically set to the same as .
Small values could lead to degraded performance. The default value is 2048, the minimum 32.
Increase this if you cannot saturate the IO backend of the receiving side during linear write
or during resync while otherwise idle.See also drbd.conf5
This setting has no effect with recent kernels that use explicit on-stack
plugging (upstream Linux kernel 2.6.39, distributions may have backported).
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,
yet others don't feel much effect at all.
Minimum 16, default 128, maximum 131072.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!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.The shared secret used in peer authentication. May be up to 64
characters.possible policies are:No automatic resynchronization, simply disconnect.Auto sync from the node that was primary before the split-brain situation
occurred.Auto sync from the node that became primary as second during the
split-brain situation.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.Auto sync from the node that touched more blocks during the split brain
situation.Auto sync to the named node.possible policies are:No automatic resynchronization, simply disconnect.Discard the version of the secondary if the outcome of the
algorithm would also destroy the current
secondary's data. Otherwise disconnect.Discard the secondary's version.Always honor the outcome of the algorithm.
In case it decides the current secondary has the correct data, call the
on the current primary.Always honor the outcome of the algorithm.
In case it decides the current secondary has the correct data, accept a possible
instantaneous change of the primary's data.possible policies are:No automatic resynchronization, simply disconnect.Always honor the outcome of the algorithm.
In case it decides the current secondary has the right data, call the
on the current primary.Always honor the outcome of the algorithm.
In case it decides the current secondary has the right data, accept a possible
instantaneous change of the primary's data.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.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 have
led to strange UUID sets.)This option sets DRBD's behavior when DRBD deduces from its meta data that a
resynchronization is needed, and the SyncTarget node is already primary. The possible
settings are: , and
. While speaks for itself, with
the setting the handler is
called which is expected to either change the role of the node to secondary, or remove
the node from the cluster. The default is .With the setting you allow DRBD to force a primary
node into SyncTarget state. This means that the data exposed by DRBD changes to the
SyncSource's version of the data instantaneously. USE THIS OPTION ONLY IF YOU KNOW
WHAT YOU ARE DOING.DRBD can ensure the data integrity of the user's data on the network by
comparing hash values. Normally this is ensured by the 16 bit checksums in the headers
of TCP/IP packets. This option can be set to any of the kernel's data digest
algorithms. In a typical kernel configuration you should have at least one of
, , and available. By
default this is not enabled.See also the notes on data integrity on the drbd.conf manpage.DRBD usually uses the TCP socket option TCP_CORK to hint to the network stack
when it can expect more data, and when it should flush out what it has in its send
queue. There is at least one network stack that performs worse when one uses this
hinting method. Therefore we introduced this option, which disable the setting and
clearing of the TCP_CORK socket option by DRBD.The time the peer has to answer to a keep-alive packet. In case the peer's reply
is not received within this time period, it is considered dead. The default unit is
tenths of a second, the default value is 5 (for half a second).Use this option to manually recover from a split-brain situation. In case you do
not have any automatic after-split-brain policies selected, the nodes refuse to
connect. By passing this option you make this node a sync target immediately after
successful connect.Causes DRBD to abort the connection process after the resync handshake, i.e. no
resync gets performed. You can find out which resync DRBD would perform by looking at
the kernel's log file.By default DRBD blocks when the available TCP send queue becomes full. That
means it will slow down the application that generates the write requests that cause
DRBD to send more data down that TCP connection.When DRBD is deployed with DRBD-proxy it might be more desirable that DRBD goes
into AHEAD/BEHIND mode shortly before the send queue becomes full. In AHEAD/BEHIND
mode DRBD does no longer replicate data, but still keeps the connection open.The advantage of the AHEAD/BEHIND mode is that the application is not slowed
down, even if DRBD-proxy's buffer is not sufficient to buffer all write requests. The
downside is that the peer node falls behind, and that a resync will be necessary to
bring it back into sync. During that resync the peer node will have an inconsistent
disk.Available congestion_policys are
and . The default is
. Fill_threshold might be in the
range of 0 to 10GiBytes. The default is 0 which disables the check.
Active_extents_threshold has the same limits as
.The AHEAD/BEHIND mode and its settings are available since DRBD 8.3.10.During online verification (as initiated by the verify sub-command), rather than doing a bit-wise
comparison, DRBD applies a hash function to the contents of every block being
verified, and compares that hash with the peer. This option defines the hash algorithm
being used for that purpose. It can be set to any of the kernel's data digest
algorithms. In a typical kernel configuration you should have at least one of
, , and available. By
default this is not enabled; you must set this option explicitly in order to be able
to use on-line device verification.See also the notes on data integrity on the drbd.conf manpage.A resync process sends all marked data blocks form the source to the destination
node, as long as no is given. When one is specified the
resync process exchanges hash values of all marked blocks first, and sends only those
data blocks over, that have different hash values.This setting is useful for DRBD setups with low bandwidth links. During the
restart of a crashed primary node, all blocks covered by the activity log are marked
for resync. But a large part of those will actually be still in sync, therefore using
will lower the required bandwidth in exchange for CPU
cycles.During resync-handshake, the dirty-bitmaps of the nodes are exchanged and merged
(using bit-or), so the nodes will have the same understanding of which blocks are
dirty. On large devices, the fine grained dirty-bitmap can become large as well, and
the bitmap exchange can take quite some time on low-bandwidth links.Because the bitmap typically contains compact areas where all bits are unset
(clean) or set (dirty), a simple run-length encoding scheme can considerably reduce
the network traffic necessary for the bitmap exchange.For backward compatibility reasons, and because on fast links this possibly does
not improve transfer time but consumes cpu cycles, this defaults to off.Introduced in 8.3.2.In setups involving a DRBD-proxy and connections that experience a lot of
buffer-bloat it might be necessary to set to an
unusual high value. By default DRBD uses the same value to wait if a newly
established TCP-connection is stable. Since the DRBD-proxy is usually located
in the same data center such a long wait time may hinder DRBD's connect process.
In such setups should be set to
at least to the round trip time between DRBD and DRBD-proxy. I.e. in most
cases to 1.
The default unit is tenths of a second, the default value is 0 (which causes
DRBD to use the value of instead).
Introduced in 8.4.5.resource-optionsdrbdsetupresource-optionsChanges the options of the resource at runtime.Sets the cpu-affinity-mask for DRBD's kernel threads of this device. The default
value of cpu-mask is 0, which means that DRBD's kernel
threads should be spread over all CPUs of the machine. This value must be given in
hexadecimal notation. If it is too big it will be truncated.This setting controls what happens to IO requests on a degraded, disk less node
(I.e. no data store is reachable). The available policies are
and .If ond-policy is set to
you can either resume IO by attaching/connecting the last lost data storage, or by the
drbdadm resume-io res
command. The latter will result in IO errors of course.The default is . This setting is available since DRBD
8.3.9.primarydrbdsetupprimarySets the device into primary role. This means that
applications (e.g. a file system) may open the device for read
and write access. Data written to the device in primary role are
mirrored to the device in secondary role.Normally it is not possible to set both devices of a connected DRBD device pair to
primary role. By using the option, you override this
behavior and instruct DRBD to allow two primaries.Alias for --force.Becoming primary fails if the local replica is not up-to-date. I.e. when it is
inconsistent, outdated of consistent. By using this option you can force it into
primary role anyway. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.secondarydrbdsetupsecondaryBrings the device into secondary role. This operation fails
as long as at least one application (or file system) has opened the device.It is possible that both devices of a connected DRBD device pair are secondary.verifydrbdsetupverifyThis initiates on-line device verification. During on-line verification, the contents
of every block on the local node are compared to those on the peer node. Device verification
progress can be monitored via /proc/drbd. Any blocks
whose content differs from that of the corresponding block on the peer node will be marked
out-of-sync in DRBD's on-disk bitmap; they are not brought back in sync
automatically. To do that, simply disconnect and reconnect the resource.If on-line verification is already in progress (and this node is "VerifyS"),
this command silently "succeeds". In this case, any start-sector (see
below) will be ignored, and any stop-sector (see below) will be honored.
This can be used to stop a running verify, or to update/shorten/extend
the coverage of the currently running verify.
This command will fail if the device is not part of a
connected device pair.See also the notes on data integrity on the drbd.conf manpage.Since version 8.3.2, on-line verification should resume from the last position
after connection loss. It may also be started from an arbitrary position by setting
this option. If you had reached some stop-sector before, and you do
not specify an explicit start-sector, verify should resume from the
previous stop-sector.Default unit is sectors. You may also specify a unit explicitly. The
will be rounded down to a multiple of 8 sectors
(4kB).,
Since version 8.3.14, on-line verification can be stopped
before it reaches end-of-device.
Default unit is sectors. You may also specify a unit explicitly.
The may be updated by issuing an additional
drbdsetup verify command on the same node while the verify is running.
This can be used to stop a running verify, or to update/shorten/extend
the coverage of the currently running verify.
invalidatedrbdsetupinvalidate This forces the local device of a pair of connected DRBD devices
into SyncTarget state, which means that all data blocks of the
device are copied over from the peer.
This command will fail if the device is
not either part of a connected device pair, or disconnected Secondary.
invalidate-remotedrbdsetupinvalidate-remote This forces the local device of a pair of connected DRBD devices
into SyncSource state, which means that all data blocks of the
device are copied to the peer.
On a disconnected Primary device, this will set all bits in the out of sync bitmap.
As a side affect this suspends updates to the on disk activity log. Updates
to the on disk activity log resume automatically when necessary.
wait-connectdrbdsetupwait-connectReturns as soon as the device can communicate with its
partner device.This command will fail if the device cannot
communicate with its partner for timeout seconds. If the
peer was working before this node was rebooted, the
wfc_timeout is used. If the peer was already down before
this node was rebooted, the degr_wfc_timeout is used. If
the peer was successfully outdated before this node was rebooted the
outdated_wfc_timeout is used. The default value for all
those timeout values is 0 which means to wait forever. The unit is seconds. In case
the connection status goes down to StandAlone because the peer appeared but the
devices had a split brain situation, the default for the command is to terminate. You
can change this behavior with the option.wait-syncdrbdsetupwait-syncReturns as soon as the device leaves any synchronization
into connected state. The options are the same as with the
wait-connect command.disconnectdrbdsetupdisconnectRemoves the information set by the command from the
device. This means that the device
goes into unconnected state and will no longer listen for incoming connections.detachdrbdsetupdetachRemoves the information set by the command from the
device. This means that the device is
detached from its backing storage device.
,
A regular detach returns after the disk state finally reached
diskless. As a consequence detaching from a frozen backing block device
never terminates.On the other hand A forced detach returns immediately. It allows
you to detach DRBD from a frozen backing block device. Please note that
the disk will be marked as failed until all pending IO requests where
finished by the backing block device.
downdrbdsetupdownRemoves all configuration information from the device and
forces it back to unconfigured state.roledrbdsetuproleShows the current roles of the device and its peer, as
local/peer.statedrbdsetupstateDeprecated alias for "role"cstatedrbdsetupcstateShows the current connection state of the device.dstatedrbdsetupdstateShows the current states of the backing storage devices, as
local/peer.resizedrbdsetupresizeThis causes DRBD to reexamine the size of the device's
backing storage device. To actually do online growing you need to extend the backing
storages on both devices and call the command on one of your
nodes.The option can be used to online shrink the usable
size of a drbd device. It's the users responsibility to make sure that a file system
on the device is not truncated by that operation.The allows you to resize a device which is
currently not connected to the peer. Use with care, since if you do not resize the peer's
disk as well, further connect attempts of the two will fail.When the option is given DRBD will skip the resync of
the new storage. Only do this if you know that the new storage was initialized to the same
content by other means.The options and may
be used to change the layout of the activity log online. In case of internal meta data
this may invovle shrinking the user visible size at the same time (unsing the
) or increasing the avalable space on the backing devices.check-resizedrbdsetupcheck-resizeTo enable DRBD to detect offline resizing of backing devices this command may be used
to record the current size of backing devices. The size is stored in files in /var/lib/drbd/
named drbd-minor-??.lkbdThis command is called by drbdadm resize
res after drbdsetup
device resize returned.pause-syncdrbdsetuppause-syncTemporarily suspend an ongoing resynchronization by setting the local pause flag.
Resync only progresses if neither the local nor the remote pause flag is set. It might be
desirable to postpone DRBD's resynchronization after eventual resynchronization of the
backing storage's RAID setup.resume-syncdrbdsetupresume-syncUnset the local sync pause flag.outdatedrbdsetupoutdateMark the data on the local backing storage as outdated. An outdated device refuses to
become primary. This is used in conjunction with and by the peer's
handler.show-gidrbdsetupshow-giDisplays the device's data generation identifiers verbosely.get-gidrbdsetupget-giDisplays the device's data generation identifiers.showdrbdsetupshowShows all available configuration information of a resource, or of all resources. Available options:
Show all configuration parameters, even the ones with
default values. Normally, parameters with default values are
not shown.suspend-iodrbdsetupsuspend-ioThis command is of no apparent use and just provided for the sake of
completeness.resume-iodrbdsetupresume-ioIf the fence-peer handler fails to stonith the peer node, and your
policy is set to resource-and-stonith, you can unfreeze IO
operations with this command.statusdrbdsetupstatusShow the status of a resource, or of all resources. The
output consists of one paragraph for each configured resource. Each
paragraph contains one line for each resource, followed by one line
for each device, and one line for each connection. The device and
connection lines are indented. The connection lines are followed by
one line for each peer device; these lines are indented against the
connection line.Long lines are wrapped around at terminal width, and indented
to indicate how the lines belongs together. Available options:
Include more information in the output even when it is
likely redundant or irrelevant.Include data transfer statistics in the output.Colorize the output. With
,
emits color codes only when standard output is connected to
a terminal.
For example, the non-verbose output for a resource with only
one connection and only one volume could look like this:
fs-backoffice role:Primary
disk:UpToDate
peer role:Secondary
replication:Established peer-disk:UpToDate
With the options, the same resource
could be reported as:
fs-data role:Primary suspended:no
write-ordering:drain
volume:0 minor:1 disk:UpToDate
size:10616472 read:134465 written:144800 al-writes:18 bm-writes:0
upper-pending:0 lower-pending:0 al-suspended:no blocked:no
peer connection:Connected role:Secondary congested:no
volume:0 replication:Established peer-disk:UpToDate resync-suspended:no
received:122596 sent:22204 out-of-sync:0 pending:0 unacked:0
events2drbdsetupevents2Show the current state of all configured DRBD objects, followed
by all changes to the state.The output format is meant to be human as well as machine
readable. Each line starts with the event number, which is
followed by an asterisk if the event continues in the next line.
The second word in each line indicates the kind of event:
for an existing object;
, , and
if an object is created, destroyed, or
changed; or or if
an event handler is called or it returns. The third word indicates
the object the event applies to: ,
, ,
, , or a dash
() to indicate that the current state has been
dumped completely.The remaining words identify the object and describe the state
that he object is in. Available options:
Terminate after reporting the current state. The
default is to continuously listen and report state
changes.Include statistics in the output.eventsdrbdsetupeventsDeprecated. If possible, change to the events2 subcommand instead.Displays every state change of DRBD and all calls to helper programs. This might be
used to get notified of DRBD's state changes by piping the output to another program.
Display the events of all DRBD minors.This is a debugging aid that displays the content of all received netlink
messages.new-current-uuiddrbdsetupnew-current-uuidGenerates a new current UUID and rotates all other UUID values. This has at least two
use cases, namely to skip the initial sync, and to reduce network bandwidth when starting in
a single node configuration and then later (re-)integrating a remote site.Available option: Clears the sync bitmap in addition to generating a new current UUID.This can be used to skip the initial sync, if you want to start from scratch. This
use-case does only work on "Just Created" meta data. Necessary steps: On both nodes, initialize meta data and configure the
device.drbdadm -- --force create-md
resThey need to do the initial handshake, so they know their sizes.drbdadm up
resThey are now Connected Secondary/Secondary Inconsistent/Inconsistent.
Generate a new current-uuid and clear the dirty bitmap.drbdadm new-current-uuid --clear-bitmap
resThey are now Connected Secondary/Secondary UpToDate/UpToDate. Make one side
primary and create a file system.drbdadm primary
resmkfs -t fs-type $(drbdadm
sh-dev res)One obvious side-effect is that the replica is full of old garbage (unless you made
them identical using other means), so any online-verify is expected to find any number of
out-of-sync blocks.You must not use this on pre-existing data! Even though it may
appear to work at first glance, once you switch to the other node, your data is toast, as it
never got replicated. So do not leave out the mkfs (or
equivalent).This can also be used to shorten the initial resync of a cluster where the second node
is added after the first node is gone into production, by means of disk shipping. This
use-case works on disconnected devices only, the device may be in primary or secondary
role.The necessary steps on the current active server are: drbdsetup new-current-uuid --clear-bitmap minorTake the copy of the current active server. E.g. by pulling a disk out of the
RAID1 controller, or by copying with dd. You need to copy the actual data, and the
meta data.drbdsetup new-current-uuid minor Now add the disk to the new secondary node, and join it to the cluster. You
will get a resync of that parts that were changed since the first call to drbdsetup in step 1.ExamplesFor examples, please have a look at the
DRBD User's Guide.VersionThis document was revised for version 8.3.2 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com and Lars
Ellenberg lars.ellenberg@linbit.comReporting BugsReport bugs to drbd-user@lists.linbit.com.CopyrightCopyright 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.See Alsodrbd.conf5, drbd8, drbddisk8, drbdadm8,
DRBD User's Guide,
DRBD web site
drbd-utils-8.9.6/documentation/v84/drbd.8 0000644 0001750 0001750 00000004540 12654452471 020016 0 ustar apoikos apoikos '\" t
.\" Title: drbd
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 15 Oct 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBD" "8" "15 Oct 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbd \- The start and stop script for DRBD
.SH "SYNOPSIS"
.HP \w'\fB/etc/init\&.d/drbd\fR\ 'u
\fB/etc/init\&.d/drbd\fR [\fIresource\fR] {{start}\ |\ {stop}\ |\ {status}\ |\ {reload}\ |\ {restart}\ |\ {force\-reload}}
.SH "INTRODUCTION"
.PP
The
\fB/etc/init\&.d/drbd\fR
script is used to start and stop drbd on a system V style init system\&.
.PP
In order to use
\fB/etc/init\&.d/drbd\fR
you must define a resource, a host, and any other configuration options in the drbd configuration file\&. See
\fB/etc/drbd\&.conf\fR
for details\&. If
\fIresource\fR
is omitted, then all of the resources listed in the config file are configured\&.
.PP
This script might ask you
\(lqDo you want to abort waiting for other server and make this one primary?\(rq
.PP
Only answer this question with
\(lqyes\(rq
if you are sure that it is impossible to repair the other node\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8)\fBdrbdadm\fR(8)\m[blue]\fBDRBD Homepage\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD Homepage
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v84/drbd.conf.xml 0000644 0001750 0001750 00000272743 12654402323 021376 0 ustar apoikos apoikos
6 May 2011DRBD8.4.0drbd.conf5Configuration Filesdrbd.confConfiguration file for DRBD's devices drbd.confIntroductionThe file is read by .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 should be the same on both nodes of the
cluster. Changes to do not apply immediately.By convention the main config contains two include statements. The first one includes
the file , the second one all file with a
suffix.A small example.res fileresource r0 {
net {
protocol C;
cram-hmac-alg sha1;
shared-secret "FooFunFactory";
}
disk {
resync-rate 10M;
}
on alice {
volume 0 {
device minor 1;
disk /dev/sda7;
meta-disk internal;
}
address 10.1.1.31:7789;
}
on bob {
volume 0 {
device minor 1;
disk /dev/sda7;
meta-disk internal;
}
address 10.1.1.32:7789;
}
}In this example, there is a single DRBD resource (called r0) which uses protocol C
for the connection between its devices. It contains a single volume which runs on host
alice uses /dev/drbd1 as devices for its
application, and /dev/sda7 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. This sync-rate statement is
valid for volume 0, but would also be valid for further volumes. In this example it assigns
full 10MByte/second to each volume.There may be multiple resource sections in a single drbd.conf file. For more examples,
please have a look at the
DRBD User's Guide.File FormatThe file consists of sections and parameters. A section begins with a keyword, sometimes
an additional name, and an opening brace ({). A section ends with a closing
brace (}. The braces enclose the parameters.section [name] { parameter value; [...] }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 consist only of the identifier. Parameters are terminated by a
semicolon (;).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).Comments may be placed into the configuration file and must begin with a hash sign
(#). Subsequent characters are ignored until the end of the line.Sectionsdrbd.confskip Comments out chunks of text, even spanning more than one line.
Characters between the keyword and the opening brace
({) are ignored. Everything enclosed by the braces is skipped. This
comes in handy, if you just want to comment out some '' section: just precede it with ''.drbd.confglobal Configures some global parameters. Currently only
, ,
and are allowed
here. You may only have one global section, preferably as the first section.drbd.confcommon All resources inherit the options set in this section. The common
section might have a , a , a
, a and a
section.drbd.confresource Configures a DRBD resource. Each resource section needs to have two (or
more) sections and may have a
, a , a , a
and a section. It might contain
s sections.drbd.confon Carries the necessary configuration parameters for a DRBD device of the
enclosing resource. host-name is mandatory and must match
the Linux host name (uname -n) of one of the nodes. You may list more than one host
name here, in case you want to use the same parameters on several hosts (you'd have to
move the IP around usually). Or you may list more than two such sections.
resource r1 {
protocol C;
device minor 1;
meta-disk internal;
on alice bob {
address 10.2.2.100:7801;
disk /dev/mapper/some-san;
}
on charlie {
address 10.2.2.101:7801;
disk /dev/mapper/other-san;
}
on daisy {
address 10.2.2.103:7801;
disk /dev/mapper/other-san-as-seen-from-daisy;
}
}
See also the section keyword. Required statements in
this section: and . Note for backward
compatibility and convenience it is valid to embed the statements of a single volume
directly into the host section.drbd.confvolume Defines a volume within a connection. The minor numbers of a replicated
volume might be different on different hosts, the volume number
(vnr) is what groups them together. Required parameters in
this section: , ,
.drbd.confstacked-on-top-of For a stacked DRBD setup (3 or 4 nodes), a
is used instead of an section.
Required parameters in this section: and
.drbd.confon Carries the necessary configuration parameters for a DRBD device of the
enclosing resource. This section is very similar to the section.
The difference to the section is that the matching of the host
sections to machines is done by the IP-address instead of the node name. Required
parameters in this section: , ,
, all of which
may be inherited from the resource section, in which case you may
shorten this section down to just the address identifier. resource r2 {
protocol C;
device minor 2;
disk /dev/sda7;
meta-disk internal;
# short form, device, disk and meta-disk inherited
floating 10.1.1.31:7802;
# longer form, only device inherited
floating 10.1.1.32:7802 {
disk /dev/sdb;
meta-disk /dev/sdc8;
}
}
drbd.confdisk This section is used to fine tune DRBD's properties in respect to the
low level storage. Please refer to drbdsetup8 for detailed description of the parameters. Optional parameters:
, , ,
, ,
, ,
, ,
, , ,
, ,
, ,
, ,
,
,
.drbd.confnet This section is used to fine tune DRBD's properties. Please refer to
drbdsetup8 for a detailed description of this section's parameters. Optional
parameters: , ,
, , ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
,
.drbd.confstartup This section is used to fine tune DRBD's properties. Please refer to
drbdsetup8 for a detailed description of this section's parameters. Optional
parameters: , ,
, ,
and .drbd.confoptions This section is used to fine tune the behaviour of the resource object.
Please refer to drbdsetup8 for a detailed description of this section's parameters. Optional
parameters: , and
.drbd.confhandlers In this section you can define handlers (executables) that are started
by the DRBD system in response to certain events. Optional parameters:
, ,
, (formerly oudate-peer),
, ,
, ,
.The interface is done via environment variables: is the name of the resource is the minor number of the DRBD device, in
decimal. is the path to the primary configuration file;
if you split your configuration into multiple files (e.g. in
), this will not be helpful. , ,
are the address family (e.g. ),
the peer's address and hostnames. is deprecated.Please note that not all of these might be set for all handlers, and that some
values might not be useable for a definition.Parametersdrbd.confminor-countcount may be a number from 1 to 1048575.Minor-count is a sizing hint for DRBD. It helps to
right-size various memory pools. It should be set in the in the same order of
magnitude than the actual number of minors you use. Per default the module loads with
11 more resources than you have currently in your config but at least 32.drbd.confdialog-refreshtime may be 0 or a positive number.The user dialog redraws the second count every time
seconds (or does no redraws if time is 0). The default
value is 1.drbd.confdisable-ip-verificationUse disable-ip-verification if, for some obscure
reasons, drbdadm can/might not use or to
do a sanity check for the IP address. You can disable the IP verification with this
option.drbd.confusage-countPlease participate in
DRBD's online usage counter.
The most convenient way to do so is to set
this option to . Valid options are: ,
and .drbd.confprotocolOn the TCP/IP link the specified protocol is used.
Valid protocol specifiers are A, B, and C.Protocol A: write IO is reported as completed, if it has reached local disk and
local TCP send buffer.Protocol B: write IO is reported as completed, if it has reached local disk and
remote buffer cache.Protocol C: write IO is reported as completed, if it has reached both local and
remote disk.drbd.confdevice 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 parameter.One can ether omit the name or
and the minor number. If you omit the
name a default of /dev/drbdminor
will be used.Udev will create additional symlinks in /dev/drbd/by-res and
/dev/drbd/by-disk.drbd.confdisk 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 also holds true
for dumpe2fs8 and similar commands.drbd.confaddress A resource needs one IP address per device,
which is used to wait for incoming connections from the partner device respectively to
reach the partner device. AF must be one of
, , or
(for compatibility reasons is an alias for
). It may be omited for IPv4 addresses. The actual IPv6 address
that follows the keyword must be placed inside brackets:
ipv6 [fd01:2345:6789:abcd::1]:7800.Each DRBD resource needs a TCP port which is used to
connect to the node's partner device. Two different DRBD resources may not use the
same addr:port combination on the same node.drbd.confmeta-disk Internal means that the last part of the backing device is used to
store the meta-data. The size of the meta-data is computed based on the size of the
device.When a device is specified, either with or without an
index, DRBD stores the meta-data on this device. Without
index, the size of the meta-data is determined by the size
of the data device. This is usually used with LVM, which allows to have many variable
sized block devices. The meta-data size is 36kB + Backing-Storage-size / 32k, rounded up
to the next 4kb boundary. (Rule of the thumb: 32kByte per 1GByte of storage, rounded up
to the next MB.)When an index is specified, each index number refers to
a fixed slot of meta-data of 128 MB, which allows a maximum data size of 4 TiB. This way,
multiple DBRD devices can share the same meta-data device. For example, if /dev/sde6[0]
and /dev/sde6[1] are used, /dev/sde6 must be at least 256 MB big. Because of the hard size
limit, use of meta-disk indexes is discouraged.drbd.confon-io-errorhandler is taken, if the lower level device
reports io-errors to the upper layers.handler may be ,
or : The node downgrades the disk status to inconsistent, marks the
erroneous block as inconsistent in the bitmap and retries the IO on the remote node.: Call the handler script
.: The node drops its low level device, and continues in
diskless mode.drbd.conffencing By we understand preventive measures to avoid
situations where both nodes are primary and disconnected (AKA split brain).Valid fencing policies are:This is the default policy. No fencing actions are taken.If a node becomes a disconnected primary, it tries to fence the peer's
disk. This is done by calling the handler. The
handler is supposed to reach the other node over alternative communication paths
and call '' there.If a node becomes a disconnected primary, it freezes all its IO operations
and calls its fence-peer handler. The fence-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 command.drbd.confdisk-barrierdrbd.confdisk-flushesdrbd.confdisk-drainDRBD has four implementations to express write-after-write dependencies to its
backing storage device. DRBD will use the first method that is supported by the
backing storage device and that is not disabled. By default the flush
method is used.Since drbd-8.4.2 is disabled by default
because since linux-2.6.36 (or 2.6.32 RHEL6) there is no reliable way to determine if queuing
of IO-barriers works. Dangerous only enable if you are
told so by one that knows for sure.When selecting the method you should not only base your decision on the
measurable performance. In case your backing storage device has a volatile write cache
(plain disks, RAID of plain disks) you should use one of the first two. In case your
backing storage device has battery-backed write cache you may go with option 3.
Option 4 (disable everything, use "none") is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .Unfortunately device mapper (LVM) might not support barriers.The letter after "wo:" in /proc/drbd indicates with method is currently in use
for a device: , , ,
. The implementations are:barrierThe first requires that the driver of the backing storage device support
barriers (called 'tagged command queuing' in SCSI and 'native command queuing'
in SATA speak). The use of this method can be enabled by setting the
options to .flushThe second requires that the backing device support disk flushes (called
'force unit access' in the drive vendors speak). The use of this method can be
disabled setting to .drainThe third method is simply to let write requests drain before write
requests of a new reordering domain are issued. This was the only implementation
before 8.0.9.noneThe fourth method is to not express write-after-write dependencies to
the backing store at all, by also specifying .
This is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .drbd.confmd-flushesDisables the use of disk flushes and barrier BIOs when accessing the meta data
device. See the notes on .drbd.confmax-bio-bvecsIn some special circumstances the device mapper stack manages to pass BIOs to
DRBD that violate the constraints that are set forth by DRBD's merge_bvec() function
and which have more than one bvec. A known example is: phys-disk -> DRBD -> LVM
-> Xen -> misaligned partition (63) -> DomU FS. Then you might see "bio would
need to, but cannot, be split:" in the Dom0's kernel log.The best workaround is to proper align the partition within the VM (E.g. start
it at sector 1024). This costs 480 KiB of storage. Unfortunately the default of most
Linux partitioning tools is to start the first partition at an odd number (63).
Therefore most distribution's install helpers for virtual linux machines will end up
with misaligned partitions. The second best workaround is to limit DRBD's max bvecs
per BIO (= ) to 1, but that might cost
performance.The default value of is 0, which means that there
is no user imposed limitation.drbd.confdisk-timeoutIf the lower-level device on which a DRBD device stores its data does
not finish an I/O request within the defined
, DRBD treats this as a failure. The
lower-level device is detached, and the device's disk state advances to
Diskless. If DRBD is connected to one or more peers, the failed request
is passed on to one of them.This option is dangerous and may lead to kernel panic!"Aborting" requests, or force-detaching the disk, is intended for
completely blocked/hung local backing devices which do no longer
complete requests at all, not even do error completions. In this
situation, usually a hard-reset and failover is the only way out.By "aborting", basically faking a local error-completion,
we allow for a more graceful swichover by cleanly migrating services.
Still the affected node has to be rebooted "soon".By completing these requests, we allow the upper layers to re-use
the associated data pages.If later the local backing device "recovers", and now DMAs some data
from disk into the original request pages, in the best case it will
just put random data into unused pages; but typically it will corrupt
meanwhile completely unrelated data, causing all sorts of damage.Which means delayed successful completion,
especially for READ requests, is a reason to panic().
We assume that a delayed *error* completion is OK,
though we still will complain noisily about it.The default value of
is 0, which stands for an infinite timeout.
Timeouts are specified in units of 0.1 seconds. This option is available
since DRBD 8.3.12.drbd.confdiscard-zeroes-if-aligned
There are several aspects to discard/trim/unmap support on linux
block devices. Even if discard is supported in general, it may fail
silently, or may partially ignore discard requests. Devices also
announce whether reading from unmapped blocks returns defined data
(usually zeroes), or undefined data (possibly old data, possibly
garbage).
If on different nodes, DRBD is backed by devices with differing discard
characteristics, discards may lead to data divergence (old data or
garbage left over on one backend, zeroes due to unmapped areas on the
other backend). Online verify would now potentially report tons of
spurious differences. While probably harmless for most use cases
(fstrim on a file system), DRBD cannot have that.
To play safe, we have to disable discard support, if our local backend
(on a Primary) does not support "discard_zeroes_data=true". We also have to
translate discards to explicit zero-out on the receiving side, unless
the receiving side (Secondary) supports "discard_zeroes_data=true",
thereby allocating areas what were supposed to be unmapped.
There are some devices (notably the LVM/DM thin provisioning) that are
capable of discard, but announce discard_zeroes_data=false. In the case of
DM-thin, discards aligned to the chunk size will be unmapped, and
reading from unmapped sectors will return zeroes. However, unaligned
partial head or tail areas of discard requests will be silently ignored.
If we now add a helper to explicitly zero-out these unaligned partial
areas, while passing on the discard of the aligned full chunks, we
effectively achieve discard_zeroes_data=true on such devices.
Setting to
will allow DRBD to use discards, and to announce discard_zeroes_data=true,
even on backends that announce discard_zeroes_data=false.
Setting to
will cause DRBD to always fall-back to zero-out on the receiving side,
and to not even announce discard capabilities on the Primary,
if the respective backend announces discard_zeroes_data=false.
We used to ignore the discard_zeroes_data setting completely. To not
break established and expected behaviour, and suddenly cause fstrim on
thin-provisioned LVs to run out-of-space instead of freeing up space,
the default value is .
This option is available since 8.4.7.
drbd.confread-balancing
The supported methods for load balancing of
read requests are , ,
, ,
, ,
, ,
,
and . The default value of is .
This option is available since 8.4.1.
drbd.confrs-discard-granularity
When is set to a non zero, positive
value then DRBD tries to do a resync operation in requests of this size.
In case such a block contains only zero bytes on the sync source node,
the sync target node will issue a discard/trim/unmap command for
the area.The value is constrained by the discard granularity of the backing
block device. In case is not a
multiplier of the discard granularity of the backing block device DRBD
rounds it up. The feature only gets active if the backing block device
reads back zeroes after a discard command. The default value of is 0. This option is available since 8.4.7.
drbd.confsndbuf-sizesize is the size of the TCP socket send
buffer. The default value is 0, i.e. autotune. You can specify smaller or larger
values. Larger values are appropriate for reasonable write throughput with protocol A
over high latency networks. Values below 32K do not make sense. Since 8.0.13 resp.
8.2.7, setting the size value to 0 means that the kernel
should autotune this.drbd.confrcvbuf-sizesize is the size of the TCP socket receive
buffer. The default value is 0, i.e. autotune. You can specify smaller or larger
values. Usually this should be left at its default. Setting the
size value to 0 means that the kernel should autotune
this.drbd.conftimeout If the partner node fails to send an expected response packet within
time tenths of a second, the partner node is considered
dead and therefore the TCP/IP connection is abandoned. This must be lower than
connect-int and ping-int. The
default value is 60 = 6 seconds, the unit 0.1 seconds.drbd.confconnect-int 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 retries. The default value is 10 seconds, the unit is 1 second.drbd.confping-int If the TCP/IP connection linking a DRBD device pair is idle for more
than time 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.drbd.confping-timeout 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 are tenths of a second.drbd.confmax-buffers
Limits the memory usage per DRBD minor device on the receiving side,
or for internal buffers during resync or online-verify.
Unit is PAGE_SIZE, which is 4 KiB on most systems.
The minimum possible setting is hard coded to 32 (=128 KiB).
These buffers are used to hold data blocks while they are written to/read from disk.
To avoid possible distributed deadlocks on congestion, this setting is used
as a throttle threshold rather than a hard limit. Once more than max-buffers
pages are in use, further allocation from this pool is throttled.
You want to increase max-buffers if you cannot saturate the IO backend on the
receiving side.
drbd.confko-count In case the secondary node fails to complete a single write request for
count times the timeout, it is
expelled from the cluster. (I.e. the primary node will kill and restart the connection.)
To disable this feature, you should explicitly set it to 0; defaults may change between versions.
drbd.confmax-epoch-size The highest number of data blocks between two write barriers. If you
set this smaller than 10, you might decrease your performance.drbd.confallow-two-primaries With this option set you may assign the 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!drbd.confunplug-watermark
This setting has no effect with recent kernels that use explicit on-stack
plugging (upstream Linux kernel 2.6.39, distributions may have backported).
When the number of pending write requests on the standby (secondary) node
exceeds the , 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, yet others don't feel much effect at all.
Minimum 16, default 128, maximum 131072.drbd.confcram-hmac-alg 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 .drbd.confshared-secret The shared secret used in peer authentication. May be up to 64
characters. Note that peer authentication is disabled as long as no
(see above) is specified.policydrbd.confafter-sb-0pripossible policies are:No automatic resynchronization, simply disconnect.Auto sync from the node that was primary before the split-brain situation
happened.Auto sync from the node that became primary as second during the
split-brain situation.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.Auto sync from the node that touched more blocks during the split brain
situation.Auto sync to the named node.policydrbd.confafter-sb-1pripossible policies are:No automatic resynchronization, simply disconnect.Discard the version of the secondary if the outcome of the
algorithm would also destroy the current
secondary's data. Otherwise disconnect.Always take the decision of the algorithm,
even if that causes an erratic change of the primary's view of the data. This is
only useful if you use a one-node FS (i.e. not OCFS2 or GFS) with the
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.Discard the secondary's version.Always honor the outcome of the algorithm.
In case it decides the current secondary has the right data, it calls the
"pri-lost-after-sb" handler on the current primary.policydrbd.confafter-sb-2pripossible policies are:No automatic resynchronization, simply disconnect.Always take the decision of the algorithm,
even if that causes an erratic change of the primary's view of the data. This is
only useful if you use a one-node FS (i.e. not OCFS2 or GFS) with the
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.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.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.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.)policydrbd.confrr-conflictThis option helps to solve the cases when the outcome of the resync decision is
incompatible with the current role assignment in the cluster.No automatic resynchronization, simply disconnect.Sync to the primary node is allowed, violating the assumption that data on
a block device are stable for one of the nodes. Dangerous, do not
use.Call the helper
program on one of the machines unless that machine can
demote to secondary. The helper program is expected to
reboot the machine, which brings the node into a secondary
role. Which machine runs the helper program is determined
by the strategy.algdrbd.confdata-integrity-algDRBD can ensure the data integrity of the user's data on the network by
comparing hash values. Normally this is ensured by the 16 bit checksums in the headers
of TCP/IP packets.This option can be set to any of the kernel's data digest algorithms. In a
typical kernel configuration you should have at least one of ,
, and available. By default this is not
enabled.See also the notes on data integrity.drbd.conftcp-corkDRBD usually uses the TCP socket option TCP_CORK to hint to the network stack
when it can expect more data, and when it should flush out what it has in its send
queue. It turned out that there is at least one network stack that performs worse when
one uses this hinting method. Therefore we introducted this option. By setting
to you can disable the setting and
clearing of the TCP_CORK socket option by DRBD.By default DRBD blocks when the available TCP send queue becomes full. That
means it will slow down the application that generates the write requests that cause
DRBD to send more data down that TCP connection.When DRBD is deployed with DRBD-proxy it might be more desirable that DRBD goes
into AHEAD/BEHIND mode shortly before the send queue becomes full. In AHEAD/BEHIND
mode DRBD does no longer replicate data, but still keeps the connection open.The advantage of the AHEAD/BEHIND mode is that the application is not slowed
down, even if DRBD-proxy's buffer is not sufficient to buffer all write requests. The
downside is that the peer node falls behind, and that a resync will be necessary to
bring it back into sync. During that resync the peer node will have an inconsistent
disk.Available congestion_policys are
and . The default is
. Fill_threshold might be in the
range of 0 to 10GiBytes. The default is 0 which disables the check.
Active_extents_threshold has the same limits as
.The AHEAD/BEHIND mode and its settings are available since DRBD 8.3.10.Wait for connection timeout. drbd.confwfc-timeout The init script drbd8 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.drbd.confdegr-wfc-timeout 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. Value 0 means unlimited.drbd.confoutdated-wfc-timeout Wait for connection timeout, if the peer was outdated. In case a
degraded cluster (= cluster with only one node left) with an outdated peer disk is
rebooted, this timeout value is used instead of wfc-timeout, because the peer is not
allowed to become primary in the meantime. Value 0 means unlimited.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.Sets on which node the device should be promoted to primary role by the init
script. The node-name might either be a host name or the
keyword . 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).Usually and are
ignored for stacked devices, instead twice the amount of
is used for the connection timeouts. With the
keyword you disable this, and force DRBD to mind the and
statements. Only do that if the peer of the stacked
resource is usually not available or will usually not become primary. By using this
option incorrectly, you run the risk of causing unexpected split brain.drbd.confresync-rate 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.drbd.confuse-rle During resync-handshake, the dirty-bitmaps of the nodes are exchanged
and merged (using bit-or), so the nodes will have the same understanding of which
blocks are dirty. On large devices, the fine grained dirty-bitmap can become large as
well, and the bitmap exchange can take quite some time on low-bandwidth links.Because the bitmap typically contains compact areas where all bits are unset
(clean) or set (dirty), a simple run-length encoding scheme can considerably reduce
the network traffic necessary for the bitmap exchange.For backward compatibilty reasons, and because on fast links this possibly does
not improve transfer time but consumes cpu cycles, this defaults to off.drbd.confsocket-check-timeout In setups involving a DRBD-proxy and connections that experience a lot of
buffer-bloat it might be necessary to set to an
unusual high value. By default DRBD uses the same value to wait if a newly
established TCP-connection is stable. Since the DRBD-proxy is usually located
in the same data center such a long wait time may hinder DRBD's connect process.
In such setups should be set to
at least to the round trip time between DRBD and DRBD-proxy. I.e. in most
cases to 1.
The default unit is tenths of a second, the default value is 0 (which causes
DRBD to use the value of instead).
Introduced in 8.4.5.drbd.confresync-after By default, resynchronization of all devices would run in parallel. By
defining a resync-after dependency, the resynchronization of this resource will start
only if the resource res-name is already in connected state
(i.e., has finished its resynchronization).drbd.confal-extents DRBD automatically performs hot area detection. With this 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 extents is 1237. (Minimum: 7, Maximum:
65534)
Note that the effective maximum may be smaller, depending on how
you created the device meta data, see also
drbdmeta8.
The effective maximum is 919 * (available on-disk activity-log ring-buffer area/4kB -1),
the default 32kB ring-buffer effects a maximum of 6433 (covers more than 25 GiB of data).
We recommend to keep this well within the amount your backend storage
and replication link are able to resync inside of about 5 minutes.
drbd.confal-updates DRBD's activity log transaction writing makes it possible, that
after the crash of a primary node a partial (bit-map based) resync is
sufficient to bring the node back to up-to-date.
Setting to might increase
normal operation performance but causes DRBD to do a full resync
when a crashed primary gets reconnected. The default value is .
During online verification (as initiated by the verify sub-command), rather than doing a bit-wise
comparison, DRBD applies a hash function to the contents of every block being
verified, and compares that hash with the peer. This option defines the hash algorithm
being used for that purpose. It can be set to any of the kernel's data digest
algorithms. In a typical kernel configuration you should have at least one of
, , and available. By
default this is not enabled; you must set this option explicitly in order to be able
to use on-line device verification.See also the notes on data integrity.A resync process sends all marked data blocks from the source to the destination
node, as long as no is given. When one is specified the
resync process exchanges hash values of all marked blocks first, and sends only those
data blocks that have different hash values.This setting is useful for DRBD setups with low bandwidth links. During the
restart of a crashed primary node, all blocks covered by the activity log are marked
for resync. But a large part of those will actually be still in sync, therefore using
will lower the required bandwidth in exchange for CPU
cycles.The dynamic resync speed controller gets enabled with setting
plan_time to a positive value. It aims to fill the buffers
along the data path with either a constant amount of data
fill_target, or aims to have a constant delay time of
delay_target along the path. The controller has an upper
bound of max_rate.By plan_time the agility of the controller is
configured. Higher values yield for slower/lower responses of the controller to
deviation from the target value. It should be at least 5 times RTT. For regular data
paths a fill_target in the area of 4k to 100k is
appropriate. For a setup that contains drbd-proxy it is advisable to use
delay_target instead. Only when
fill_target is set to 0 the controller will use
delay_target. 5 times RTT is a reasonable starting value.
Max_rate should be set to the bandwidth available between
the DRBD-hosts and the machines hosting DRBD-proxy, or to the available
disk-bandwidth.The default value of plan_time is 0, the default unit
is 0.1 seconds. Fill_target has 0 and sectors as default
unit. Delay_target has 1 (100ms) and 0.1 as default unit.
Max_rate has 10240 (100MiB/s) and KiB/s as default
unit.The dynamic resync speed controller and its settings are available since DRBD
8.3.9.A node that is primary and sync-source has to schedule application IO requests
and resync IO requests. The min_rate tells DRBD use only up
to min_rate for resync IO and to dedicate all other available IO bandwidth to
application requests.Note: The value 0 has a special meaning. It disables the limitation of resync IO
completely, which might slow down application IO considerably. Set it to a value of 1,
if you prefer that resync IO never slows down application IO.Note: Although the name might suggest that it is a lower bound for the dynamic
resync speed controller, it is not. If the DRBD-proxy buffer is full, the dynamic
resync speed controller is free to lower the resync speed down to 0, completely
independent of the setting.Min_rate has 4096 (4MiB/s) and KiB/s as default
unit.This setting controls what happens to IO requests on a degraded, disk less node
(I.e. no data store is reachable). The available policies are
and .If ond-policy is set to
you can either resume IO by attaching/connecting the last lost data storage, or by the
drbdadm resume-io res
command. The latter will result in IO errors of course.The default is . This setting is available since DRBD
8.3.9.drbd.confcpu-mask Sets the cpu-affinity-mask for DRBD's kernel threads of this device.
The default value of cpu-mask is 0, which means that DRBD's
kernel threads should be spread over all CPUs of the machine. This value must be given
in hexadecimal notation. If it is too big it will be truncated.drbd.confpri-on-incon-degr This handler is called if the node is primary, degraded and if the
local copy of the data is inconsistent.drbd.confpri-lost-after-sb The node is currently primary, but lost the after-split-brain auto
recovery procedure. As as consequence, it should be abandoned.drbd.confpri-lost The node is currently primary, but DRBD's algorithm thinks that it
should become sync target. As a consequence it should give up its primary role.drbd.conffence-peer The handler is part of the mechanism. This
handler is called in case the node needs to fence the peer's disk. It should use other
communication paths than DRBD's network link.drbd.conflocal-io-error DRBD got an IO error from the local IO subsystem.drbd.confinitial-split-brain DRBD has connected and detected a split brain situation. This handler
can alert someone in all cases of split brain, not just those that go
unresolved.drbd.confsplit-brain DRBD detected a split brain situation but remains unresolved. Manual
recovery is necessary. This handler should alert someone on duty.drbd.confbefore-resync-target DRBD calls this handler just before a resync begins on the node that
becomes resync target. It might be used to take a snapshot of the backing block
device.drbd.confafter-resync-target DRBD calls this handler just after a resync operation finished on the
node whose disk just became consistent after being inconsistent for the duration of
the resync. It might be used to remove a snapshot of the backing device that was
created by the handler.Other Keywordsdrbd.confinclude Include all files matching the wildcard pattern
file-pattern. The statement is
only allowed on the top level, i.e. it is not allowed inside any section.Notes on data integrityThere are two independent methods in DRBD to ensure the integrity of the mirrored data.
The online-verify mechanism and the of the
section.Both mechanisms might deliver false positives if the user of DRBD modifies the data
which gets written to disk while the transfer goes on. This may happen for swap, or for
certain append while global sync, or truncate/rewrite workloads, and not necessarily poses a
problem for the integrity of the data. Usually when the initiator of the data transfer does
this, it already knows that that data block will not be part of an on disk data structure, or
will be resubmitted with correct data soon enough.The causes the receiving side to log an error about
"Digest integrity check FAILED: Ns +x\n", where N is the sector offset, and x is the size of
the request in bytes. It will then disconnect, and reconnect, thus causing a quick resync. If
the sending side at the same time detected a modification, it warns about "Digest mismatch,
buffer modified by upper layers during write: Ns +x\n", which shows that this was a false
positive. The sending side may detect these buffer modifications immediately after the
unmodified data has been copied to the tcp buffers, in which case the receiving side won't
notice it.The most recent (2007) example of systematic corruption was an issue with the TCP
offloading engine and the driver of a certain type of GBit NIC. The actual corruption happened
on the DMA transfer from core memory to the card. Since the TCP checksum gets calculated on
the card, this type of corruption stays undetected as long as you do not use either the online
or the .We suggest to use the only during a pre-production
phase due to its CPU costs. Further we suggest to do online runs
regularly e.g. once a month during a low load period.VersionThis document was revised for version 8.4.0 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com and Lars
Ellenberg lars.ellenberg@linbit.com.Reporting BugsReport bugs to drbd-user@lists.linbit.com.CopyrightCopyright 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.See Alsodrbd8,
drbddisk8,
drbdsetup8,
drbdmeta8,
drbdadm8,
DRBD User's Guide,
DRBD web site
drbd-utils-8.9.6/documentation/v84/drbddisk.xml 0000644 0001750 0001750 00000006150 12466702073 021316 0 ustar apoikos apoikos
drbddiskScript to mark devices as primary and mount file systems15 Oct 2008DRBD8.3.2drbddisk8System Administration/etc/ha.d/resource.d/drbddiskresourcestartstopstatusIntroduction The script
brings the local device of resource into
primary role. It is designed to be used by Heartbeat.
In order to use you must
define
a resource, a host, and any other configuration options in the DRBD
configuration file. See for details.
If resource is omitted, then all of the
resources listed in the config file are affected.
VersionThis document was revised for version 8.0.14 of the DRBD distribution.Author Written by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting Bugs Report bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbd.conf5,
drbd8,
drbdsetup8drbdadm8DRBD Homepage
drbd-utils-8.9.6/documentation/v84/drbdsetup.8 0000644 0001750 0001750 00000162217 12654452470 021104 0 ustar apoikos apoikos '\" t
.\" Title: drbdsetup
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 6 May 2011
.\" Manual: System Administration
.\" Source: DRBD 8.4.0
.\" Language: English
.\"
.TH "DRBDSETUP" "8" "6 May 2011" "DRBD 8.4.0" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdsetup \- Setup tool for DRBD .\" drbdsetup
.SH "SYNOPSIS"
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR new\-resource \fIresource\fR [\-\-cpu\-mask\ {\fIval\fR}] [\-\-on\-no\-data\-accessible\ {io\-error\ |\ suspend\-io}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR new\-minor \fIresource\fR \fIminor\fR \fIvolume\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR del\-resource \fIresource\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR del\-minor \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR attach \fIminor\fR \fIlower_dev\fR \fImeta_data_dev\fR \fImeta_data_index\fR [\-\-size\ {\fIval\fR}] [\-\-max\-bio\-bvecs\ {\fIval\fR}] [\-\-on\-io\-error\ {pass_on\ |\ call\-local\-io\-error\ |\ detach}] [\-\-fencing\ {dont\-care\ |\ resource\-only\ |\ resource\-and\-stonith}] [\-\-disk\-barrier] [\-\-disk\-flushes] [\-\-disk\-drain] [\-\-md\-flushes] [\-\-resync\-rate\ {\fIval\fR}] [\-\-resync\-after\ {\fIval\fR}] [\-\-al\-extents\ {\fIval\fR}] [\-\-al\-updates] [\-\-discard\-zeroes\-if\-aligned] [\-\-c\-plan\-ahead\ {\fIval\fR}] [\-\-c\-delay\-target\ {\fIval\fR}] [\-\-c\-fill\-target\ {\fIval\fR}] [\-\-c\-max\-rate\ {\fIval\fR}] [\-\-c\-min\-rate\ {\fIval\fR}] [\-\-disk\-timeout\ {\fIval\fR}] [\-\-read\-balancing\ {prefer\-local\ |\ prefer\-remote\ |\ round\-robin\ |\ least\-pending\ |\ when\-congested\-remote\ |\ 32K\-striping\ |\ 64K\-striping\ |\ 128K\-striping\ |\ 256K\-striping\ |\ 512K\-striping\ |\ 1M\-striping}] [\-\-rs\-discard\-granularity\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR connect \fIresource\fR \fIlocal_addr\fR \fIremote_addr\fR [\-\-tentative] [\-\-discard\-my\-data] [\-\-protocol\ {A\ |\ B\ |\ C}] [\-\-timeout\ {\fIval\fR}] [\-\-max\-epoch\-size\ {\fIval\fR}] [\-\-max\-buffers\ {\fIval\fR}] [\-\-unplug\-watermark\ {\fIval\fR}] [\-\-connect\-int\ {\fIval\fR}] [\-\-ping\-int\ {\fIval\fR}] [\-\-sndbuf\-size\ {\fIval\fR}] [\-\-rcvbuf\-size\ {\fIval\fR}] [\-\-ko\-count\ {\fIval\fR}] [\-\-allow\-two\-primaries] [\-\-cram\-hmac\-alg\ {\fIval\fR}] [\-\-shared\-secret\ {\fIval\fR}] [\-\-after\-sb\-0pri\ {disconnect\ |\ discard\-younger\-primary\ |\ discard\-older\-primary\ |\ discard\-zero\-changes\ |\ discard\-least\-changes\ |\ discard\-local\ |\ discard\-remote}] [\-\-after\-sb\-1pri\ {disconnect\ |\ consensus\ |\ discard\-secondary\ |\ call\-pri\-lost\-after\-sb\ |\ violently\-as0p}] [\-\-after\-sb\-2pri\ {disconnect\ |\ call\-pri\-lost\-after\-sb\ |\ violently\-as0p}] [\-\-always\-asbp] [\-\-rr\-conflict\ {disconnect\ |\ call\-pri\-lost\ |\ violently}] [\-\-ping\-timeout\ {\fIval\fR}] [\-\-data\-integrity\-alg\ {\fIval\fR}] [\-\-tcp\-cork] [\-\-on\-congestion\ {block\ |\ pull\-ahead\ |\ disconnect}] [\-\-congestion\-fill\ {\fIval\fR}] [\-\-congestion\-extents\ {\fIval\fR}] [\-\-csums\-alg\ {\fIval\fR}] [\-\-csums\-after\-crash\-only] [\-\-verify\-alg\ {\fIval\fR}] [\-\-use\-rle] [\-\-socket\-check\-timeout\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR disk\-options \fIminor\fR [\-\-on\-io\-error\ {pass_on\ |\ call\-local\-io\-error\ |\ detach}] [\-\-fencing\ {dont\-care\ |\ resource\-only\ |\ resource\-and\-stonith}] [\-\-disk\-barrier] [\-\-disk\-flushes] [\-\-disk\-drain] [\-\-md\-flushes] [\-\-resync\-rate\ {\fIval\fR}] [\-\-resync\-after\ {\fIval\fR}] [\-\-al\-extents\ {\fIval\fR}] [\-\-al\-updates] [\-\-discard\-zeroes\-if\-aligned] [\-\-c\-plan\-ahead\ {\fIval\fR}] [\-\-c\-delay\-target\ {\fIval\fR}] [\-\-c\-fill\-target\ {\fIval\fR}] [\-\-c\-max\-rate\ {\fIval\fR}] [\-\-c\-min\-rate\ {\fIval\fR}] [\-\-disk\-timeout\ {\fIval\fR}] [\-\-read\-balancing\ {prefer\-local\ |\ prefer\-remote\ |\ round\-robin\ |\ least\-pending\ |\ when\-congested\-remote\ |\ 32K\-striping\ |\ 64K\-striping\ |\ 128K\-striping\ |\ 256K\-striping\ |\ 512K\-striping\ |\ 1M\-striping}] [\-\-rs\-discard\-granularity\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR net\-options \fIlocal_addr\fR \fIremote_addr\fR [\-\-protocol\ {A\ |\ B\ |\ C}] [\-\-timeout\ {\fIval\fR}] [\-\-max\-epoch\-size\ {\fIval\fR}] [\-\-max\-buffers\ {\fIval\fR}] [\-\-unplug\-watermark\ {\fIval\fR}] [\-\-connect\-int\ {\fIval\fR}] [\-\-ping\-int\ {\fIval\fR}] [\-\-sndbuf\-size\ {\fIval\fR}] [\-\-rcvbuf\-size\ {\fIval\fR}] [\-\-ko\-count\ {\fIval\fR}] [\-\-allow\-two\-primaries] [\-\-cram\-hmac\-alg\ {\fIval\fR}] [\-\-shared\-secret\ {\fIval\fR}] [\-\-after\-sb\-0pri\ {disconnect\ |\ discard\-younger\-primary\ |\ discard\-older\-primary\ |\ discard\-zero\-changes\ |\ discard\-least\-changes\ |\ discard\-local\ |\ discard\-remote}] [\-\-after\-sb\-1pri\ {disconnect\ |\ consensus\ |\ discard\-secondary\ |\ call\-pri\-lost\-after\-sb\ |\ violently\-as0p}] [\-\-after\-sb\-2pri\ {disconnect\ |\ call\-pri\-lost\-after\-sb\ |\ violently\-as0p}] [\-\-always\-asbp] [\-\-rr\-conflict\ {disconnect\ |\ call\-pri\-lost\ |\ violently}] [\-\-ping\-timeout\ {\fIval\fR}] [\-\-data\-integrity\-alg\ {\fIval\fR}] [\-\-tcp\-cork] [\-\-on\-congestion\ {block\ |\ pull\-ahead\ |\ disconnect}] [\-\-congestion\-fill\ {\fIval\fR}] [\-\-congestion\-extents\ {\fIval\fR}] [\-\-csums\-alg\ {\fIval\fR}] [\-\-csums\-after\-crash\-only] [\-\-verify\-alg\ {\fIval\fR}] [\-\-use\-rle] [\-\-socket\-check\-timeout\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR resource\-options \fIresource\fR [\-\-cpu\-mask\ {\fIval\fR}] [\-\-on\-no\-data\-accessible\ {io\-error\ |\ suspend\-io}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR disconnect \fIlocal_addr\fR \fIremote_addr\fR [\-\-force]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR detach \fIminor\fR [\-\-force]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR primary \fIminor\fR [\-\-force]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR secondary \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR down \fIresource\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR verify \fIminor\fR [\-\-start\ {\fIval\fR}] [\-\-stop\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR invalidate \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR invalidate\-remote \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR wait\-connect \fIminor\fR [\-\-wfc\-timeout\ {\fIval\fR}] [\-\-degr\-wfc\-timeout\ {\fIval\fR}] [\-\-outdated\-wfc\-timeout\ {\fIval\fR}] [\-\-wait\-after\-sb\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR wait\-sync \fIminor\fR [\-\-wfc\-timeout\ {\fIval\fR}] [\-\-degr\-wfc\-timeout\ {\fIval\fR}] [\-\-outdated\-wfc\-timeout\ {\fIval\fR}] [\-\-wait\-after\-sb\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR role \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR cstate \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR dstate \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR resize \fIminor\fR [\-\-size\ {\fIval\fR}] [\-\-assume\-peer\-has\-space] [\-\-assume\-clean] [\-\-al\-stripes\ {\fIval\fR}] [\-\-al\-stripe\-size\-kB\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR check\-resize \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR pause\-sync \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR resume\-sync \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR outdate \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR show\-gi \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR get\-gi \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR show {\fIresource\fR | \fIminor\fR | \fIall\fR}
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR suspend\-io \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR resume\-io \fIminor\fR
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR status {\fIresource\fR | \fIall\fR} [\-\-color\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR events2 {\fIresource\fR | \fIall\fR}
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR events {\fIresource\fR | \fIminor\fR | \fIall\fR}
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR new\-current\-uuid \fIminor\fR [\-\-clear\-bitmap]
.SH "DESCRIPTION"
.PP
drbdsetup is used to associate DRBD devices with their backing block devices, to set up DRBD device pairs to mirror their backing block devices, and to inspect the configuration of running DRBD devices\&.
.SH "NOTE"
.PP
drbdsetup is a low level tool of the DRBD program suite\&. It is used by the data disk and drbd scripts to communicate with the device driver\&.
.SH "COMMANDS"
.PP
Each drbdsetup sub\-command might require arguments and bring its own set of options\&. All values have default units which might be overruled by K, M or G\&. These units are defined in the usual way (e\&.g\&. K = 2^10 = 1024)\&.
.SS "Common options"
.PP
All drbdsetup sub\-commands accept these two options
.PP
\fB\-\-create\-device\fR
.RS 4
In case the specified DRBD device (minor number) does not exist yet, create it implicitly\&.
.RE
.SS "new\-resource"
.PP
Resources are the primary objects of any DRBD configuration\&. A resource must be created with the
\fBnew\-resource\fR
command before any volumes or minor devices can be created\&. Connections are referenced by name\&.
.SS "new\-minor"
.PP
A
\fIminor\fR
is used as a synonym for replicated block device\&. It is represented in the /dev/ directory by a block device\&. It is the application\'s interface to the DRBD\-replicated block devices\&. These block devices get addressed by their minor numbers on the drbdsetup commandline\&.
.PP
A pair of replicated block devices may have different minor numbers on the two machines\&. They are associated by a common
\fIvolume\-number\fR\&. Volume numbers are local to each connection\&. Minor numbers are global on one node\&.
.SS "del\-resource"
.PP
Destroys a resource object\&. This is only possible if the resource has no volumes\&.
.SS "del\-minor"
.PP
Minors can only be destroyed if its disk is detached\&.
.SS "attach, disk\-options"
.\" drbdsetup: disk
.PP
Attach associates
\fIdevice\fR
with
\fIlower_device\fR
to store its data blocks on\&. The
\fB\-d\fR
(or
\fB\-\-disk\-size\fR) should only be used if you wish not to use as much as possible from the backing block devices\&. If you do not use
\fB\-d\fR, the
\fIdevice\fR
is only ready for use as soon as it was connected to its peer once\&. (See the
\fBnet\fR
command\&.)
.PP
With the disk\-options command it is possible to change the options of a minor while it is attached\&.
.PP
\fB\-\-disk\-size \fR\fB\fIsize\fR\fR
.RS 4
You can override DRBD\'s size determination method with this option\&. If you need to use the device before it was ever connected to its peer, use this option to pass the
\fIsize\fR
of the DRBD device to the driver\&. Default unit is sectors (1s = 512 bytes)\&.
.sp
If you use the
\fIsize\fR
parameter in drbd\&.conf, we strongly recommend to add an explicit unit postfix\&. drbdadm and drbdsetup used to have mismatching default units\&.
.RE
.PP
\fB\-\-on\-io\-error \fR\fB\fIerr_handler\fR\fR
.RS 4
If the driver of the
\fIlower_device\fR
reports an error to DRBD, DRBD will mark the disk as inconsistent, call a helper program, or detach the device from its backing storage and perform all further IO by requesting it from the peer\&. The valid
\fIerr_handlers\fR
are:
\fBpass_on\fR,
\fBcall\-local\-io\-error\fR
and
\fBdetach\fR\&.
.RE
.PP
\fB\-\-fencing \fR\fB\fIfencing_policy\fR\fR
.RS 4
Under
\fBfencing\fR
we understand preventive measures to avoid situations where both nodes are primary and disconnected (AKA split brain)\&.
.sp
Valid fencing policies are:
.PP
\fBdont\-care\fR
.RS 4
This is the default policy\&. No fencing actions are done\&.
.RE
.PP
\fBresource\-only\fR
.RS 4
If a node becomes a disconnected primary, it tries to outdate the peer\'s disk\&. This is done by calling the fence\-peer handler\&. The handler is supposed to reach the other node over alternative communication paths and call \'drbdadm outdate res\' there\&.
.RE
.PP
\fBresource\-and\-stonith\fR
.RS 4
If a node becomes a disconnected primary, it freezes all its IO operations and calls its fence\-peer handler\&. The fence\-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
\fBresume\-io\fR
command\&.
.RE
.RE
.PP
\fB\-\-disk\-barrier\fR,
.br
\fB\-\-disk\-flushes\fR,
.br
\fB\-\-disk\-drain\fR
.RS 4
DRBD has four implementations to express write\-after\-write dependencies to its backing storage device\&. DRBD will use the first method that is supported by the backing storage device and that is not disabled\&. By default the
\fIflush\fR
method is used\&.
.sp
Since drbd\-8\&.4\&.2
\fBdisk\-barrier\fR
is disabled by default because since linux\-2\&.6\&.36 (or 2\&.6\&.32 RHEL6) there is no reliable way to determine if queuing of IO\-barriers works\&.
\fIDangerous\fR
only enable if you are told so by one that knows for sure\&.
.sp
When selecting the method you should not only base your decision on the measurable performance\&. In case your backing storage device has a volatile write cache (plain disks, RAID of plain disks) you should use one of the first two\&. In case your backing storage device has battery\-backed write cache you may go with option 3\&. Option 4 (disable everything, use "none")
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fBno\-disk\-drain\fR\&.
.sp
Unfortunately device mapper (LVM) might not support barriers\&.
.sp
The letter after "wo:" in /proc/drbd indicates with method is currently in use for a device: b, f, d, n\&. The implementations:
.PP
barrier
.RS 4
The first requires that the driver of the backing storage device support barriers (called \'tagged command queuing\' in SCSI and \'native command queuing\' in SATA speak)\&. The use of this method can be enabled by setting the
\fBdisk\-barrier\fR
options to
\fByes\fR\&.
.RE
.PP
flush
.RS 4
The second requires that the backing device support disk flushes (called \'force unit access\' in the drive vendors speak)\&. The use of this method can be disabled setting
\fBdisk\-flushes\fR
to
\fBno\fR\&.
.RE
.PP
drain
.RS 4
The third method is simply to let write requests drain before write requests of a new reordering domain are issued\&. That was the only implementation before 8\&.0\&.9\&.
.RE
.PP
none
.RS 4
The fourth method is to not express write\-after\-write dependencies to the backing store at all, by also specifying
\fB\-\-no\-disk\-drain\fR\&. This
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fB\-\-no\-disk\-drain\fR\&.
.RE
.RE
.PP
\fB\-\-md\-flushes\fR
.RS 4
Disables the use of disk flushes and barrier BIOs when accessing the meta data device\&. See the notes on
\fB\-\-disk\-flushes\fR\&.
.RE
.PP
\fB\-\-max\-bio\-bvecs\fR
.RS 4
In some special circumstances the device mapper stack manages to pass BIOs to DRBD that violate the constraints that are set forth by DRBD\'s merge_bvec() function and which have more than one bvec\&. A known example is: phys\-disk \-> DRBD \-> LVM \-> Xen \-> missaligned partition (63) \-> DomU FS\&. Then you might see "bio would need to, but cannot, be split:" in the Dom0\'s kernel log\&.
.sp
The best workaround is to proper align the partition within the VM (E\&.g\&. start it at sector 1024)\&. That costs 480 KiB of storage\&. Unfortunately the default of most Linux partitioning tools is to start the first partition at an odd number (63)\&. Therefore most distributions install helpers for virtual linux machines will end up with missaligned partitions\&. The second best workaround is to limit DRBD\'s max bvecs per BIO (i\&.e\&., the
\fBmax\-bio\-bvecs\fR
option) to 1, but that might cost performance\&.
.sp
The default value of
\fBmax\-bio\-bvecs\fR
is 0, which means that there is no user imposed limitation\&.
.RE
.PP
\fB\-\-resync\-rate \fR\fB\fIrate\fR\fR
.RS 4
To ensure smooth operation of the application on top of DRBD, it is possible to limit the bandwidth that may be used by background synchronization\&. The default is 250 KiB/sec, the default unit is KiB/sec\&.
.RE
.PP
\fB\-\-resync\-after \fR\fB\fIminor\fR\fR
.RS 4
Start resync on this device only if the device with
\fIminor\fR
is already in connected state\&. Otherwise this device waits in SyncPause state\&.
.RE
.PP
\fB\-\-al\-extents \fR\fB\fIextents\fR\fR
.RS 4
DRBD automatically performs hot area detection\&. With this parameter you control how big the hot area (=active set) can get\&. Each extent marks 4M of the backing storage\&. 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
\fIextents\fR
is 1237\&. (Minimum: 7, Maximum: 65534)
.sp
See also
\fBdrbd.conf\fR(5)
and
\fBdrbdmeta\fR(8)
for additional limitations and necessary preparation\&.
.RE
.PP
\fB\-\-al\-updates \fR\fB{yes | no}\fR
.RS 4
DRBD\'s activity log transaction writing makes it possible, that after the crash of a primary node a partial (bit\-map based) resync is sufficient to bring the node back to up\-to\-date\&. Setting
\fBal\-updates\fR
to
\fBno\fR
might increase normal operation performance but causes DRBD to do a full resync when a crashed primary gets reconnected\&. The default value is
\fByes\fR\&.
.RE
.PP
\fB\-\-c\-plan\-ahead \fR\fB\fIplan_time\fR\fR,
.br
\fB\-\-c\-fill\-target \fR\fB\fIfill_target\fR\fR,
.br
\fB\-\-c\-delay\-target \fR\fB\fIdelay_target\fR\fR,
.br
\fB\-\-c\-max\-rate \fR\fB\fImax_rate\fR\fR
.RS 4
The dynamic resync speed controller gets enabled with setting
\fIplan_time\fR
to a positive value\&. It aims to fill the buffers along the data path with either a constant amount of data
\fIfill_target\fR, or aims to have a constant delay time of
\fIdelay_target\fR
along the path\&. The controller has an upper bound of
\fImax_rate\fR\&.
.sp
By
\fIplan_time\fR
the agility of the controller is configured\&. Higher values yield for slower/lower responses of the controller to deviation from the target value\&. It should be at least 5 times RTT\&. For regular data paths a
\fIfill_target\fR
in the area of 4k to 100k is appropriate\&. For a setup that contains drbd\-proxy it is advisable to use
\fIdelay_target\fR
instead\&. Only when
\fIfill_target\fR
is set to 0 the controller will use
\fIdelay_target\fR\&. 5 times RTT is a reasonable starting value\&.
\fIMax_rate\fR
should be set to the bandwidth available between the DRBD\-hosts and the machines hosting DRBD\-proxy, or to the available disk\-bandwidth\&.
.sp
The default value of
\fIplan_time\fR
is 0, the default unit is 0\&.1 seconds\&.
\fIFill_target\fR
has 0 and sectors as default unit\&.
\fIDelay_target\fR
has 1 (100ms) and 0\&.1 as default unit\&.
\fIMax_rate\fR
has 10240 (100MiB/s) and KiB/s as default unit\&.
.RE
.PP
\fB\-\-c\-min\-rate \fR\fB\fImin_rate\fR\fR
.RS 4
We track the disk IO rate caused by the resync, so we can detect non\-resync IO on the lower level device\&. If the lower level device seems to be busy, and the current resync rate is above
\fImin_rate\fR, we throttle the resync\&.
.sp
The default value of
\fImin_rate\fR
is 4M, the default unit is k\&. If you want to not throttle at all, set it to zero, if you want to throttle always, set it to one\&.
.RE
.PP
\fB\-t\fR, \fB\-\-disk\-timeout \fR\fB\fIdisk_timeout\fR\fR
.RS 4
If the lower\-level device on which a DRBD device stores its data does not finish an I/O request within the defined
\fBdisk\-timeout\fR, DRBD treats this as a failure\&. The lower\-level device is detached, and the device\'s disk state advances to Diskless\&. If DRBD is connected to one or more peers, the failed request is passed on to one of them\&.
.sp
This option is
\fIdangerous and may lead to kernel panic!\fR
.sp
"Aborting" requests, or force\-detaching the disk, is intended for completely blocked/hung local backing devices which do no longer complete requests at all, not even do error completions\&. In this situation, usually a hard\-reset and failover is the only way out\&.
.sp
By "aborting", basically faking a local error\-completion, we allow for a more graceful swichover by cleanly migrating services\&. Still the affected node has to be rebooted "soon"\&.
.sp
By completing these requests, we allow the upper layers to re\-use the associated data pages\&.
.sp
If later the local backing device "recovers", and now DMAs some data from disk into the original request pages, in the best case it will just put random data into unused pages; but typically it will corrupt meanwhile completely unrelated data, causing all sorts of damage\&.
.sp
Which means delayed successful completion, especially for READ requests, is a reason to panic()\&. We assume that a delayed *error* completion is OK, though we still will complain noisily about it\&.
.sp
The default value of
\fBdisk\-timeout\fR
is 0, which stands for an infinite timeout\&. Timeouts are specified in units of 0\&.1 seconds\&. This option is available since DRBD 8\&.3\&.12\&.
.RE
.PP
\fB\-\-discard\-zeroes\-if\-aligned \fR\fB{yes | no}\fR
.RS 4
Setting
\fBdiscard\-zeroes\-if\-aligned\fR
to
\fBno\fR
will cause DRBD to always fall\-back to zero\-out on the receiving side, and to not even announce discard capabilities on the Primary, if the respective backend announces discard_zeroes_data=false\&.
.sp
Setting
\fBdiscards\-zeroes\-if\-aligned\fR
to
\fByes\fR
will allow DRBD to use discards, and to announce discard_zeroes=true, even on backends that announce discard_zeroes_data=false\&.
.sp
We used to ignore the discard_zeroes_data setting completely\&. To not break established and expected behaviour, the default value is
\fByes\fR\&.
.sp
This option is available since 8\&.4\&.7\&. See also
\fBdrbd.conf\fR(5)\&.
.RE
.PP
\fB\-\-read\-balancing \fR\fB\fImethod\fR\fR
.RS 4
The supported
\fImethods\fR
for load balancing of read requests are
\fBprefer\-local\fR,
\fBprefer\-remote\fR,
\fBround\-robin\fR,
\fBleast\-pending\fR
and
\fBwhen\-congested\-remote\fR,
\fB32K\-striping\fR,
\fB64K\-striping\fR,
\fB128K\-striping\fR,
\fB256K\-striping\fR,
\fB512K\-striping\fR
and
\fB1M\-striping\fR\&.
.sp
The default value of is
\fBprefer\-local\fR\&. This option is available since 8\&.4\&.1\&.
.RE
.PP
\fB\-\-rs\-discard\-granularity \fR\fB\fIbytes\fR\fR
.RS 4
When
\fBrs\-discard\-granularity\fR
is set to a non zero, positive value then DRBD tries to do a resync operation in requests of this size\&. In case such a block contains only zero bytes on the sync source node, the sync target node will issue a discard/trim/unmap command for the area\&.
.sp
The value is constrained by the discard granularity of the backing block device\&. In case
\fBrs\-discard\-granularity\fR
is not a multiplier of the discard granularity of the backing block device DRBD rounds it up\&. The feature only gets active if the backing block device reads back zeroes after a discard command\&.
.sp
The default value of is 0\&. This option is available since 8\&.4\&.7\&.
.RE
.SS "connect, net\-options"
.\" drbdsetup: net
.PP
Connect sets up the
\fIdevice\fR
to listen on
\fIaf:local_addr:port\fR
for incoming connections and to try to connect to
\fIaf:remote_addr:port\fR\&. If
\fIport\fR
is omitted, 7788 is used as default\&. If
\fIaf\fR
is omitted
\fBipv4\fR
gets used\&. Other supported address families are
\fBipv6\fR,
\fBssocks\fR
for Dolphin Interconnect Solutions\' "super sockets" and
\fBsdp\fR
for Sockets Direct Protocol (Infiniband)\&.
.PP
The net\-options command allows you to change options while the connection is established\&.
.PP
\fB\-\-protocol \fR\fB\fIprotocol\fR\fR
.RS 4
On the TCP/IP link the specified
\fIprotocol\fR
is used\&. Valid protocol specifiers are A, B, and C\&.
.sp
Protocol A: write IO is reported as completed, if it has reached local disk and local TCP send buffer\&.
.sp
Protocol B: write IO is reported as completed, if it has reached local disk and remote buffer cache\&.
.sp
Protocol C: write IO is reported as completed, if it has reached both local and remote disk\&.
.RE
.PP
\fB\-\-connect\-int \fR\fB\fItime\fR\fR
.RS 4
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 retries\&. The default value is 10\&. The unit is seconds\&.
.RE
.PP
\fB\-\-ping\-int \fR\fB\fItime\fR\fR
.RS 4
If the TCP/IP connection linking a DRBD device pair is idle for more than
\fItime\fR
seconds, DRBD will generate a keep\-alive packet to check if its partner is still alive\&. The default value is 10\&. The unit is seconds\&.
.RE
.PP
\fB\-\-timeout \fR\fB\fIval\fR\fR
.RS 4
If the partner node fails to send an expected response packet within
\fIval\fR
tenths of a second, the partner node is considered dead and therefore the TCP/IP connection is abandoned\&. The default value is 60 (= 6 seconds)\&.
.RE
.PP
\fB\-\-sndbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
The socket send buffer is used to store packets sent to the secondary node, which are not yet acknowledged (from a network point of view) by the secondary node\&. When using protocol A, it might be necessary to increase the size of this data structure in order to increase asynchronicity between primary and secondary nodes\&. But keep in mind that more asynchronicity is synonymous with more data loss in the case of a primary node failure\&. Since 8\&.0\&.13 resp\&. 8\&.2\&.7 setting the
\fIsize\fR
value to 0 means that the kernel should autotune this\&. The default
\fIsize\fR
is 0, i\&.e\&. autotune\&.
.RE
.PP
\fB\-\-rcvbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
Packets received from the network are stored in the socket receive buffer first\&. From there they are consumed by DRBD\&. Before 8\&.3\&.2 the receive buffer\'s size was always set to the size of the socket send buffer\&. Since 8\&.3\&.2 they can be tuned independently\&. A value of 0 means that the kernel should autotune this\&. The default
\fIsize\fR
is 0, i\&.e\&. autotune\&.
.RE
.PP
\fB\-\-ko\-count \fR\fB\fIcount\fR\fR
.RS 4
In case the secondary node fails to complete a single write request for
\fIcount\fR
times the
\fItimeout\fR, it is expelled from the cluster, i\&.e\&. the primary node goes into StandAlone mode\&. To disable this feature, you should explicitly set it to 0; defaults may change between versions\&.
.RE
.PP
\fB\-\-max\-epoch\-size \fR\fB\fIval\fR\fR
.RS 4
With this option the maximal number of write requests between two barriers is limited\&. Typically set to the same as
\fB\-\-max\-buffers\fR, or the allowed maximum\&. Values smaller than 10 can lead to degraded performance\&. The default value is 2048\&.
.RE
.PP
\fB\-\-max\-buffers \fR\fB\fIval\fR\fR
.RS 4
With this option the maximal number of buffer pages allocated by DRBD\'s receiver thread is limited\&. Typically set to the same as
\fB\-\-max\-epoch\-size\fR\&. Small values could lead to degraded performance\&. The default value is 2048, the minimum 32\&. Increase this if you cannot saturate the IO backend of the receiving side during linear write or during resync while otherwise idle\&.
.sp
See also
\fBdrbd.conf\fR(5)
.RE
.PP
\fB\-\-unplug\-watermark \fR\fB\fIval\fR\fR
.RS 4
This setting has no effect with recent kernels that use explicit on\-stack plugging (upstream Linux kernel 2\&.6\&.39, distributions may have backported)\&.
.sp
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, yet others don\'t feel much effect at all\&. Minimum 16, default 128, maximum 131072\&.
.RE
.PP
\fB\-\-allow\-two\-primaries \fR
.RS 4
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!
.RE
.PP
\fB\-\-cram\-hmac\-alg \fR\fB\fIalg\fR\fR
.RS 4
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\&.
.RE
.PP
\fB\-\-shared\-secret \fR\fB\fIsecret\fR\fR
.RS 4
The shared secret used in peer authentication\&. May be up to 64 characters\&.
.RE
.PP
\fB\-\-after\-sb\-0pri \fR\fB\fIasb\-0p\-policy\fR\fR
.RS 4
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBdiscard\-younger\-primary\fR
.RS 4
Auto sync from the node that was primary before the split\-brain situation occurred\&.
.RE
.PP
\fBdiscard\-older\-primary\fR
.RS 4
Auto sync from the node that became primary as second during the split\-brain situation\&.
.RE
.PP
\fBdiscard\-zero\-changes\fR
.RS 4
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\&.
.RE
.PP
\fBdiscard\-least\-changes\fR
.RS 4
Auto sync from the node that touched more blocks during the split brain situation\&.
.RE
.PP
\fBdiscard\-node\-NODENAME\fR
.RS 4
Auto sync to the named node\&.
.RE
.RE
.PP
\fB\-\-after\-sb\-1pri \fR\fB\fIasb\-1p\-policy\fR\fR
.RS 4
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBconsensus\fR
.RS 4
Discard the version of the secondary if the outcome of the
\fBafter\-sb\-0pri\fR
algorithm would also destroy the current secondary\'s data\&. Otherwise disconnect\&.
.RE
.PP
\fBdiscard\-secondary\fR
.RS 4
Discard the secondary\'s version\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the correct data, call the
\fBpri\-lost\-after\-sb\fR
on the current primary\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the correct data, accept a possible instantaneous change of the primary\'s data\&.
.RE
.RE
.PP
\fB\-\-after\-sb\-2pri \fR\fB\fIasb\-2p\-policy\fR\fR
.RS 4
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the right data, call the
\fBpri\-lost\-after\-sb\fR
on the current primary\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the right data, accept a possible instantaneous change of the primary\'s data\&.
.RE
.RE
.PP
\fB\-\-always\-asbp\fR
.RS 4
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\&.
.sp
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 have led to strange UUID sets\&.)
.RE
.PP
\fB\-\-rr\-conflict \fR\fB\fIrole\-resync\-conflict\-policy\fR\fR
.RS 4
This option sets DRBD\'s behavior when DRBD deduces from its meta data that a resynchronization is needed, and the SyncTarget node is already primary\&. The possible settings are:
\fBdisconnect\fR,
\fBcall\-pri\-lost\fR
and
\fBviolently\fR\&. While
\fBdisconnect\fR
speaks for itself, with the
\fBcall\-pri\-lost\fR
setting the
\fBpri\-lost\fR
handler is called which is expected to either change the role of the node to secondary, or remove the node from the cluster\&. The default is
\fBdisconnect\fR\&.
.sp
With the
\fBviolently\fR
setting you allow DRBD to force a primary node into SyncTarget state\&. This means that the data exposed by DRBD changes to the SyncSource\'s version of the data instantaneously\&. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING\&.
.RE
.PP
\fB\-\-data\-integrity\-alg \fR\fB\fIhash_alg\fR\fR
.RS 4
DRBD can ensure the data integrity of the user\'s data on the network by comparing hash values\&. Normally this is ensured by the 16 bit checksums in the headers of TCP/IP packets\&. This option can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled\&.
.sp
See also the notes on data integrity on the drbd\&.conf manpage\&.
.RE
.PP
\fB\-\-no\-tcp\-cork\fR
.RS 4
DRBD usually uses the TCP socket option TCP_CORK to hint to the network stack when it can expect more data, and when it should flush out what it has in its send queue\&. There is at least one network stack that performs worse when one uses this hinting method\&. Therefore we introduced this option, which disable the setting and clearing of the TCP_CORK socket option by DRBD\&.
.RE
.PP
\fB\-\-ping\-timeout \fR\fB\fIping_timeout\fR\fR
.RS 4
The time the peer has to answer to a keep\-alive packet\&. In case the peer\'s reply is not received within this time period, it is considered dead\&. The default unit is tenths of a second, the default value is 5 (for half a second)\&.
.RE
.PP
\fB\-\-discard\-my\-data\fR
.RS 4
Use this option to manually recover from a split\-brain situation\&. In case you do not have any automatic after\-split\-brain policies selected, the nodes refuse to connect\&. By passing this option you make this node a sync target immediately after successful connect\&.
.RE
.PP
\fB\-\-tentative\fR
.RS 4
Causes DRBD to abort the connection process after the resync handshake, i\&.e\&. no resync gets performed\&. You can find out which resync DRBD would perform by looking at the kernel\'s log file\&.
.RE
.PP
\fB\-\-on\-congestion \fR\fB\fIcongestion_policy\fR\fR,
.br
\fB\-\-congestion\-fill \fR\fB\fIfill_threshold\fR\fR,
.br
\fB\-\-congestion\-extents \fR\fB\fIactive_extents_threshold\fR\fR
.RS 4
By default DRBD blocks when the available TCP send queue becomes full\&. That means it will slow down the application that generates the write requests that cause DRBD to send more data down that TCP connection\&.
.sp
When DRBD is deployed with DRBD\-proxy it might be more desirable that DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full\&. In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps the connection open\&.
.sp
The advantage of the AHEAD/BEHIND mode is that the application is not slowed down, even if DRBD\-proxy\'s buffer is not sufficient to buffer all write requests\&. The downside is that the peer node falls behind, and that a resync will be necessary to bring it back into sync\&. During that resync the peer node will have an inconsistent disk\&.
.sp
Available
\fIcongestion_policy\fRs are
\fBblock\fR
and
\fBpull\-ahead\fR\&. The default is
\fBblock\fR\&.
\fIFill_threshold\fR
might be in the range of 0 to 10GiBytes\&. The default is 0 which disables the check\&.
\fIActive_extents_threshold\fR
has the same limits as
\fBal\-extents\fR\&.
.sp
The AHEAD/BEHIND mode and its settings are available since DRBD 8\&.3\&.10\&.
.RE
.PP
\fB\-\-verify\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
During online verification (as initiated by the
\fBverify\fR
sub\-command), rather than doing a bit\-wise comparison, DRBD applies a hash function to the contents of every block being verified, and compares that hash with the peer\&. This option defines the hash algorithm being used for that purpose\&. It can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled; you must set this option explicitly in order to be able to use on\-line device verification\&.
.sp
See also the notes on data integrity on the drbd\&.conf manpage\&.
.RE
.PP
\fB\-\-csums\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
A resync process sends all marked data blocks form the source to the destination node, as long as no
\fBcsums\-alg\fR
is given\&. When one is specified the resync process exchanges hash values of all marked blocks first, and sends only those data blocks over, that have different hash values\&.
.sp
This setting is useful for DRBD setups with low bandwidth links\&. During the restart of a crashed primary node, all blocks covered by the activity log are marked for resync\&. But a large part of those will actually be still in sync, therefore using
\fBcsums\-alg\fR
will lower the required bandwidth in exchange for CPU cycles\&.
.RE
.PP
\fB\-\-use\-rle\fR
.RS 4
During resync\-handshake, the dirty\-bitmaps of the nodes are exchanged and merged (using bit\-or), so the nodes will have the same understanding of which blocks are dirty\&. On large devices, the fine grained dirty\-bitmap can become large as well, and the bitmap exchange can take quite some time on low\-bandwidth links\&.
.sp
Because the bitmap typically contains compact areas where all bits are unset (clean) or set (dirty), a simple run\-length encoding scheme can considerably reduce the network traffic necessary for the bitmap exchange\&.
.sp
For backward compatibility reasons, and because on fast links this possibly does not improve transfer time but consumes cpu cycles, this defaults to off\&.
.sp
Introduced in 8\&.3\&.2\&.
.RE
.PP
\fB\-\-socket\-check\-timeout\fR
.RS 4
In setups involving a DRBD\-proxy and connections that experience a lot of buffer\-bloat it might be necessary to set
\fBping\-timeout\fR
to an unusual high value\&. By default DRBD uses the same value to wait if a newly established TCP\-connection is stable\&. Since the DRBD\-proxy is usually located in the same data center such a long wait time may hinder DRBD\'s connect process\&.
.sp
In such setups
\fBsocket\-check\-timeout\fR
should be set to at least to the round trip time between DRBD and DRBD\-proxy\&. I\&.e\&. in most cases to 1\&.
.sp
The default unit is tenths of a second, the default value is 0 (which causes DRBD to use the value of
\fBping\-timeout\fR
instead)\&. Introduced in 8\&.4\&.5\&.
.RE
.SS "resource\-options"
.\" drbdsetup: resource-options
.PP
Changes the options of the resource at runtime\&.
.PP
\fB\-\-cpu\-mask \fR\fB\fIcpu\-mask\fR\fR
.RS 4
Sets the cpu\-affinity\-mask for DRBD\'s kernel threads of this device\&. The default value of
\fIcpu\-mask\fR
is 0, which means that DRBD\'s kernel threads should be spread over all CPUs of the machine\&. This value must be given in hexadecimal notation\&. If it is too big it will be truncated\&.
.RE
.PP
\fB\-\-on\-no\-data\-accessible \fR\fB\fIond\-policy\fR\fR
.RS 4
This setting controls what happens to IO requests on a degraded, disk less node (I\&.e\&. no data store is reachable)\&. The available policies are
\fBio\-error\fR
and
\fBsuspend\-io\fR\&.
.sp
If
\fIond\-policy\fR
is set to
\fBsuspend\-io\fR
you can either resume IO by attaching/connecting the last lost data storage, or by the
\fBdrbdadm resume\-io \fR\fB\fIres\fR\fR
command\&. The latter will result in IO errors of course\&.
.sp
The default is
\fBio\-error\fR\&. This setting is available since DRBD 8\&.3\&.9\&.
.RE
.SS "primary"
.\" drbdsetup: primary
.PP
Sets the
\fIdevice\fR
into primary role\&. This means that applications (e\&.g\&. a file system) may open the
\fIdevice\fR
for read and write access\&. Data written to the
\fIdevice\fR
in primary role are mirrored to the device in secondary role\&.
.PP
Normally it is not possible to set both devices of a connected DRBD device pair to primary role\&. By using the
\fB\-\-allow\-two\-primaries\fR
option, you override this behavior and instruct DRBD to allow two primaries\&.
.PP
\fB\-\-overwrite\-data\-of\-peer\fR
.RS 4
Alias for \-\-force\&.
.RE
.PP
\fB\-\-force\fR
.RS 4
Becoming primary fails if the local replica is not up\-to\-date\&. I\&.e\&. when it is inconsistent, outdated of consistent\&. By using this option you can force it into primary role anyway\&. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING\&.
.RE
.SS "secondary"
.\" drbdsetup: secondary
.PP
Brings the
\fIdevice\fR
into secondary role\&. This operation fails as long as at least one application (or file system) has opened the device\&.
.PP
It is possible that both devices of a connected DRBD device pair are secondary\&.
.SS "verify"
.\" drbdsetup: verify
.PP
This initiates on\-line device verification\&. During on\-line verification, the contents of every block on the local node are compared to those on the peer node\&. Device verification progress can be monitored via
/proc/drbd\&. Any blocks whose content differs from that of the corresponding block on the peer node will be marked out\-of\-sync in DRBD\'s on\-disk bitmap; they are
\fInot\fR
brought back in sync automatically\&. To do that, simply disconnect and reconnect the resource\&.
.PP
If on\-line verification is already in progress (and this node is "VerifyS"), this command silently "succeeds"\&. In this case, any start\-sector (see below) will be ignored, and any stop\-sector (see below) will be honored\&. This can be used to stop a running verify, or to update/shorten/extend the coverage of the currently running verify\&.
.PP
This command will fail if the
\fIdevice\fR
is not part of a connected device pair\&.
.PP
See also the notes on data integrity on the drbd\&.conf manpage\&.
.PP
\fB\-\-start \fR\fB\fIstart\-sector\fR\fR
.RS 4
Since version 8\&.3\&.2, on\-line verification should resume from the last position after connection loss\&. It may also be started from an arbitrary position by setting this option\&. If you had reached some stop\-sector before, and you do not specify an explicit start\-sector, verify should resume from the previous stop\-sector\&.
.sp
Default unit is sectors\&. You may also specify a unit explicitly\&. The
\fBstart\-sector\fR
will be rounded down to a multiple of 8 sectors (4kB)\&.
.RE
.PP
\fB\-S\fR, \fB\-\-stop \fR\fB\fIstop\-sector\fR\fR
.RS 4
Since version 8\&.3\&.14, on\-line verification can be stopped before it reaches end\-of\-device\&.
.sp
Default unit is sectors\&. You may also specify a unit explicitly\&. The
\fBstop\-sector\fR
may be updated by issuing an additional drbdsetup verify command on the same node while the verify is running\&. This can be used to stop a running verify, or to update/shorten/extend the coverage of the currently running verify\&.
.RE
.SS "invalidate"
.\" drbdsetup: invalidate
.PP
This forces the local device of a pair of connected DRBD devices into SyncTarget state, which means that all data blocks of the device are copied over from the peer\&.
.PP
This command will fail if the
\fIdevice\fR
is not either part of a connected device pair, or disconnected Secondary\&.
.SS "invalidate\-remote"
.\" drbdsetup: invalidate-remote
.PP
This forces the local device of a pair of connected DRBD devices into SyncSource state, which means that all data blocks of the device are copied to the peer\&.
.PP
On a disconnected Primary device, this will set all bits in the out of sync bitmap\&. As a side affect this suspends updates to the on disk activity log\&. Updates to the on disk activity log resume automatically when necessary\&.
.SS "wait\-connect"
.\" drbdsetup: wait-connect
.PP
Returns as soon as the
\fIdevice\fR
can communicate with its partner device\&.
.PP
\fB\-\-wfc\-timeout \fR\fB\fIwfc_timeout\fR\fR,
.br
\fB\-\-degr\-wfc\-timeout \fR\fB\fIdegr_wfc_timeout\fR\fR,
.br
\fB\-\-outdated\-wfc\-timeout \fR\fB\fIoutdated_wfc_timeout\fR\fR,
.br
\fB\-\-wait\-after\-sb\fR
.RS 4
This command will fail if the
\fIdevice\fR
cannot communicate with its partner for
\fItimeout\fR
seconds\&. If the peer was working before this node was rebooted, the
\fIwfc_timeout\fR
is used\&. If the peer was already down before this node was rebooted, the
\fIdegr_wfc_timeout\fR
is used\&. If the peer was successfully outdated before this node was rebooted the
\fIoutdated_wfc_timeout\fR
is used\&. The default value for all those timeout values is 0 which means to wait forever\&. The unit is seconds\&. In case the connection status goes down to StandAlone because the peer appeared but the devices had a split brain situation, the default for the command is to terminate\&. You can change this behavior with the
\fB\-\-wait\-after\-sb\fR
option\&.
.RE
.SS "wait\-sync"
.\" drbdsetup: wait-sync
.PP
Returns as soon as the
\fIdevice\fR
leaves any synchronization into connected state\&. The options are the same as with the
\fIwait\-connect\fR
command\&.
.SS "disconnect"
.\" drbdsetup: disconnect
.PP
Removes the information set by the
\fBnet\fR
command from the
\fIdevice\fR\&. This means that the
\fIdevice\fR
goes into unconnected state and will no longer listen for incoming connections\&.
.SS "detach"
.\" drbdsetup: detach
.PP
Removes the information set by the
\fBdisk\fR
command from the
\fIdevice\fR\&. This means that the
\fIdevice\fR
is detached from its backing storage device\&.
.PP
\fB\-f\fR, \fB\-\-force\fR
.RS 4
A regular detach returns after the disk state finally reached diskless\&. As a consequence detaching from a frozen backing block device never terminates\&.
.sp
On the other hand A forced detach returns immediately\&. It allows you to detach DRBD from a frozen backing block device\&. Please note that the disk will be marked as failed until all pending IO requests where finished by the backing block device\&.
.RE
.SS "down"
.\" drbdsetup: down
.PP
Removes all configuration information from the
\fIdevice\fR
and forces it back to unconfigured state\&.
.SS "role"
.\" drbdsetup: role
.PP
Shows the current roles of the
\fIdevice\fR
and its peer, as
\fIlocal\fR/\fIpeer\fR\&.
.SS "state"
.\" drbdsetup: state
.PP
Deprecated alias for "role"
.SS "cstate"
.\" drbdsetup: cstate
.PP
Shows the current connection state of the
\fIdevice\fR\&.
.SS "dstate"
.\" drbdsetup: dstate
.PP
Shows the current states of the backing storage devices, as
\fIlocal\fR/\fIpeer\fR\&.
.SS "resize"
.\" drbdsetup: resize
.PP
This causes DRBD to reexamine the size of the
\fIdevice\fR\'s backing storage device\&. To actually do online growing you need to extend the backing storages on both devices and call the
\fBresize\fR
command on one of your nodes\&.
.PP
The
\fB\-\-size\fR
option can be used to online shrink the usable size of a drbd device\&. It\'s the users responsibility to make sure that a file system on the device is not truncated by that operation\&.
.PP
The
\fB\-\-assume\-peer\-has\-space\fR
allows you to resize a device which is currently not connected to the peer\&. Use with care, since if you do not resize the peer\'s disk as well, further connect attempts of the two will fail\&.
.PP
When the
\fB\-\-assume\-clean\fR
option is given DRBD will skip the resync of the new storage\&. Only do this if you know that the new storage was initialized to the same content by other means\&.
.PP
The options
\fB\-\-al\-stripes\fR
and
\fB\-\-al\-stripe\-size\-kB\fR
may be used to change the layout of the activity log online\&. In case of internal meta data this may invovle shrinking the user visible size at the same time (unsing the
\fB\-\-size\fR) or increasing the avalable space on the backing devices\&.
.SS "check\-resize"
.\" drbdsetup: check-resize
.PP
To enable DRBD to detect offline resizing of backing devices this command may be used to record the current size of backing devices\&. The size is stored in files in /var/lib/drbd/ named drbd\-minor\-??\&.lkbd
.PP
This command is called by
\fBdrbdadm resize \fR\fB\fIres\fR\fR
after
\fBdrbdsetup \fR\fB\fIdevice\fR\fR\fB resize\fR
returned\&.
.SS "pause\-sync"
.\" drbdsetup: pause-sync
.PP
Temporarily suspend an ongoing resynchronization by setting the local pause flag\&. Resync only progresses if neither the local nor the remote pause flag is set\&. It might be desirable to postpone DRBD\'s resynchronization after eventual resynchronization of the backing storage\'s RAID setup\&.
.SS "resume\-sync"
.\" drbdsetup: resume-sync
.PP
Unset the local sync pause flag\&.
.SS "outdate"
.\" drbdsetup: outdate
.PP
Mark the data on the local backing storage as outdated\&. An outdated device refuses to become primary\&. This is used in conjunction with
\fBfencing\fR
and by the peer\'s
\fBfence\-peer\fR
handler\&.
.SS "show\-gi"
.\" drbdsetup: show-gi
.PP
Displays the device\'s data generation identifiers verbosely\&.
.SS "get\-gi"
.\" drbdsetup: get-gi
.PP
Displays the device\'s data generation identifiers\&.
.SS "show"
.\" drbdsetup: show
.PP
Shows all available configuration information of a resource, or of all resources\&. Available options:
.PP
\fB\-\-show\-defaults\fR
.RS 4
Show all configuration parameters, even the ones with default values\&. Normally, parameters with default values are not shown\&.
.RE
.SS "suspend\-io"
.\" drbdsetup: suspend-io
.PP
This command is of no apparent use and just provided for the sake of completeness\&.
.SS "resume\-io"
.\" drbdsetup: resume-io
.PP
If the fence\-peer handler fails to stonith the peer node, and your
\fBfencing\fR
policy is set to resource\-and\-stonith, you can unfreeze IO operations with this command\&.
.SS "status"
.\" drbdsetup: status
.PP
Show the status of a resource, or of all resources\&. The output consists of one paragraph for each configured resource\&. Each paragraph contains one line for each resource, followed by one line for each device, and one line for each connection\&. The device and connection lines are indented\&. The connection lines are followed by one line for each peer device; these lines are indented against the connection line\&.
.PP
Long lines are wrapped around at terminal width, and indented to indicate how the lines belongs together\&. Available options:
.PP
\fB\-\-verbose\fR
.RS 4
Include more information in the output even when it is likely redundant or irrelevant\&.
.RE
.PP
\fB\-\-statistics\fR
.RS 4
Include data transfer statistics in the output\&.
.RE
.PP
\fB\-\-color=\fR\fB{always | auto | never}\fR\fB \fR
.RS 4
Colorize the output\&. With
\fB\-\-color=auto\fR,
\fBdrbdsetup\fR
emits color codes only when standard output is connected to a terminal\&.
.RE
.PP
For example, the non\-verbose output for a resource with only one connection and only one volume could look like this:
.sp
.if n \{\
.RS 4
.\}
.nf
fs\-backoffice role:Primary
disk:UpToDate
peer role:Secondary
replication:Established peer\-disk:UpToDate
.fi
.if n \{\
.RE
.\}
.PP
With the
\fB\-\-verbose\fR
\fB\-\-statistics\fR
options, the same resource could be reported as:
.sp
.if n \{\
.RS 4
.\}
.nf
fs\-data role:Primary suspended:no
write\-ordering:drain
volume:0 minor:1 disk:UpToDate
size:10616472 read:134465 written:144800 al\-writes:18 bm\-writes:0
upper\-pending:0 lower\-pending:0 al\-suspended:no blocked:no
peer connection:Connected role:Secondary congested:no
volume:0 replication:Established peer\-disk:UpToDate resync\-suspended:no
received:122596 sent:22204 out\-of\-sync:0 pending:0 unacked:0
.fi
.if n \{\
.RE
.\}
.sp
.SS "events2"
.\" drbdsetup: events2
.PP
Show the current state of all configured DRBD objects, followed by all changes to the state\&.
.PP
The output format is meant to be human as well as machine readable\&. Each line starts with the event number, which is followed by an asterisk if the event continues in the next line\&. The second word in each line indicates the kind of event:
\fBexists\fR
for an existing object;
\fBcreate\fR,
\fBdestroy\fR, and
\fBchange\fR
if an object is created, destroyed, or changed; or
\fBcall\fR
or
\fBresponse\fR
if an event handler is called or it returns\&. The third word indicates the object the event applies to:
\fBresource\fR,
\fBdevice\fR,
\fBconnection\fR,
\fBpeer\-device\fR,
\fBhelper\fR, or a dash (\fB\-\fR) to indicate that the current state has been dumped completely\&.
.PP
The remaining words identify the object and describe the state that he object is in\&. Available options:
.PP
\fB\-\-now\fR
.RS 4
Terminate after reporting the current state\&. The default is to continuously listen and report state changes\&.
.RE
.PP
\fB\-\-statistics\fR
.RS 4
Include statistics in the output\&.
.RE
.SS "events"
.\" drbdsetup: events
.PP
Deprecated\&. If possible, change to the events2 subcommand instead\&.
.PP
Displays every state change of DRBD and all calls to helper programs\&. This might be used to get notified of DRBD\'s state changes by piping the output to another program\&.
.PP
\fB\-\-all\-devices\fR
.RS 4
Display the events of all DRBD minors\&.
.RE
.PP
\fB\-\-unfiltered\fR
.RS 4
This is a debugging aid that displays the content of all received netlink messages\&.
.RE
.SS "new\-current\-uuid"
.\" drbdsetup: new-current-uuid
.PP
Generates a new current UUID and rotates all other UUID values\&. This has at least two use cases, namely to skip the initial sync, and to reduce network bandwidth when starting in a single node configuration and then later (re\-)integrating a remote site\&.
.PP
Available option:
.PP
\fB\-\-clear\-bitmap\fR
.RS 4
Clears the sync bitmap in addition to generating a new current UUID\&.
.RE
.PP
This can be used to skip the initial sync, if you want to start from scratch\&. This use\-case does only work on "Just Created" meta data\&. Necessary steps:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
On
\fIboth\fR
nodes, initialize meta data and configure the device\&.
.sp
\fBdrbdadm \-\- \-\-force create\-md \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
They need to do the initial handshake, so they know their sizes\&.
.sp
\fBdrbdadm up \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
They are now Connected Secondary/Secondary Inconsistent/Inconsistent\&. Generate a new current\-uuid and clear the dirty bitmap\&.
.sp
\fBdrbdadm new\-current\-uuid \-\-clear\-bitmap \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
They are now Connected Secondary/Secondary UpToDate/UpToDate\&. Make one side primary and create a file system\&.
.sp
\fBdrbdadm primary \fR\fB\fIres\fR\fR
.sp
\fBmkfs \-t \fR\fB\fIfs\-type\fR\fR\fB $(drbdadm sh\-dev \fR\fB\fIres\fR\fR\fB)\fR
.RE
.PP
One obvious side\-effect is that the replica is full of old garbage (unless you made them identical using other means), so any online\-verify is expected to find any number of out\-of\-sync blocks\&.
.PP
\fIYou must not use this on pre\-existing data!\fR
Even though it may appear to work at first glance, once you switch to the other node, your data is toast, as it never got replicated\&. So
\fIdo not leave out the mkfs\fR
(or equivalent)\&.
.PP
This can also be used to shorten the initial resync of a cluster where the second node is added after the first node is gone into production, by means of disk shipping\&. This use\-case works on disconnected devices only, the device may be in primary or secondary role\&.
.PP
The necessary steps on the current active server are:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
\fBdrbdsetup new\-current\-uuid \-\-clear\-bitmap \fR\fB\fIminor\fR\fR\fB \fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
Take the copy of the current active server\&. E\&.g\&. by pulling a disk out of the RAID1 controller, or by copying with dd\&. You need to copy the actual data, and the meta data\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
\fBdrbdsetup new\-current\-uuid \fR\fB\fIminor\fR\fR\fB \fR
.RE
.sp
.RE
Now add the disk to the new secondary node, and join it to the cluster\&. You will get a resync of that parts that were changed since the first call to
\fBdrbdsetup\fR
in step 1\&.
.SH "EXAMPLES"
.PP
For examples, please have a look at the
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fBDRBD web site\fR\m[]\&\s-2\u[2]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD User's Guide
.RS 4
\%http://www.drbd.org/users-guide/
.RE
.IP " 2." 4
DRBD web site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v84/drbdadm.xml 0000644 0001750 0001750 00000054720 12466702073 021133 0 ustar apoikos apoikos
6 May 2011DRBD8.4.0drbdadm8System AdministrationdrbdadmAdministration tool for DRBD drbdadmdrbdadm-d-cfile-tfile-scmd-mcmd-S-hhost--backend-optionscommandallresource/volume>Description is the high level tool of the DRBD program suite.
is to and what
/ is to .
reads its configuration file and performs the specified commands by
calling the and/or the program. can operate on whole resources or on individual volumes in a
resource. The sub commands: , ,
, , ,
, , ,
, , ,
, , ,
, , ,
, work on whole resources and on
individual volumes. Resource level only commands are: , ,
, , and
.Options, Just prints the calls of to stdout, but does not run
the commands.,
fileSpecifies the configuration file drbdadm will use. If this parameter is not
specified, drbdadm will look for ,
, and
.,
fileSpecifies an additional configuration file drbdadm to check. This option is only
allowed with the dump and the sh-nop commands.,
fileSpecifies the full path to the program. If this option
is omitted, drbdadm will look for it beneath itself first, and then in the PATH.,
fileSpecifies the full path to the program. If this option
is omitted, drbdadm will look for it beneath itself first, and then in the PATH., Specifies that this command should be performed on a stacked resource., Specifies to which peer node to connect. Only necessary if there are more than two
host sections in the resource you are working on.backend-optionsAll options following the doubly hyphen are considered
backend-options. These are passed through to the backend
command. I.e. to , or
.CommandsattachAttaches a local backing block device to the DRBD resource's device.detachdrbdadmdetach Removes the backing storage device from a DRBD resource's device.connectdrbdadmconnect Sets up the network configuration of the resource's device. If the peer
device is already configured, the two DRBD devices will connect. If there are more than
two host sections in the resource you need to use the option to
select the peer you want to connect to.disconnectdrbdadmdisconnect Removes the network configuration from the resource. The device will then
go into StandAlone state.syncerdrbdadmsyncer Loads the resynchronization parameters into the device.updrbdadmup Is a shortcut for attach and connect.downdrbdadmdown Is a shortcut for disconnect and detach.primarydrbdadmprimary Promote the resource's device into primary role. You need to do this
before any access to the device, such as creating or mounting a file system.secondarydrbdadmsecondary Brings the device back into secondary role. This is needed since in a
connected DRBD device pair, only one of the two peers may have primary role (except if
is explicitly set in the configuration
file).invalidatedrbdadminvalidate Forces DRBD to consider the data on the local backing
storage device as out-of-sync. Therefore DRBD will copy each
and every block from its peer, to bring the local storage
device back in sync.
To avoid races, you need an established replication link,
or be disconnected Secondary.
invalidate-remotedrbdadminvalidate-remote This command is similar to the invalidate command, however, the
peer's backing storage is invalidated and hence rewritten
with the data of the local node.
To avoid races, you need an established replication link,
or be disconnected Primary.
resizedrbdadmresize Causes DRBD to re-examine all sizing constraints, and resize the
resource's device accordingly. For example, if you increased the size of your backing
storage devices (on both nodes, of course), then DRBD will adopt the new size after you
called this command on one of your nodes. Since new storage space must be synchronised
this command only works if there is at least one primary node present.The option can be used to online shrink the usable
size of a drbd device. It's the users responsibility to make sure that a file system
on the device is not truncated by that operation.The allows you to resize a device which
is currently not connected to the peer. Use with care, since if you do not resize the
peer's disk as well, further connect attempts of the two will fail.The allows you to resize an existing device and avoid
syncing the new space. This is useful when adding addtional blank storage to your device.
Example:
# drbdadm -- --assume-clean resize r0The options and may
be used to change the layout of the activity log online. In case of internal meta data
this may invovle shrinking the user visible size at the same time (unsing the
) or increasing the avalable space on the backing devices.check-resizedrbdadmcheck-resize Calls drbdmeta to eventually move internal meta data. If the backing
device was resized, while DRBD was not running, meta data has to be moved to the end of
the device, so that the next command can succeed.create-mddrbdadmcreate-md Initializes the meta data storage. This needs to be done before a DRBD
resource can be taken online for the first time. In case of issues with that command
have a look at drbdmeta8get-gidrbdadmget-gi Shows a short textual representation of the data generation
identifiers.show-gidrbdadmshow-gi Prints a textual representation of the data generation identifiers
including explanatory information.dump-mddrbdadmdump-md Dumps the whole contents of the meta data storage, including the stored
bit-map and activity-log, in a textual representation.outdatedrbdadmoutdate Sets the outdated flag in the meta data.adjustdrbdadmadjust Synchronizes the configuration of the device with your configuration
file. You should always examine the output of the dry-run mode before actually executing
this command.wait-connectdrbdadmwait-connect Waits until the device is connected to its peer device.roledrbdadmrole Shows the current roles of the devices (local/peer). E.g.
Primary/Secondarystatedrbdadmstate Deprecated alias for "role", see above.cstatedrbdadmcstate Shows the current connection state of the devices.dumpdrbdadmdump Just parse the configuration file and dump it to stdout. May be used to
check the configuration file for syntactic correctness.outdatedrbdadmoutdate Used to mark the node's data as outdated. Usually used by the peer's
fence-peer handler.verifydrbdadmverify Starts online verify. During online verify, data on both nodes is
compared for equality. See /proc/drbd for online
verify progress. If out-of-sync blocks are found, they are not
resynchronized automatically. To do that, disconnect
and connect the resource when verification has
completed.See also the notes on data integrity on the drbd.conf manpage.pause-syncdrbdadmpause-sync Temporarily suspend an ongoing resynchronization by setting the local
pause flag. Resync only progresses if neither the local nor the remote pause flag is
set. It might be desirable to postpone DRBD's resynchronization until after any
resynchronization of the backing storage's RAID setup.resume-syncdrbdadmresume-sync Unset the local sync pause flag.new-current-uuiddrbdadmnew-current-uuid Generates a new currend UUID and rotates all other UUID values.This can be used to shorten the initial resync of a cluster. See the
manpage for a more details.dstatedrbdadmdstate Show the current state of the backing storage devices.
(local/peer)hidden-commandsShows all commands undocumented on purpose.VersionThis document was revised for version 8.4.0 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com and Lars
Ellenberg lars.ellenberg@linbit.comReporting BugsReport bugs to drbd-user@lists.linbit.com.CopyrightCopyright 2001-2011 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.See Alsodrbd.conf5, drbd8, drbddisk8, drbdsetup8, drbdmeta8 and the
DRBD project web site
drbd-utils-8.9.6/documentation/v84/drbdmeta.xml 0000644 0001750 0001750 00000024163 12466702073 021316 0 ustar apoikos apoikos
15 Oct 2008DRBD8.3.2drbdmeta8System AdministrationdrbdmetaDRBD's meta data management tool
drbdmetadrbdmeta--force--ignore-sanity-checksdevicev06 minorv07 meta_dev indexv08 meta_dev indexcommandcmd argsDescription Drbdmeta is used to create, display and modify the contents of
DRBD's meta data storage. Usually you do not want to use this
command directly, but start it via the frontend
drbdadm8.
This command only works if the DRBD resource is currently down,
or at least detached from its backing storage. The first parameter
is the device node associated to the resource. With the second
parameter you can select the version of the meta data. Currently
all major DRBD releases (0.6, 0.7 and 8) are supported.
Options--forcedrbdmeta--force
All questions that get asked by drbdmeta are treated as if
the user answered 'yes'.--ignore-sanity-checksdrbdmeta--ignore-sanity-checks
Some sanity checks cause drbdmeta to terminate. E.g. if a file system image would get
destroyed by creating the meta data. By using that option you can force drbdmeta
to ignore these checks.Commandscreate-md
drbdmetacreate-md
Create-md initializes the meta data storage. This needs to be
done before a DRBD resource can be taken online for the first
time. In case there is already a meta data signature of an
older format in place, drbdmeta will ask you if it should
convert the older format to the selected format.
If you will use the resource before it is connected to its peer
for the first time DRBD may perform better if you use the
option. For DRBD versions of
the peer use up to these values: <8.3.7 -> 4k, 8.3.8 -> 32k, 8.3.9 -> 128k, 8.4.0 -> 1M.
If you want to use more than 6433 activity log extents, or live on
top of a spriped RAID, you may specify the number of stripes
(, default 1), and the stripe size
(, default 32).
To just use a larger linear on-disk ring-buffer, leave
the number of stripes at 1, and increase the size only:
drbdmeta 0 v08 /dev/vg23/lv42 internal create-md --al-stripe-size 1M
To avoid a single "spindle" from becoming a bottleneck,
increase the number of stripes, to achieve an interleaved layout
of the on-disk activity-log transactions.
What you give as "stripe-size" should be what is a.k.a. "chunk size"
or "granularity" or "strip unit": the minimum skip to the next
"spindle".
drbdmeta 0 v08 /dev/vg23/lv42 internal create-md --al-stripes 7 --al-stripe-size 64kget-gidrbdmetaget-gi
Get-gi shows a short textual representation of the data generation
identifier. In version 0.6 and 0.7 these are generation counters,
while in version 8 it is a set of UUIDs.
show-gidrbdmetashow-gi
Show-gi prints a textual representation of the data generation
identifiers including explanatory information.
dump-mddrbdmetadump-md
Dumps the whole contents of the meta data storage including
the stored bit-map and activity-log in a textual representation.
outdatedrbdmetaoutdate
Sets the outdated flag in the meta data. This is used by the
peer node when it wants to become primary, but cannot
communicate with the DRBD stack on this host.
dstatedrbdmetadstate
Prints the state of the data on the backing storage. The output
is always followed by '/DUnknown' since drbdmeta only looks
at the local meta data.
check-resizedrbdmetacheck-resize
Examines the device size of a backing device, and it's last known device size,
recorded in a file /var/lib/drbd/drbd-minor-??.lkbd. In case the size of the
backing device changed, and the meta data can be found at the old position,
it moves the meta data to the right position at the end of the block device.
Expert's commands Drbdmeta allows you to modify the meta data as well. This is
intentionally omitted for the command's usage output, since you
should only use it if you really know what you are doing.
By setting the generation identifiers to wrong values, you
risk to overwrite your up-to-data data with an older version
of your data.
set-gi gidrbdmetaset-gi
Set-gi allows you to set the generation identifier.
Gi needs to be a generation
counter for the 0.6 and 0.7 format, and a UUID set for 8.x.
Specify it in the same way as get-gi shows it.
restore-md dump_filedrbdmetarestore-md
Reads the dump_file and writes
it to the meta data.
VersionThis document was revised for version 8.3.2 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting BugsReport bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbdadm8
drbd-utils-8.9.6/documentation/v84/Makefile.in 0000644 0001750 0001750 00000012542 12634271674 021062 0 ustar apoikos apoikos # Makefile in documentation directory
#
# This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
#
# drbd is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# drbd is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with drbd; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# variables set by configure
DISTRO = @DISTRO@
prefix = @prefix@
exec_prefix = @exec_prefix@
localstatedir = @localstatedir@
datarootdir = @datarootdir@
datadir = @datadir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
mandir = @mandir@
BASH_COMPLETION_SUFFIX = @BASH_COMPLETION_SUFFIX@
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
INITDIR = @INITDIR@
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
CC = @CC@
CFLAGS = @CFLAGS@
XSLTPROC = @XSLTPROC@
# features enabled or disabled by configure
WITH_83_SUPPORT = @WITH_83_SUPPORT@
WITH_84_SUPPORT = @WITH_84_SUPPORT@
WITH_UDEV = @WITH_UDEV@
WITH_XEN = @WITH_XEN@
WITH_PACEMAKER = @WITH_PACEMAKER@
WITH_HEARTBEAT = @WITH_HEARTBEAT@
WITH_RGMANAGER = @WITH_RGMANAGER@
WITH_BASHCOMPLETION = @WITH_BASHCOMPLETION@
# variables meant to be overridden from the make command line
DESTDIR ?= /
# Needed for pattern substitution
SHELL=/bin/bash
MANPAGES := drbdsetup.8 drbd.conf.5 drbd.8 drbdadm.8 drbdmeta.8
ifeq ($(WITH_HEARTBEAT),yes)
MANPAGES += drbddisk.8
endif
STYLESHEET_PREFIX ?= http://docbook.sourceforge.net/release/xsl/current
MANPAGES_STYLESHEET ?= $(STYLESHEET_PREFIX)/manpages/docbook.xsl
HTML_STYLESHEET ?= $(STYLESHEET_PREFIX)/xhtml/docbook.xsl
FO_STYLESHEET ?= $(STYLESHEET_PREFIX)/fo/docbook.xsl
XSLTPROC_OPTIONS ?= --xinclude
XSLTPROC_OPTIONS += --stringparam variablelist.term.break.after 1
#XSLTPROC_OPTIONS += --stringparam variablelist.term.separator ""
XSLTPROC_MANPAGES_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_HTML_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_FO_OPTIONS ?= $(XSLTPROC_OPTIONS)
DRBDSETUP_CMDS = new-resource new-minor del-resource del-minor
DRBDSETUP_CMDS += attach connect disk-options net-options resource-options
DRBDSETUP_CMDS += disconnect detach primary secondary verify invalidate invalidate-remote
DRBDSETUP_CMDS += down wait-connect wait-sync role cstate dstate
DRBDSETUP_CMDS += resize check-resize pause-sync resume-sync
DRBDSETUP_CMDS += outdate show-gi get-gi show events events2
DRBDSETUP_CMDS += status suspend-io resume-io new-current-uuid
make_doc := $(shell $(XSLTPROC) \
$(XSLTPROC_MANPAGES_OPTIONS) \
$(MANPAGES_STYLESHEET) < /dev/null > /dev/null 2>&1 && echo doc )
ifeq ($(make_doc),doc)
all: doc
else
all:
@echo "To (re)make the documentation: make doc"
endif
clean:
@echo "To clean the documentation: make doc-clean"
.PHONY: all clean doc man doc-clean distclean
.PHONY: install uninstall html pdf ps
ifeq ($(WITH_84_SUPPORT),yes)
doc: man
else
doc:
endif
doc-clean: distclean
####### Implicit rules
.SUFFIXES: .sgml .5 .8 .html .pdf .ps
%.5 %.8: %.xml
$(XSLTPROC) \
$(XSLTPROC_MANPAGES_OPTIONS) \
$(MANPAGES_STYLESHEET) $<
%.html: %.xml
$(XSLTPROC) -o $@ \
$(XSLTPROC_HTML_OPTIONS) \
$(HTML_STYLESHEET) $<
%.fo: %.xml
$(XSLTPROC) -o $@ \
$(XSLTPROC_FO_OPTIONS) \
$(FO_STYLESHEET) $<
../../user/v84/drbdsetup.o: FORCE
$(MAKE) -C $(@D) drbdsetup-84
.PHONY: FORCE
FORCE:
# Don't try to re-make files tracked in git
FILES_IN_GIT := # $(shell git ls-files)
FILES_IN_GIT += Makefile.in drbd.conf.xml drbd.xml drbdadm.xml drbddisk.xml
FILES_IN_GIT += drbdmeta.xml drbdsetup.xml xml-usage-to-docbook.xsl
$(FILES_IN_GIT): ;
drbdsetup_X.xml := $(patsubst %,drbdsetup_%.xml,$(DRBDSETUP_CMDS))
drbdsetup_xml-help_X.xml := $(patsubst %,drbdsetup_xml-help_%.xml,$(DRBDSETUP_CMDS))
$(drbdsetup_xml-help_X.xml): ../../user/v84/drbdsetup.o
$(drbdsetup_X.xml): xml-usage-to-docbook.xsl
drbdsetup_xml-help_%.xml:
../../user/v84/drbdsetup-84 xml-help $* > $@
drbdsetup_%.xml: drbdsetup_xml-help_%.xml
$(XSLTPROC) -o $@ xml-usage-to-docbook.xsl $<
distclean:
ifeq ($(make_doc),doc)
rm -f *.[58] manpage.links manpage.refs *~ manpage.log
endif
rm -f *.ps.gz *.pdf *.ps *.html pod2htm*
rm -f drbdsetup_*.xml
#######
man: $(MANPAGES)
install:
ifeq ($(WITH_84_SUPPORT),yes)
@ok=true; for f in $(MANPAGES) ; \
do [ -e $$f ] || { echo $$f missing ; ok=false; } ; \
done ; $$ok
set -e; for f in $(MANPAGES) ; do \
s=$${f##*.}; \
b=$${f%.[0-9]}; \
install -v -D -m 644 $$f $(DESTDIR)$(mandir)/man$$s/$$b-8.4.$$s ; \
done
endif
uninstall:
ifeq ($(WITH_84_SUPPORT),yes)
@ set -e; for f in $(MANPAGES) ; do \
s=$${f##*.}; \
b=$${f%.[0-9]}; \
rm -vf $(DESTDIR)$(mandir)/man$$s/$$b-8.4.$$s ; \
done
endif
html: $(MANPAGES:.8=.html)
pdf: $(MANPAGES:.8=.pdf)
ps: $(MANPAGES:.8=.ps)
drbdsetup.8: drbdsetup.xml $(drbdsetup_X.xml)
.PHONY: install uninstall clean distclean
../../configure:
@echo "please (re-)run ./autogen.sh with appropriate arguments"; exit 1
../../config.status: ../../configure
@echo "please (re-)run ./configure with appropriate arguments"; exit 1
Makefile: Makefile.in ../../config.status
cd ../.. && ./config.status documentation/v84/Makefile
drbd-utils-8.9.6/documentation/v84/drbd.xml 0000644 0001750 0001750 00000006702 12466702073 020446 0 ustar apoikos apoikos
drbdThe start and stop script for DRBDDRBD8.3.215 Oct 2008drbd8System Administration/etc/init.d/drbdresourcestartstopstatusreloadrestartforce-reloadIntroduction The script is used
to start and stop drbd on a system V style init system.
In order to use you must define
a resource, a host, and any other configuration options in the drbd
configuration file. See for details.
If resource is omitted, then all of the
resources listed in the config file are configured.
This script might ask you Do you want to abort waiting for
other server and make this one primary? Only answer this question with yes if you are sure
that it is impossible to repair the other node.
VersionThis document was revised for version 8.3.2 of the DRBD distribution.
Author Written by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting Bugs Report bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbd.conf5,
drbddisk8,
drbdsetup8drbdadm8DRBD Homepage
drbd-utils-8.9.6/documentation/v84/drbddisk.8 0000644 0001750 0001750 00000004321 12654452473 020670 0 ustar apoikos apoikos '\" t
.\" Title: drbddisk
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 15 Oct 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBDDISK" "8" "15 Oct 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbddisk \- Script to mark devices as primary and mount file systems
.SH "SYNOPSIS"
.HP \w'\fB/etc/ha\&.d/resource\&.d/drbddisk\fR\ 'u
\fB/etc/ha\&.d/resource\&.d/drbddisk\fR [\fIresource\fR] {{start}\ |\ {stop}\ |\ {status}}
.SH "INTRODUCTION"
.PP
The
\fB/etc/ha\&.d/resource\&.d/drbddisk\fR
script brings the local device of
\fIresource\fR
into primary role\&. It is designed to be used by Heartbeat\&.
.PP
In order to use
\fB/etc/ha\&.d/resource\&.d/drbddisk\fR
you must define a resource, a host, and any other configuration options in the DRBD configuration file\&. See
\fB/etc/drbd\&.conf\fR
for details\&. If
\fIresource\fR
is omitted, then all of the resources listed in the config file are affected\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.0\&.14 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbdsetup\fR(8)\fBdrbdadm\fR(8)\m[blue]\fBDRBD Homepage\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD Homepage
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v84/drbdadm.8 0000644 0001750 0001750 00000026032 12654452472 020501 0 ustar apoikos apoikos '\" t
.\" Title: drbdadm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 6 May 2011
.\" Manual: System Administration
.\" Source: DRBD 8.4.0
.\" Language: English
.\"
.TH "DRBDADM" "8" "6 May 2011" "DRBD 8.4.0" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdadm \- Administration tool for DRBD .\" drbdadm
.SH "SYNOPSIS"
.HP \w'\fBdrbdadm\fR\ 'u
\fBdrbdadm\fR [\-d] [\-c\ {\fIfile\fR}] [\-t\ {\fIfile\fR}] [\-s\ {\fIcmd\fR}] [\-m\ {\fIcmd\fR}] [\-S] [\-h\ {\fIhost\fR}] [\-\-\ {\fIbackend\-options\fR}] {\fIcommand\fR} [{all} | {\fIresource\fR\fI[/volume>]\fR...}]
.SH "DESCRIPTION"
.PP
\fBDrbdadm\fR
is the high level tool of the DRBD program suite\&.
\fBDrbdadm\fR
is to
\fBdrbdsetup\fR
and
\fBdrbdmeta\fR
what
\fBifup\fR/\fBifdown\fR
is to
\fBifconfig\fR\&.
\fBDrbdadm\fR
reads its configuration file and performs the specified commands by calling the
\fBdrbdsetup\fR
and/or the
\fBdrbdmeta\fR
program\&.
.PP
\fBDrbdadm\fR
can operate on whole resources or on individual volumes in a resource\&. The sub commands:
\fBattach\fR,
\fBdetach\fR,
\fBprimary\fR,
\fBsecondary\fR,
\fBinvalidate\fR,
\fBinvalidate\-remote\fR,
\fBoutdate\fR,
\fBresize\fR,
\fBverify\fR,
\fBpause\-sync\fR,
\fBresume\-sync\fR,
\fBrole\fR,
\fBcsytate\fR,
\fBdstate\fR,
\fBcreate\-md\fR,
\fBshow\-gi\fR,
\fBget\-gi\fR,
\fBdump\-md\fR,
\fBwipe\-md\fR
work on whole resources and on individual volumes\&.
.PP
Resource level only commands are:
\fBconnect\fR,
\fBdisconnect\fR,
\fBup\fR,
\fBdown\fR,
\fBwait\-connect\fR
and
\fBdump\fR\&.
.SH "OPTIONS"
.PP
\fB\-d\fR, \fB\-\-dry\-run\fR
.RS 4
Just prints the calls of
\fBdrbdsetup\fR
to stdout, but does not run the commands\&.
.RE
.PP
\fB\-c\fR, \fB\-\-config\-file\fR \fIfile\fR
.RS 4
Specifies the configuration file drbdadm will use\&. If this parameter is not specified, drbdadm will look for
\fB/etc/drbd\-84\&.conf\fR,
\fB/etc/drbd\-83\&.conf\fR,
\fB/etc/drbd\-08\&.conf\fR
and
\fB/etc/drbd\&.conf\fR\&.
.RE
.PP
\fB\-t\fR, \fB\-\-config\-to\-test\fR \fIfile\fR
.RS 4
Specifies an additional configuration file drbdadm to check\&. This option is only allowed with the dump and the sh\-nop commands\&.
.RE
.PP
\fB\-s\fR, \fB\-\-drbdsetup\fR \fIfile\fR
.RS 4
Specifies the full path to the
\fBdrbdsetup\fR
program\&. If this option is omitted, drbdadm will look for it beneath itself first, and then in the PATH\&.
.RE
.PP
\fB\-m\fR, \fB\-\-drbdmeta\fR \fIfile\fR
.RS 4
Specifies the full path to the
\fBdrbdmeta\fR
program\&. If this option is omitted, drbdadm will look for it beneath itself first, and then in the PATH\&.
.RE
.PP
\fB\-S\fR, \fB\-\-stacked\fR
.RS 4
Specifies that this command should be performed on a stacked resource\&.
.RE
.PP
\fB\-P\fR, \fB\-\-peer\fR
.RS 4
Specifies to which peer node to connect\&. Only necessary if there are more than two host sections in the resource you are working on\&.
.RE
.PP
\fB\-\-\fR \fIbackend\-options\fR
.RS 4
All options following the doubly hyphen are considered
\fIbackend\-options\fR\&. These are passed through to the backend command\&. I\&.e\&. to
\fBdrbdsetup\fR,
\fBdrbdmeta\fR
or
\fBdrbd\-proxy\-ctl\fR\&.
.RE
.SH "COMMANDS"
.PP
attach
.RS 4
Attaches a local backing block device to the DRBD resource\'s device\&.
.RE
.PP
detach
.RS 4
.\" drbdadm: detach
Removes the backing storage device from a DRBD resource\'s device\&.
.RE
.PP
connect
.RS 4
.\" drbdadm: connect
Sets up the network configuration of the resource\'s device\&. If the peer device is already configured, the two DRBD devices will connect\&. If there are more than two host sections in the resource you need to use the
\fB\-\-peer\fR
option to select the peer you want to connect to\&.
.RE
.PP
disconnect
.RS 4
.\" drbdadm: disconnect
Removes the network configuration from the resource\&. The device will then go into StandAlone state\&.
.RE
.PP
syncer
.RS 4
.\" drbdadm: syncer
Loads the resynchronization parameters into the device\&.
.RE
.PP
up
.RS 4
.\" drbdadm: up
Is a shortcut for attach and connect\&.
.RE
.PP
down
.RS 4
.\" drbdadm: down
Is a shortcut for disconnect and detach\&.
.RE
.PP
primary
.RS 4
.\" drbdadm: primary
Promote the resource\'s device into primary role\&. You need to do this before any access to the device, such as creating or mounting a file system\&.
.RE
.PP
secondary
.RS 4
.\" drbdadm: secondary
Brings the device back into secondary role\&. This is needed since in a connected DRBD device pair, only one of the two peers may have primary role (except if
\fBallow\-two\-primaries\fR
is explicitly set in the configuration file)\&.
.RE
.PP
invalidate
.RS 4
.\" drbdadm: invalidate
Forces DRBD to consider the data on the
\fIlocal\fR
backing storage device as out\-of\-sync\&. Therefore DRBD will copy each and every block from its peer, to bring the local storage device back in sync\&. To avoid races, you need an established replication link, or be disconnected Secondary\&.
.RE
.PP
invalidate\-remote
.RS 4
.\" drbdadm: invalidate-remote
This command is similar to the invalidate command, however, the
\fIpeer\'s\fR
backing storage is invalidated and hence rewritten with the data of the local node\&. To avoid races, you need an established replication link, or be disconnected Primary\&.
.RE
.PP
resize
.RS 4
.\" drbdadm: resize
Causes DRBD to re\-examine all sizing constraints, and resize the resource\'s device accordingly\&. For example, if you increased the size of your backing storage devices (on both nodes, of course), then DRBD will adopt the new size after you called this command on one of your nodes\&. Since new storage space must be synchronised this command only works if there is at least one primary node present\&.
.sp
The
\fB\-\-size\fR
option can be used to online shrink the usable size of a drbd device\&. It\'s the users responsibility to make sure that a file system on the device is not truncated by that operation\&.
.sp
The
\fB\-\-assume\-peer\-has\-space\fR
allows you to resize a device which is currently not connected to the peer\&. Use with care, since if you do not resize the peer\'s disk as well, further connect attempts of the two will fail\&.
.sp
The
\fB\-\-assume\-clean\fR
allows you to resize an existing device and avoid syncing the new space\&. This is useful when adding addtional blank storage to your device\&. Example:
.sp
.if n \{\
.RS 4
.\}
.nf
# drbdadm \-\- \-\-assume\-clean resize r0
.fi
.if n \{\
.RE
.\}
.sp
The options
\fB\-\-al\-stripes\fR
and
\fB\-\-al\-stripe\-size\-kB\fR
may be used to change the layout of the activity log online\&. In case of internal meta data this may invovle shrinking the user visible size at the same time (unsing the
\fB\-\-size\fR) or increasing the avalable space on the backing devices\&.
.RE
.PP
check\-resize
.RS 4
.\" drbdadm: check-resize
Calls drbdmeta to eventually move internal meta data\&. If the backing device was resized, while DRBD was not running, meta data has to be moved to the end of the device, so that the next
\fBattach\fR
command can succeed\&.
.RE
.PP
create\-md
.RS 4
.\" drbdadm: create-md
Initializes the meta data storage\&. This needs to be done before a DRBD resource can be taken online for the first time\&. In case of issues with that command have a look at
\fBdrbdmeta\fR(8)
.RE
.PP
get\-gi
.RS 4
.\" drbdadm: get-gi
Shows a short textual representation of the data generation identifiers\&.
.RE
.PP
show\-gi
.RS 4
.\" drbdadm: show-gi
Prints a textual representation of the data generation identifiers including explanatory information\&.
.RE
.PP
dump\-md
.RS 4
.\" drbdadm: dump-md
Dumps the whole contents of the meta data storage, including the stored bit\-map and activity\-log, in a textual representation\&.
.RE
.PP
outdate
.RS 4
.\" drbdadm: outdate
Sets the outdated flag in the meta data\&.
.RE
.PP
adjust
.RS 4
.\" drbdadm: adjust
Synchronizes the configuration of the device with your configuration file\&. You should always examine the output of the dry\-run mode before actually executing this command\&.
.RE
.PP
wait\-connect
.RS 4
.\" drbdadm: wait-connect
Waits until the device is connected to its peer device\&.
.RE
.PP
role
.RS 4
.\" drbdadm: role
Shows the current roles of the devices (local/peer)\&. E\&.g\&. Primary/Secondary
.RE
.PP
state
.RS 4
.\" drbdadm: state
Deprecated alias for "role", see above\&.
.RE
.PP
cstate
.RS 4
.\" drbdadm: cstate
Shows the current connection state of the devices\&.
.RE
.PP
dump
.RS 4
.\" drbdadm: dump
Just parse the configuration file and dump it to stdout\&. May be used to check the configuration file for syntactic correctness\&.
.RE
.PP
outdate
.RS 4
.\" drbdadm: outdate
Used to mark the node\'s data as outdated\&. Usually used by the peer\'s fence\-peer handler\&.
.RE
.PP
verify
.RS 4
.\" drbdadm: verify
Starts online verify\&. During online verify, data on both nodes is compared for equality\&. See
/proc/drbd
for online verify progress\&. If out\-of\-sync blocks are found, they are
\fInot\fR
resynchronized automatically\&. To do that,
\fBdisconnect\fR
and
\fBconnect\fR
the resource when verification has completed\&.
.sp
See also the notes on data integrity on the drbd\&.conf manpage\&.
.RE
.PP
pause\-sync
.RS 4
.\" drbdadm: pause-sync
Temporarily suspend an ongoing resynchronization by setting the local pause flag\&. Resync only progresses if neither the local nor the remote pause flag is set\&. It might be desirable to postpone DRBD\'s resynchronization until after any resynchronization of the backing storage\'s RAID setup\&.
.RE
.PP
resume\-sync
.RS 4
.\" drbdadm: resume-sync
Unset the local sync pause flag\&.
.RE
.PP
new\-current\-uuid
.RS 4
.\" drbdadm: new-current-uuid
Generates a new currend UUID and rotates all other UUID values\&.
.sp
This can be used to shorten the initial resync of a cluster\&. See the
\fBdrbdsetup\fR
manpage for a more details\&.
.RE
.PP
dstate
.RS 4
.\" drbdadm: dstate
Show the current state of the backing storage devices\&. (local/peer)
.RE
.PP
hidden\-commands
.RS 4
Shows all commands undocumented on purpose\&.
.RE
.SH "VERSION"
.sp
This document was revised for version 8\&.4\&.0 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
Copyright 2001\-2011 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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8),
\fBdrbdmeta\fR(8)
and the
\m[blue]\fBDRBD project web site\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD project web site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v84/drbd.conf.5 0000644 0001750 0001750 00000154315 12654452471 020745 0 ustar apoikos apoikos '\" t
.\" Title: drbd.conf
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 6 May 2011
.\" Manual: Configuration Files
.\" Source: DRBD 8.4.0
.\" Language: English
.\"
.TH "DRBD\&.CONF" "5" "6 May 2011" "DRBD 8.4.0" "Configuration Files"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbd.conf \- Configuration file for DRBD\'s devices .\" drbd.conf
.SH "INTRODUCTION"
.PP
The file
\fB/etc/drbd\&.conf\fR
is read by
\fBdrbdadm\fR\&.
.PP
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
\fB/etc/drbd\&.conf\fR
should be the same on both nodes of the cluster\&. Changes to
\fB/etc/drbd\&.conf\fR
do not apply immediately\&.
.PP
By convention the main config contains two include statements\&. The first one includes the file
\fB/etc/drbd\&.d/global_common\&.conf\fR, the second one all file with a
\fB\&.res\fR
suffix\&.
.PP
.PP \fBExample\ \&1.\ \&A small example.res file\fR .sp .if n \{\ .RS 4 .\} .nf resource r0 { net { protocol C; cram\-hmac\-alg sha1; shared\-secret "FooFunFactory"; } disk { resync\-rate 10M; } on alice { volume 0 { device minor 1; disk /dev/sda7; meta\-disk internal; } address 10\&.1\&.1\&.31:7789; } on bob { volume 0 { device minor 1; disk /dev/sda7; meta\-disk internal; } address 10\&.1\&.1\&.32:7789; } } .fi .if n \{\ .RE .\}In this example, there is a single DRBD resource (called r0) which uses protocol C for the connection between its devices\&. It contains a single volume which runs on host
\fIalice\fR
uses
\fI/dev/drbd1\fR
as devices for its application, and
\fI/dev/sda7\fR
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\&. This sync\-rate statement is valid for volume 0, but would also be valid for further volumes\&. In this example it assigns full 10MByte/second to each volume\&.
.PP
There may be multiple resource sections in a single drbd\&.conf file\&. For more examples, please have a look at the
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "FILE FORMAT"
.PP
The file consists of sections and parameters\&. A section begins with a keyword, sometimes an additional name, and an opening brace (\(lq{\(rq)\&. A section ends with a closing brace (\(lq}\(rq\&. The braces enclose the parameters\&.
.PP
section [name] { parameter value; [\&.\&.\&.] }
.PP
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 consist only of the identifier\&. Parameters are terminated by a semicolon (\(lq;\(rq)\&.
.PP
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)\&.
.PP
Comments may be placed into the configuration file and must begin with a hash sign (\(lq#\(rq)\&. Subsequent characters are ignored until the end of the line\&.
.SS "Sections"
.PP
\fBskip\fR
.RS 4
.\" drbd.conf: skip
Comments out chunks of text, even spanning more than one line\&. Characters between the keyword
\fBskip\fR
and the opening brace (\(lq{\(rq) are ignored\&. Everything enclosed by the braces is skipped\&. This comes in handy, if you just want to comment out some \'\fBresource [name] {\&.\&.\&.}\fR\' section: just precede it with \'\fBskip\fR\'\&.
.RE
.PP
\fBglobal\fR
.RS 4
.\" drbd.conf: global
Configures some global parameters\&. Currently only
\fBminor\-count\fR,
\fBdialog\-refresh\fR,
\fBdisable\-ip\-verification\fR
and
\fBusage\-count\fR
are allowed here\&. You may only have one global section, preferably as the first section\&.
.RE
.PP
\fBcommon\fR
.RS 4
.\" drbd.conf: common
All resources inherit the options set in this section\&. The common section might have a
\fBstartup\fR, a
\fBoptions\fR, a
\fBhandlers\fR, a
\fBnet\fR
and a
\fBdisk\fR
section\&.
.RE
.PP
\fBresource \fR\fB\fIname\fR\fR
.RS 4
.\" drbd.conf: resource
Configures a DRBD resource\&. Each resource section needs to have two (or more)
\fBon \fR\fB\fIhost\fR\fR
sections and may have a
\fBstartup\fR, a
\fBoptions\fR, a
\fBhandlers\fR, a
\fBnet\fR
and a
\fBdisk\fR
section\&. It might contain
\fBvolume\fRs sections\&.
.RE
.PP
\fBon \fR\fB\fIhost\-name\fR\fR
.RS 4
.\" drbd.conf: on
Carries the necessary configuration parameters for a DRBD device of the enclosing resource\&.
\fIhost\-name\fR
is mandatory and must match the Linux host name (uname \-n) of one of the nodes\&. You may list more than one host name here, in case you want to use the same parameters on several hosts (you\'d have to move the IP around usually)\&. Or you may list more than two such sections\&.
.sp
.if n \{\
.RS 4
.\}
.nf
resource r1 {
protocol C;
device minor 1;
meta\-disk internal;
on alice bob {
address 10\&.2\&.2\&.100:7801;
disk /dev/mapper/some\-san;
}
on charlie {
address 10\&.2\&.2\&.101:7801;
disk /dev/mapper/other\-san;
}
on daisy {
address 10\&.2\&.2\&.103:7801;
disk /dev/mapper/other\-san\-as\-seen\-from\-daisy;
}
}
.fi
.if n \{\
.RE
.\}
.sp
See also the
\fBfloating\fR
section keyword\&. Required statements in this section:
\fBaddress\fR
and
\fBvolume\fR\&. Note for backward compatibility and convenience it is valid to embed the statements of a single volume directly into the host section\&.
.RE
.PP
\fBvolume \fR\fB\fIvnr\fR\fR
.RS 4
.\" drbd.conf: volume
Defines a volume within a connection\&. The minor numbers of a replicated volume might be different on different hosts, the volume number (\fIvnr\fR) is what groups them together\&. Required parameters in this section:
\fBdevice\fR,
\fBdisk\fR,
\fBmeta\-disk\fR\&.
.RE
.PP
\fBstacked\-on\-top\-of \fR\fB\fIresource\fR\fR
.RS 4
.\" drbd.conf: stacked-on-top-of
For a stacked DRBD setup (3 or 4 nodes), a
\fBstacked\-on\-top\-of\fR
is used instead of an
\fBon\fR
section\&. Required parameters in this section:
\fBdevice\fR
and
\fBaddress\fR\&.
.RE
.PP
\fBfloating \fR\fB\fIAF addr:port\fR\fR
.RS 4
.\" drbd.conf: on
Carries the necessary configuration parameters for a DRBD device of the enclosing resource\&. This section is very similar to the
\fBon\fR
section\&. The difference to the
\fBon\fR
section is that the matching of the host sections to machines is done by the IP\-address instead of the node name\&. Required parameters in this section:
\fBdevice\fR,
\fBdisk\fR,
\fBmeta\-disk\fR, all of which
\fImay\fR
be inherited from the resource section, in which case you may shorten this section down to just the address identifier\&.
.sp
.if n \{\
.RS 4
.\}
.nf
resource r2 {
protocol C;
device minor 2;
disk /dev/sda7;
meta\-disk internal;
# short form, device, disk and meta\-disk inherited
floating 10\&.1\&.1\&.31:7802;
# longer form, only device inherited
floating 10\&.1\&.1\&.32:7802 {
disk /dev/sdb;
meta\-disk /dev/sdc8;
}
}
.fi
.if n \{\
.RE
.\}
.RE
.PP
\fBdisk\fR
.RS 4
.\" drbd.conf: disk
This section is used to fine tune DRBD\'s properties in respect to the low level storage\&. Please refer to
\fBdrbdsetup\fR(8)
for detailed description of the parameters\&. Optional parameters:
\fBon\-io\-error\fR,
\fBsize\fR,
\fBfencing\fR,
\fBdisk\-barrier\fR,
\fBdisk\-flushes\fR,
\fBdisk\-drain\fR,
\fBmd\-flushes\fR,
\fBmax\-bio\-bvecs\fR,
\fBresync\-rate\fR,
\fBresync\-after\fR,
\fBal\-extents\fR,
\fBal\-updates\fR,
\fBc\-plan\-ahead\fR,
\fBc\-fill\-target\fR,
\fBc\-delay\-target\fR,
\fBc\-max\-rate\fR,
\fBc\-min\-rate\fR,
\fBdisk\-timeout\fR,
\fBdiscard\-zeroes\-if\-aligned\fR,
\fBrs\-discard\-granularity\fR,
\fBread\-balancing\fR\&.
.RE
.PP
\fBnet\fR
.RS 4
.\" drbd.conf: net
This section is used to fine tune DRBD\'s properties\&. Please refer to
\fBdrbdsetup\fR(8)
for a detailed description of this section\'s parameters\&. Optional parameters:
\fBprotocol\fR,
\fBsndbuf\-size\fR,
\fBrcvbuf\-size\fR,
\fBtimeout\fR,
\fBconnect\-int\fR,
\fBping\-int\fR,
\fBping\-timeout\fR,
\fBmax\-buffers\fR,
\fBmax\-epoch\-size\fR,
\fBko\-count\fR,
\fBallow\-two\-primaries\fR,
\fBcram\-hmac\-alg\fR,
\fBshared\-secret\fR,
\fBafter\-sb\-0pri\fR,
\fBafter\-sb\-1pri\fR,
\fBafter\-sb\-2pri\fR,
\fBdata\-integrity\-alg\fR,
\fBno\-tcp\-cork\fR,
\fBon\-congestion\fR,
\fBcongestion\-fill\fR,
\fBcongestion\-extents\fR,
\fBverify\-alg\fR,
\fBuse\-rle\fR,
\fBcsums\-alg\fR,
\fBsocket\-check\-timeout\fR\&.
.RE
.PP
\fBstartup\fR
.RS 4
.\" drbd.conf: startup
This section is used to fine tune DRBD\'s properties\&. Please refer to
\fBdrbdsetup\fR(8)
for a detailed description of this section\'s parameters\&. Optional parameters:
\fBwfc\-timeout\fR,
\fBdegr\-wfc\-timeout\fR,
\fBoutdated\-wfc\-timeout\fR,
\fBwait\-after\-sb\fR,
\fBstacked\-timeouts\fR
and
\fBbecome\-primary\-on\fR\&.
.RE
.PP
\fBoptions\fR
.RS 4
.\" drbd.conf: options
This section is used to fine tune the behaviour of the resource object\&. Please refer to
\fBdrbdsetup\fR(8)
for a detailed description of this section\'s parameters\&. Optional parameters:
\fBcpu\-mask\fR, and
\fBon\-no\-data\-accessible\fR\&.
.RE
.PP
\fBhandlers\fR
.RS 4
.\" drbd.conf: handlers
In this section you can define handlers (executables) that are started by the DRBD system in response to certain events\&. Optional parameters:
\fBpri\-on\-incon\-degr\fR,
\fBpri\-lost\-after\-sb\fR,
\fBpri\-lost\fR,
\fBfence\-peer\fR
(formerly oudate\-peer),
\fBlocal\-io\-error\fR,
\fBinitial\-split\-brain\fR,
\fBsplit\-brain\fR,
\fBbefore\-resync\-target\fR,
\fBafter\-resync\-target\fR\&.
.sp
The interface is done via environment variables:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBDRBD_RESOURCE\fR
is the name of the resource
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBDRBD_MINOR\fR
is the minor number of the DRBD device, in decimal\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBDRBD_CONF\fR
is the path to the primary configuration file; if you split your configuration into multiple files (e\&.g\&. in
\fB/etc/drbd\&.conf\&.d/\fR), this will not be helpful\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBDRBD_PEER_AF\fR
,
\fBDRBD_PEER_ADDRESS\fR
,
\fBDRBD_PEERS\fR
are the address family (e\&.g\&.
\fBipv6\fR), the peer\'s address and hostnames\&.
.RE
.RS 4
\fBDRBD_PEER\fR
is deprecated\&.
.sp
Please note that not all of these might be set for all handlers, and that some values might not be useable for a
\fBfloating\fR
definition\&.
.RE
.SS "Parameters"
.PP
\fBminor\-count \fR\fB\fIcount\fR\fR
.RS 4
.\" drbd.conf: minor-count\fIcount\fR
may be a number from 1 to 1048575\&.
.sp
\fIMinor\-count\fR
is a sizing hint for DRBD\&. It helps to right\-size various memory pools\&. It should be set in the in the same order of magnitude than the actual number of minors you use\&. Per default the module loads with 11 more resources than you have currently in your config but at least 32\&.
.RE
.PP
\fBdialog\-refresh \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: dialog-refresh\fItime\fR
may be 0 or a positive number\&.
.sp
The user dialog redraws the second count every
\fItime\fR
seconds (or does no redraws if
\fItime\fR
is 0)\&. The default value is 1\&.
.RE
.PP
\fBdisable\-ip\-verification\fR
.RS 4
.\" drbd.conf: disable-ip-verification
Use
\fIdisable\-ip\-verification\fR
if, for some obscure reasons, drbdadm can/might not use
\fBip\fR
or
\fBifconfig\fR
to do a sanity check for the IP address\&. You can disable the IP verification with this option\&.
.RE
.PP
\fBusage\-count \fR\fB\fIval\fR\fR
.RS 4
.\" drbd.conf: usage-count
Please participate in
\m[blue]\fBDRBD\'s online usage counter\fR\m[]\&\s-2\u[2]\d\s+2\&. The most convenient way to do so is to set this option to
\fByes\fR\&. Valid options are:
\fByes\fR,
\fBno\fR
and
\fBask\fR\&.
.RE
.PP
\fBprotocol \fR\fB\fIprot\-id\fR\fR
.RS 4
.\" drbd.conf: protocol
On the TCP/IP link the specified
\fIprotocol\fR
is used\&. Valid protocol specifiers are A, B, and C\&.
.sp
Protocol A: write IO is reported as completed, if it has reached local disk and local TCP send buffer\&.
.sp
Protocol B: write IO is reported as completed, if it has reached local disk and remote buffer cache\&.
.sp
Protocol C: write IO is reported as completed, if it has reached both local and remote disk\&.
.RE
.PP
\fBdevice \fR\fB\fIname\fR\fR\fB minor \fR\fB\fInr\fR\fR
.RS 4
.\" drbd.conf: device
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
\fBdisk\fR
parameter\&.
.sp
One can ether omit the
\fIname\fR
or
\fBminor\fR
and the
\fIminor number\fR\&. If you omit the
\fIname\fR
a default of /dev/drbd\fIminor\fR
will be used\&.
.sp
Udev will create additional symlinks in /dev/drbd/by\-res and /dev/drbd/by\-disk\&.
.RE
.PP
\fBdisk \fR\fB\fIname\fR\fR
.RS 4
.\" drbd.conf: disk
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 also holds true for
\fBdumpe2fs\fR(8)
and similar commands\&.
.RE
.PP
\fBaddress \fR\fB\fIAF addr:port\fR\fR
.RS 4
.\" drbd.conf: address
A resource needs one
\fIIP\fR
address per device, which is used to wait for incoming connections from the partner device respectively to reach the partner device\&.
\fIAF\fR
must be one of
\fBipv4\fR,
\fBipv6\fR,
\fBssocks\fR
or
\fBsdp\fR
(for compatibility reasons
\fBsci\fR
is an alias for
\fBssocks\fR)\&. It may be omited for IPv4 addresses\&. The actual IPv6 address that follows the
\fBipv6\fR
keyword must be placed inside brackets:
ipv6 [fd01:2345:6789:abcd::1]:7800\&.
.sp
Each DRBD resource needs a TCP
\fIport\fR
which is used to connect to the node\'s partner device\&. Two different DRBD resources may not use the same
\fIaddr:port\fR
combination on the same node\&.
.RE
.PP
\fBmeta\-disk internal\fR,
.br
\fBmeta\-disk \fR\fB\fIdevice\fR\fR,
.br
\fBmeta\-disk \fR\fB\fIdevice\fR\fR\fB [\fR\fB\fIindex\fR\fR\fB]\fR
.RS 4
.\" drbd.conf: meta-disk
Internal means that the last part of the backing device is used to store the meta\-data\&. The size of the meta\-data is computed based on the size of the device\&.
.sp
When a
\fIdevice\fR
is specified, either with or without an
\fIindex\fR, DRBD stores the meta\-data on this device\&. Without
\fIindex\fR, the size of the meta\-data is determined by the size of the data device\&. This is usually used with LVM, which allows to have many variable sized block devices\&. The meta\-data size is 36kB + Backing\-Storage\-size / 32k, rounded up to the next 4kb boundary\&. (Rule of the thumb: 32kByte per 1GByte of storage, rounded up to the next MB\&.)
.sp
When an
\fIindex\fR
is specified, each index number refers to a fixed slot of meta\-data of 128 MB, which allows a maximum data size of 4 TiB\&. This way, multiple DBRD devices can share the same meta\-data device\&. For example, if /dev/sde6[0] and /dev/sde6[1] are used, /dev/sde6 must be at least 256 MB big\&. Because of the hard size limit, use of meta\-disk indexes is discouraged\&.
.RE
.PP
\fBon\-io\-error \fR\fB\fIhandler\fR\fR
.RS 4
.\" drbd.conf: on-io-error\fIhandler\fR
is taken, if the lower level device reports io\-errors to the upper layers\&.
.sp
\fIhandler\fR
may be
\fBpass_on\fR,
\fBcall\-local\-io\-error\fR
or
\fBdetach\&.\fR
.sp
\fBpass_on\fR: The node downgrades the disk status to inconsistent, marks the erroneous block as inconsistent in the bitmap and retries the IO on the remote node\&.
.sp
\fBcall\-local\-io\-error\fR: Call the handler script
\fBlocal\-io\-error\fR\&.
.sp
\fBdetach\fR: The node drops its low level device, and continues in diskless mode\&.
.RE
.PP
\fBfencing \fR\fB\fIfencing_policy\fR\fR
.RS 4
.\" drbd.conf: fencing
By
\fBfencing\fR
we understand preventive measures to avoid situations where both nodes are primary and disconnected (AKA split brain)\&.
.sp
Valid fencing policies are:
.PP
\fBdont\-care\fR
.RS 4
This is the default policy\&. No fencing actions are taken\&.
.RE
.PP
\fBresource\-only\fR
.RS 4
If a node becomes a disconnected primary, it tries to fence the peer\'s disk\&. This is done by calling the
\fBfence\-peer\fR
handler\&. The handler is supposed to reach the other node over alternative communication paths and call \'\fBdrbdadm outdate res\fR\' there\&.
.RE
.PP
\fBresource\-and\-stonith\fR
.RS 4
If a node becomes a disconnected primary, it freezes all its IO operations and calls its fence\-peer handler\&. The fence\-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
\fBresume\-io\fR
command\&.
.RE
.RE
.PP
\fBdisk\-barrier\fR,
.br
\fBdisk\-flushes\fR,
.br
\fBdisk\-drain\fR
.RS 4
.\" drbd.conf: disk-barrier
.\" drbd.conf: disk-flushes
.\" drbd.conf: disk-drain
DRBD has four implementations to express write\-after\-write dependencies to its backing storage device\&. DRBD will use the first method that is supported by the backing storage device and that is not disabled\&. By default the
\fIflush\fR
method is used\&.
.sp
Since drbd\-8\&.4\&.2
\fBdisk\-barrier\fR
is disabled by default because since linux\-2\&.6\&.36 (or 2\&.6\&.32 RHEL6) there is no reliable way to determine if queuing of IO\-barriers works\&.
\fIDangerous\fR
only enable if you are told so by one that knows for sure\&.
.sp
When selecting the method you should not only base your decision on the measurable performance\&. In case your backing storage device has a volatile write cache (plain disks, RAID of plain disks) you should use one of the first two\&. In case your backing storage device has battery\-backed write cache you may go with option 3\&. Option 4 (disable everything, use "none")
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fBno\-disk\-drain\fR\&.
.sp
Unfortunately device mapper (LVM) might not support barriers\&.
.sp
The letter after "wo:" in /proc/drbd indicates with method is currently in use for a device:
\fBb\fR,
\fBf\fR,
\fBd\fR,
\fBn\fR\&. The implementations are:
.PP
barrier
.RS 4
The first requires that the driver of the backing storage device support barriers (called \'tagged command queuing\' in SCSI and \'native command queuing\' in SATA speak)\&. The use of this method can be enabled by setting the
\fBdisk\-barrier\fR
options to
\fByes\fR\&.
.RE
.PP
flush
.RS 4
The second requires that the backing device support disk flushes (called \'force unit access\' in the drive vendors speak)\&. The use of this method can be disabled setting
\fBdisk\-flushes\fR
to
\fBno\fR\&.
.RE
.PP
drain
.RS 4
The third method is simply to let write requests drain before write requests of a new reordering domain are issued\&. This was the only implementation before 8\&.0\&.9\&.
.RE
.PP
none
.RS 4
The fourth method is to not express write\-after\-write dependencies to the backing store at all, by also specifying
\fBno\-disk\-drain\fR\&. This
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fBno\-disk\-drain\fR\&.
.RE
.RE
.PP
\fBmd\-flushes\fR
.RS 4
.\" drbd.conf: md-flushes
Disables the use of disk flushes and barrier BIOs when accessing the meta data device\&. See the notes on
\fBdisk\-flushes\fR\&.
.RE
.PP
\fBmax\-bio\-bvecs\fR
.RS 4
.\" drbd.conf: max-bio-bvecs
In some special circumstances the device mapper stack manages to pass BIOs to DRBD that violate the constraints that are set forth by DRBD\'s merge_bvec() function and which have more than one bvec\&. A known example is: phys\-disk \-> DRBD \-> LVM \-> Xen \-> misaligned partition (63) \-> DomU FS\&. Then you might see "bio would need to, but cannot, be split:" in the Dom0\'s kernel log\&.
.sp
The best workaround is to proper align the partition within the VM (E\&.g\&. start it at sector 1024)\&. This costs 480 KiB of storage\&. Unfortunately the default of most Linux partitioning tools is to start the first partition at an odd number (63)\&. Therefore most distribution\'s install helpers for virtual linux machines will end up with misaligned partitions\&. The second best workaround is to limit DRBD\'s max bvecs per BIO (=
\fBmax\-bio\-bvecs\fR) to 1, but that might cost performance\&.
.sp
The default value of
\fBmax\-bio\-bvecs\fR
is 0, which means that there is no user imposed limitation\&.
.RE
.PP
\fBdisk\-timeout\fR
.RS 4
.\" drbd.conf: disk-timeout
If the lower\-level device on which a DRBD device stores its data does not finish an I/O request within the defined
\fBdisk\-timeout\fR, DRBD treats this as a failure\&. The lower\-level device is detached, and the device\'s disk state advances to Diskless\&. If DRBD is connected to one or more peers, the failed request is passed on to one of them\&.
.sp
This option is
\fIdangerous and may lead to kernel panic!\fR
.sp
"Aborting" requests, or force\-detaching the disk, is intended for completely blocked/hung local backing devices which do no longer complete requests at all, not even do error completions\&. In this situation, usually a hard\-reset and failover is the only way out\&.
.sp
By "aborting", basically faking a local error\-completion, we allow for a more graceful swichover by cleanly migrating services\&. Still the affected node has to be rebooted "soon"\&.
.sp
By completing these requests, we allow the upper layers to re\-use the associated data pages\&.
.sp
If later the local backing device "recovers", and now DMAs some data from disk into the original request pages, in the best case it will just put random data into unused pages; but typically it will corrupt meanwhile completely unrelated data, causing all sorts of damage\&.
.sp
Which means delayed successful completion, especially for READ requests, is a reason to panic()\&. We assume that a delayed *error* completion is OK, though we still will complain noisily about it\&.
.sp
The default value of
\fBdisk\-timeout\fR
is 0, which stands for an infinite timeout\&. Timeouts are specified in units of 0\&.1 seconds\&. This option is available since DRBD 8\&.3\&.12\&.
.RE
.PP
\fBdiscard\-zeroes\-if\-aligned \fR\fB{yes | no}\fR
.RS 4
.\" drbd.conf: discard-zeroes-if-aligned
There are several aspects to discard/trim/unmap support on linux block devices\&. Even if discard is supported in general, it may fail silently, or may partially ignore discard requests\&. Devices also announce whether reading from unmapped blocks returns defined data (usually zeroes), or undefined data (possibly old data, possibly garbage)\&.
.sp
If on different nodes, DRBD is backed by devices with differing discard characteristics, discards may lead to data divergence (old data or garbage left over on one backend, zeroes due to unmapped areas on the other backend)\&. Online verify would now potentially report tons of spurious differences\&. While probably harmless for most use cases (fstrim on a file system), DRBD cannot have that\&.
.sp
To play safe, we have to disable discard support, if our local backend (on a Primary) does not support "discard_zeroes_data=true"\&. We also have to translate discards to explicit zero\-out on the receiving side, unless the receiving side (Secondary) supports "discard_zeroes_data=true", thereby allocating areas what were supposed to be unmapped\&.
.sp
There are some devices (notably the LVM/DM thin provisioning) that are capable of discard, but announce discard_zeroes_data=false\&. In the case of DM\-thin, discards aligned to the chunk size will be unmapped, and reading from unmapped sectors will return zeroes\&. However, unaligned partial head or tail areas of discard requests will be silently ignored\&.
.sp
If we now add a helper to explicitly zero\-out these unaligned partial areas, while passing on the discard of the aligned full chunks, we effectively achieve discard_zeroes_data=true on such devices\&.
.sp
Setting
\fBdiscard\-zeroes\-if\-aligned\fR
to
\fByes\fR
will allow DRBD to use discards, and to announce discard_zeroes_data=true, even on backends that announce discard_zeroes_data=false\&.
.sp
Setting
\fBdiscard\-zeroes\-if\-aligned\fR
to
\fBno\fR
will cause DRBD to always fall\-back to zero\-out on the receiving side, and to not even announce discard capabilities on the Primary, if the respective backend announces discard_zeroes_data=false\&.
.sp
We used to ignore the discard_zeroes_data setting completely\&. To not break established and expected behaviour, and suddenly cause fstrim on thin\-provisioned LVs to run out\-of\-space instead of freeing up space, the default value is
\fByes\fR\&.
.sp
This option is available since 8\&.4\&.7\&.
.RE
.PP
\fBread\-balancing \fR\fB\fImethod\fR\fR
.RS 4
.\" drbd.conf: read-balancing
The supported
\fImethods\fR
for load balancing of read requests are
\fBprefer\-local\fR,
\fBprefer\-remote\fR,
\fBround\-robin\fR,
\fBleast\-pending\fR,
\fBwhen\-congested\-remote\fR,
\fB32K\-striping\fR,
\fB64K\-striping\fR,
\fB128K\-striping\fR,
\fB256K\-striping\fR,
\fB512K\-striping\fR
and
\fB1M\-striping\fR\&.
.sp
The default value of is
\fBprefer\-local\fR\&. This option is available since 8\&.4\&.1\&.
.RE
.PP
\fBrs\-discard\-granularity \fR\fB\fIbyte\fR\fR
.RS 4
.\" drbd.conf: rs-discard-granularity
When
\fBrs\-discard\-granularity\fR
is set to a non zero, positive value then DRBD tries to do a resync operation in requests of this size\&. In case such a block contains only zero bytes on the sync source node, the sync target node will issue a discard/trim/unmap command for the area\&.
.sp
The value is constrained by the discard granularity of the backing block device\&. In case
\fBrs\-discard\-granularity\fR
is not a multiplier of the discard granularity of the backing block device DRBD rounds it up\&. The feature only gets active if the backing block device reads back zeroes after a discard command\&.
.sp
The default value of is 0\&. This option is available since 8\&.4\&.7\&.
.RE
.PP
\fBsndbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
.\" drbd.conf: sndbuf-size\fIsize\fR
is the size of the TCP socket send buffer\&. The default value is 0, i\&.e\&. autotune\&. You can specify smaller or larger values\&. Larger values are appropriate for reasonable write throughput with protocol A over high latency networks\&. Values below 32K do not make sense\&. Since 8\&.0\&.13 resp\&. 8\&.2\&.7, setting the
\fIsize\fR
value to 0 means that the kernel should autotune this\&.
.RE
.PP
\fBrcvbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
.\" drbd.conf: rcvbuf-size\fIsize\fR
is the size of the TCP socket receive buffer\&. The default value is 0, i\&.e\&. autotune\&. You can specify smaller or larger values\&. Usually this should be left at its default\&. Setting the
\fIsize\fR
value to 0 means that the kernel should autotune this\&.
.RE
.PP
\fBtimeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: timeout
If the partner node fails to send an expected response packet within
\fItime\fR
tenths of a second, the partner node is considered dead and therefore the TCP/IP connection is abandoned\&. This must be lower than
\fIconnect\-int\fR
and
\fIping\-int\fR\&. The default value is 60 = 6 seconds, the unit 0\&.1 seconds\&.
.RE
.PP
\fBconnect\-int \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: connect-int
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 retries\&. The default value is 10 seconds, the unit is 1 second\&.
.RE
.PP
\fBping\-int \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: ping-int
If the TCP/IP connection linking a DRBD device pair is idle for more than
\fItime\fR
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\&.
.RE
.PP
\fBping\-timeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: ping-timeout
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 are tenths of a second\&.
.RE
.PP
\fBmax\-buffers \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: max-buffers
Limits the memory usage per DRBD minor device on the receiving side, or for internal buffers during resync or online\-verify\&. Unit is PAGE_SIZE, which is 4 KiB on most systems\&. The minimum possible setting is hard coded to 32 (=128 KiB)\&. These buffers are used to hold data blocks while they are written to/read from disk\&. To avoid possible distributed deadlocks on congestion, this setting is used as a throttle threshold rather than a hard limit\&. Once more than max\-buffers pages are in use, further allocation from this pool is throttled\&. You want to increase max\-buffers if you cannot saturate the IO backend on the receiving side\&.
.RE
.PP
\fBko\-count \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: ko-count
In case the secondary node fails to complete a single write request for
\fIcount\fR
times the
\fItimeout\fR, it is expelled from the cluster\&. (I\&.e\&. the primary node will kill and restart the connection\&.) To disable this feature, you should explicitly set it to 0; defaults may change between versions\&.
.RE
.PP
\fBmax\-epoch\-size \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: max-epoch-size
The highest number of data blocks between two write barriers\&. If you set this smaller than 10, you might decrease your performance\&.
.RE
.PP
\fBallow\-two\-primaries\fR
.RS 4
.\" drbd.conf: allow-two-primaries
With this option set you may assign the 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!
.RE
.PP
\fBunplug\-watermark \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: unplug-watermark
This setting has no effect with recent kernels that use explicit on\-stack plugging (upstream Linux kernel 2\&.6\&.39, distributions may have backported)\&.
.sp
When the number of pending write requests on the standby (secondary) node exceeds the
\fBunplug\-watermark\fR, 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, yet others don\'t feel much effect at all\&. Minimum 16, default 128, maximum 131072\&.
.RE
.PP
\fBcram\-hmac\-alg\fR
.RS 4
.\" drbd.conf: cram-hmac-alg
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
\fB/proc/crypto\fR\&.
.RE
.PP
\fBshared\-secret\fR
.RS 4
.\" drbd.conf: shared-secret
The shared secret used in peer authentication\&. May be up to 64 characters\&. Note that peer authentication is disabled as long as no
\fBcram\-hmac\-alg\fR
(see above) is specified\&.
.RE
.PP
\fBafter\-sb\-0pri \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: after-sb-0pri
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBdiscard\-younger\-primary\fR
.RS 4
Auto sync from the node that was primary before the split\-brain situation happened\&.
.RE
.PP
\fBdiscard\-older\-primary\fR
.RS 4
Auto sync from the node that became primary as second during the split\-brain situation\&.
.RE
.PP
\fBdiscard\-zero\-changes\fR
.RS 4
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\&.
.RE
.PP
\fBdiscard\-least\-changes\fR
.RS 4
Auto sync from the node that touched more blocks during the split brain situation\&.
.RE
.PP
\fBdiscard\-node\-NODENAME\fR
.RS 4
Auto sync to the named node\&.
.RE
.RE
.PP
\fBafter\-sb\-1pri \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: after-sb-1pri
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBconsensus\fR
.RS 4
Discard the version of the secondary if the outcome of the
\fBafter\-sb\-0pri\fR
algorithm would also destroy the current secondary\'s data\&. Otherwise disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm, even if that causes an erratic change of the primary\'s view of the data\&. This is only useful if you use a one\-node FS (i\&.e\&. not OCFS2 or GFS) with the
\fBallow\-two\-primaries\fR
flag,
\fIAND\fR
if you really know what you are doing\&. This is
\fIDANGEROUS and MAY CRASH YOUR MACHINE\fR
if you have an FS mounted on the primary node\&.
.RE
.PP
\fBdiscard\-secondary\fR
.RS 4
Discard the secondary\'s version\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the right data, it calls the "pri\-lost\-after\-sb" handler on the current primary\&.
.RE
.RE
.PP
\fBafter\-sb\-2pri \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: after-sb-2pri
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm, even if that causes an erratic change of the primary\'s view of the data\&. This is only useful if you use a one\-node FS (i\&.e\&. not OCFS2 or GFS) with the
\fBallow\-two\-primaries\fR
flag,
\fIAND\fR
if you really know what you are doing\&. This is
\fIDANGEROUS and MAY CRASH YOUR MACHINE\fR
if you have an FS mounted on the primary node\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
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\&.
.RE
.RE
.PP
\fBalways\-asbp\fR
.RS 4
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\&.
.sp
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\&.)
.RE
.PP
\fBrr\-conflict \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: rr-conflict
This option helps to solve the cases when the outcome of the resync decision is incompatible with the current role assignment in the cluster\&.
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\fR
.RS 4
Sync to the primary node is allowed, violating the assumption that data on a block device are stable for one of the nodes\&.
\fIDangerous, do not use\&.\fR
.RE
.PP
\fBcall\-pri\-lost\fR
.RS 4
Call the
\fBpri\-lost\-after\-sb\fR
helper program on one of the machines unless that machine can demote to secondary\&. The helper program is expected to reboot the machine, which brings the node into a secondary role\&. Which machine runs the helper program is determined by the
\fBafter\-sb\-0pri\fR
strategy\&.
.RE
.RE
.PP
\fBdata\-integrity\-alg \fR \fIalg\fR
.RS 4
.\" drbd.conf: data-integrity-alg
DRBD can ensure the data integrity of the user\'s data on the network by comparing hash values\&. Normally this is ensured by the 16 bit checksums in the headers of TCP/IP packets\&.
.sp
This option can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled\&.
.sp
See also the notes on data integrity\&.
.RE
.PP
\fBtcp\-cork\fR
.RS 4
.\" drbd.conf: tcp-cork
DRBD usually uses the TCP socket option TCP_CORK to hint to the network stack when it can expect more data, and when it should flush out what it has in its send queue\&. It turned out that there is at least one network stack that performs worse when one uses this hinting method\&. Therefore we introducted this option\&. By setting
\fBtcp\-cork\fR
to
\fBno\fR
you can disable the setting and clearing of the TCP_CORK socket option by DRBD\&.
.RE
.PP
\fBon\-congestion \fR\fB\fIcongestion_policy\fR\fR,
.br
\fBcongestion\-fill \fR\fB\fIfill_threshold\fR\fR,
.br
\fBcongestion\-extents \fR\fB\fIactive_extents_threshold\fR\fR
.RS 4
By default DRBD blocks when the available TCP send queue becomes full\&. That means it will slow down the application that generates the write requests that cause DRBD to send more data down that TCP connection\&.
.sp
When DRBD is deployed with DRBD\-proxy it might be more desirable that DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full\&. In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps the connection open\&.
.sp
The advantage of the AHEAD/BEHIND mode is that the application is not slowed down, even if DRBD\-proxy\'s buffer is not sufficient to buffer all write requests\&. The downside is that the peer node falls behind, and that a resync will be necessary to bring it back into sync\&. During that resync the peer node will have an inconsistent disk\&.
.sp
Available
\fIcongestion_policy\fRs are
\fBblock\fR
and
\fBpull\-ahead\fR\&. The default is
\fBblock\fR\&.
\fIFill_threshold\fR
might be in the range of 0 to 10GiBytes\&. The default is 0 which disables the check\&.
\fIActive_extents_threshold\fR
has the same limits as
\fBal\-extents\fR\&.
.sp
The AHEAD/BEHIND mode and its settings are available since DRBD 8\&.3\&.10\&.
.RE
.PP
\fBwfc\-timeout \fR\fB\fItime\fR\fR
.RS 4
Wait for connection timeout\&.
.\" drbd.conf: wfc-timeout
The init script
\fBdrbd\fR(8)
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\&.
.RE
.PP
\fBdegr\-wfc\-timeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: degr-wfc-timeout
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\&. Value 0 means unlimited\&.
.RE
.PP
\fBoutdated\-wfc\-timeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: outdated-wfc-timeout
Wait for connection timeout, if the peer was outdated\&. In case a degraded cluster (= cluster with only one node left) with an outdated peer disk is rebooted, this timeout value is used instead of wfc\-timeout, because the peer is not allowed to become primary in the meantime\&. Value 0 means unlimited\&.
.RE
.PP
\fBwait\-after\-sb\fR
.RS 4
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\&.
.RE
.PP
\fBbecome\-primary\-on \fR\fB\fInode\-name\fR\fR
.RS 4
Sets on which node the device should be promoted to primary role by the init script\&. The
\fInode\-name\fR
might either be a host name or the keyword
\fBboth\fR\&. 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)\&.
.RE
.PP
\fBstacked\-timeouts\fR
.RS 4
Usually
\fBwfc\-timeout\fR
and
\fBdegr\-wfc\-timeout\fR
are ignored for stacked devices, instead twice the amount of
\fBconnect\-int\fR
is used for the connection timeouts\&. With the
\fBstacked\-timeouts\fR
keyword you disable this, and force DRBD to mind the
\fBwfc\-timeout\fR
and
\fBdegr\-wfc\-timeout\fR
statements\&. Only do that if the peer of the stacked resource is usually not available or will usually not become primary\&. By using this option incorrectly, you run the risk of causing unexpected split brain\&.
.RE
.PP
\fBresync\-rate \fR\fB\fIrate\fR\fR
.RS 4
.\" drbd.conf: resync-rate
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\&.
.RE
.PP
\fBuse\-rle\fR
.RS 4
.\" drbd.conf: use-rle
During resync\-handshake, the dirty\-bitmaps of the nodes are exchanged and merged (using bit\-or), so the nodes will have the same understanding of which blocks are dirty\&. On large devices, the fine grained dirty\-bitmap can become large as well, and the bitmap exchange can take quite some time on low\-bandwidth links\&.
.sp
Because the bitmap typically contains compact areas where all bits are unset (clean) or set (dirty), a simple run\-length encoding scheme can considerably reduce the network traffic necessary for the bitmap exchange\&.
.sp
For backward compatibilty reasons, and because on fast links this possibly does not improve transfer time but consumes cpu cycles, this defaults to off\&.
.RE
.PP
\fBsocket\-check\-timeout \fR\fB\fIvalue\fR\fR
.RS 4
.\" drbd.conf: socket-check-timeout
In setups involving a DRBD\-proxy and connections that experience a lot of buffer\-bloat it might be necessary to set
\fBping\-timeout\fR
to an unusual high value\&. By default DRBD uses the same value to wait if a newly established TCP\-connection is stable\&. Since the DRBD\-proxy is usually located in the same data center such a long wait time may hinder DRBD\'s connect process\&.
.sp
In such setups
\fBsocket\-check\-timeout\fR
should be set to at least to the round trip time between DRBD and DRBD\-proxy\&. I\&.e\&. in most cases to 1\&.
.sp
The default unit is tenths of a second, the default value is 0 (which causes DRBD to use the value of
\fBping\-timeout\fR
instead)\&. Introduced in 8\&.4\&.5\&.
.RE
.PP
\fBresync\-after \fR\fB\fIres\-name\fR\fR
.RS 4
.\" drbd.conf: resync-after
By default, resynchronization of all devices would run in parallel\&. By defining a resync\-after dependency, the resynchronization of this resource will start only if the resource
\fIres\-name\fR
is already in connected state (i\&.e\&., has finished its resynchronization)\&.
.RE
.PP
\fBal\-extents \fR\fB\fIextents\fR\fR
.RS 4
.\" drbd.conf: al-extents
DRBD automatically performs hot area detection\&. With this 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
\fIextents\fR
is 1237\&. (Minimum: 7, Maximum: 65534)
.sp
Note that the effective maximum may be smaller, depending on how you created the device meta data, see also
\fBdrbdmeta\fR(8)\&. The effective maximum is 919 * (available on\-disk activity\-log ring\-buffer area/4kB \-1), the default 32kB ring\-buffer effects a maximum of 6433 (covers more than 25 GiB of data)\&. We recommend to keep this well within the amount your backend storage and replication link are able to resync inside of about 5 minutes\&.
.RE
.PP
\fBal\-updates \fR\fB{yes | no}\fR
.RS 4
.\" drbd.conf: al-updates
DRBD\'s activity log transaction writing makes it possible, that after the crash of a primary node a partial (bit\-map based) resync is sufficient to bring the node back to up\-to\-date\&. Setting
\fBal\-updates\fR
to
\fBno\fR
might increase normal operation performance but causes DRBD to do a full resync when a crashed primary gets reconnected\&. The default value is
\fByes\fR\&.
.RE
.PP
\fBverify\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
During online verification (as initiated by the
\fBverify\fR
sub\-command), rather than doing a bit\-wise comparison, DRBD applies a hash function to the contents of every block being verified, and compares that hash with the peer\&. This option defines the hash algorithm being used for that purpose\&. It can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled; you must set this option explicitly in order to be able to use on\-line device verification\&.
.sp
See also the notes on data integrity\&.
.RE
.PP
\fBcsums\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
A resync process sends all marked data blocks from the source to the destination node, as long as no
\fBcsums\-alg\fR
is given\&. When one is specified the resync process exchanges hash values of all marked blocks first, and sends only those data blocks that have different hash values\&.
.sp
This setting is useful for DRBD setups with low bandwidth links\&. During the restart of a crashed primary node, all blocks covered by the activity log are marked for resync\&. But a large part of those will actually be still in sync, therefore using
\fBcsums\-alg\fR
will lower the required bandwidth in exchange for CPU cycles\&.
.RE
.PP
\fBc\-plan\-ahead \fR\fB\fIplan_time\fR\fR,
.br
\fBc\-fill\-target \fR\fB\fIfill_target\fR\fR,
.br
\fBc\-delay\-target \fR\fB\fIdelay_target\fR\fR,
.br
\fBc\-max\-rate \fR\fB\fImax_rate\fR\fR
.RS 4
The dynamic resync speed controller gets enabled with setting
\fIplan_time\fR
to a positive value\&. It aims to fill the buffers along the data path with either a constant amount of data
\fIfill_target\fR, or aims to have a constant delay time of
\fIdelay_target\fR
along the path\&. The controller has an upper bound of
\fImax_rate\fR\&.
.sp
By
\fIplan_time\fR
the agility of the controller is configured\&. Higher values yield for slower/lower responses of the controller to deviation from the target value\&. It should be at least 5 times RTT\&. For regular data paths a
\fIfill_target\fR
in the area of 4k to 100k is appropriate\&. For a setup that contains drbd\-proxy it is advisable to use
\fIdelay_target\fR
instead\&. Only when
\fIfill_target\fR
is set to 0 the controller will use
\fIdelay_target\fR\&. 5 times RTT is a reasonable starting value\&.
\fIMax_rate\fR
should be set to the bandwidth available between the DRBD\-hosts and the machines hosting DRBD\-proxy, or to the available disk\-bandwidth\&.
.sp
The default value of
\fIplan_time\fR
is 0, the default unit is 0\&.1 seconds\&.
\fIFill_target\fR
has 0 and sectors as default unit\&.
\fIDelay_target\fR
has 1 (100ms) and 0\&.1 as default unit\&.
\fIMax_rate\fR
has 10240 (100MiB/s) and KiB/s as default unit\&.
.sp
The dynamic resync speed controller and its settings are available since DRBD 8\&.3\&.9\&.
.RE
.PP
\fBc\-min\-rate \fR\fB\fImin_rate\fR\fR
.RS 4
A node that is primary and sync\-source has to schedule application IO requests and resync IO requests\&. The
\fImin_rate\fR
tells DRBD use only up to min_rate for resync IO and to dedicate all other available IO bandwidth to application requests\&.
.sp
Note: The value 0 has a special meaning\&. It disables the limitation of resync IO completely, which might slow down application IO considerably\&. Set it to a value of 1, if you prefer that resync IO never slows down application IO\&.
.sp
Note: Although the name might suggest that it is a lower bound for the dynamic resync speed controller, it is not\&. If the DRBD\-proxy buffer is full, the dynamic resync speed controller is free to lower the resync speed down to 0, completely independent of the
\fBc\-min\-rate\fR
setting\&.
.sp
\fIMin_rate\fR
has 4096 (4MiB/s) and KiB/s as default unit\&.
.RE
.PP
\fBon\-no\-data\-accessible \fR\fB\fIond\-policy\fR\fR
.RS 4
This setting controls what happens to IO requests on a degraded, disk less node (I\&.e\&. no data store is reachable)\&. The available policies are
\fBio\-error\fR
and
\fBsuspend\-io\fR\&.
.sp
If
\fIond\-policy\fR
is set to
\fBsuspend\-io\fR
you can either resume IO by attaching/connecting the last lost data storage, or by the
\fBdrbdadm resume\-io \fR\fB\fIres\fR\fR
command\&. The latter will result in IO errors of course\&.
.sp
The default is
\fBio\-error\fR\&. This setting is available since DRBD 8\&.3\&.9\&.
.RE
.PP
\fBcpu\-mask \fR\fB\fIcpu\-mask\fR\fR
.RS 4
.\" drbd.conf: cpu-mask
Sets the cpu\-affinity\-mask for DRBD\'s kernel threads of this device\&. The default value of
\fIcpu\-mask\fR
is 0, which means that DRBD\'s kernel threads should be spread over all CPUs of the machine\&. This value must be given in hexadecimal notation\&. If it is too big it will be truncated\&.
.RE
.PP
\fBpri\-on\-incon\-degr \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-on-incon-degr
This handler is called if the node is primary, degraded and if the local copy of the data is inconsistent\&.
.RE
.PP
\fBpri\-lost\-after\-sb \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-lost-after-sb
The node is currently primary, but lost the after\-split\-brain auto recovery procedure\&. As as consequence, it should be abandoned\&.
.RE
.PP
\fBpri\-lost \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-lost
The node is currently primary, but DRBD\'s algorithm thinks that it should become sync target\&. As a consequence it should give up its primary role\&.
.RE
.PP
\fBfence\-peer \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: fence-peer
The handler is part of the
\fBfencing\fR
mechanism\&. This handler is called in case the node needs to fence the peer\'s disk\&. It should use other communication paths than DRBD\'s network link\&.
.RE
.PP
\fBlocal\-io\-error \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: local-io-error
DRBD got an IO error from the local IO subsystem\&.
.RE
.PP
\fBinitial\-split\-brain \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: initial-split-brain
DRBD has connected and detected a split brain situation\&. This handler can alert someone in all cases of split brain, not just those that go unresolved\&.
.RE
.PP
\fBsplit\-brain \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: split-brain
DRBD detected a split brain situation but remains unresolved\&. Manual recovery is necessary\&. This handler should alert someone on duty\&.
.RE
.PP
\fBbefore\-resync\-target \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: before-resync-target
DRBD calls this handler just before a resync begins on the node that becomes resync target\&. It might be used to take a snapshot of the backing block device\&.
.RE
.PP
\fBafter\-resync\-target \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: after-resync-target
DRBD calls this handler just after a resync operation finished on the node whose disk just became consistent after being inconsistent for the duration of the resync\&. It might be used to remove a snapshot of the backing device that was created by the
\fBbefore\-resync\-target\fR
handler\&.
.RE
.SS "Other Keywords"
.PP
\fBinclude \fR\fB\fIfile\-pattern\fR\fR
.RS 4
.\" drbd.conf: include
Include all files matching the wildcard pattern
\fIfile\-pattern\fR\&. The
\fBinclude\fR
statement is only allowed on the top level, i\&.e\&. it is not allowed inside any section\&.
.RE
.SH "NOTES ON DATA INTEGRITY"
.PP
There are two independent methods in DRBD to ensure the integrity of the mirrored data\&. The online\-verify mechanism and the
\fBdata\-integrity\-alg\fR
of the
\fBnetwork\fR
section\&.
.PP
Both mechanisms might deliver false positives if the user of DRBD modifies the data which gets written to disk while the transfer goes on\&. This may happen for swap, or for certain append while global sync, or truncate/rewrite workloads, and not necessarily poses a problem for the integrity of the data\&. Usually when the initiator of the data transfer does this, it already knows that that data block will not be part of an on disk data structure, or will be resubmitted with correct data soon enough\&.
.PP
The
\fBdata\-integrity\-alg\fR
causes the receiving side to log an error about "Digest integrity check FAILED: Ns +x\en", where N is the sector offset, and x is the size of the request in bytes\&. It will then disconnect, and reconnect, thus causing a quick resync\&. If the sending side at the same time detected a modification, it warns about "Digest mismatch, buffer modified by upper layers during write: Ns +x\en", which shows that this was a false positive\&. The sending side may detect these buffer modifications immediately after the unmodified data has been copied to the tcp buffers, in which case the receiving side won\'t notice it\&.
.PP
The most recent (2007) example of systematic corruption was an issue with the TCP offloading engine and the driver of a certain type of GBit NIC\&. The actual corruption happened on the DMA transfer from core memory to the card\&. Since the TCP checksum gets calculated on the card, this type of corruption stays undetected as long as you do not use either the online
\fBverify\fR
or the
\fBdata\-integrity\-alg\fR\&.
.PP
We suggest to use the
\fBdata\-integrity\-alg\fR
only during a pre\-production phase due to its CPU costs\&. Further we suggest to do online
\fBverify\fR
runs regularly e\&.g\&. once a month during a low load period\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.4\&.0 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8),
\fBdrbdmeta\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fBDRBD web site\fR\m[]\&\s-2\u[3]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD User's Guide
.RS 4
\%http://www.drbd.org/users-guide/
.RE
.IP " 2." 4
DRBD's online usage counter
.RS 4
\%http://usage.drbd.org
.RE
.IP " 3." 4
DRBD web site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v84/xml-usage-to-docbook.xsl 0000644 0001750 0001750 00000003234 12466702073 023476 0 ustar apoikos apoikos
drbdsetup--val----
drbd-utils-8.9.6/documentation/v83/ 0000755 0001750 0001750 00000000000 12654475367 017017 5 ustar apoikos apoikos drbd-utils-8.9.6/documentation/v83/drbdmeta.8 0000644 0001750 0001750 00000012452 12654452465 020670 0 ustar apoikos apoikos '\" t
.\" Title: drbdmeta
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 15 Oct 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBDMETA" "8" "15 Oct 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdmeta \- DRBD\'s meta data management tool .\" drbdmeta
.SH "SYNOPSIS"
.HP \w'\fBdrbdmeta\fR\ 'u
\fBdrbdmeta\fR [\-\-force] [\-\-ignore\-sanity\-checks] {\fIdevice\fR} {v06\ \fIminor\fR | v07\ \fImeta_dev\ index\fR | v08\ \fImeta_dev\ index\fR} {\fIcommand\fR} [\fIcmd\ args\fR...]
.SH "DESCRIPTION"
.PP
Drbdmeta is used to create, display and modify the contents of DRBD\'s meta data storage\&. Usually you do not want to use this command directly, but start it via the frontend
\fBdrbdadm\fR(8)\&.
.PP
This command only works if the DRBD resource is currently down, or at least detached from its backing storage\&. The first parameter is the device node associated to the resource\&. With the second parameter you can select the version of the meta data\&. Currently all major DRBD releases (0\&.6, 0\&.7 and 8) are supported\&.
.SH "OPTIONS"
.PP
\-\-force
.RS 4
.\" drbdmeta: --force
All questions that get asked by drbdmeta are treated as if the user answered \'yes\'\&.
.RE
.PP
\-\-ignore\-sanity\-checks
.RS 4
.\" drbdmeta: --ignore-sanity-checks
Some sanity checks cause drbdmeta to terminate\&. E\&.g\&. if a file system image would get destroyed by creating the meta data\&. By using that option you can force drbdmeta to ignore these checks\&.
.RE
.SH "COMMANDS"
.PP
create\-md \fB\-\-peer\-max\-bio\-size \fR\fB\fIval\fR\fR
.RS 4
.\" drbdmeta: create-md
Create\-md initializes the meta data storage\&. This needs to be done before a DRBD resource can be taken online for the first time\&. In case there is already a meta data signature of an older format in place, drbdmeta will ask you if it should convert the older format to the selected format\&.
.sp
If you will use the resource before it is connected to its peer for the first time DRBD may perform better if you use the
\fB\-\-peer\-max\-bio\-size\fR
option\&. For DRBD versions of the peer use up to these values: <8\&.3\&.7 \-> 4k, 8\&.3\&.8 \-> 32k, 8\&.3\&.9 \-> 128k, 8\&.4\&.0 \-> 1M\&.
.RE
.PP
get\-gi
.RS 4
.\" drbdmeta: get-gi
Get\-gi shows a short textual representation of the data generation identifier\&. In version 0\&.6 and 0\&.7 these are generation counters, while in version 8 it is a set of UUIDs\&.
.RE
.PP
show\-gi
.RS 4
.\" drbdmeta: show-gi
Show\-gi prints a textual representation of the data generation identifiers including explanatory information\&.
.RE
.PP
dump\-md
.RS 4
.\" drbdmeta: dump-md
Dumps the whole contents of the meta data storage including the stored bit\-map and activity\-log in a textual representation\&.
.RE
.PP
outdate
.RS 4
.\" drbdmeta: outdate
Sets the outdated flag in the meta data\&. This is used by the peer node when it wants to become primary, but cannot communicate with the DRBD stack on this host\&.
.RE
.PP
dstate
.RS 4
.\" drbdmeta: dstate
Prints the state of the data on the backing storage\&. The output is always followed by \'/DUnknown\' since drbdmeta only looks at the local meta data\&.
.RE
.PP
check\-resize
.RS 4
.\" drbdmeta: check-resize
Examines the device size of a backing device, and it\'s last known device size, recorded in a file /var/lib/drbd/drbd\-minor\-??\&.lkbd\&. In case the size of the backing device changed, and the meta data can be found at the old position, it moves the meta data to the right position at the end of the block device\&.
.RE
.SH "EXPERT'S COMMANDS"
.PP
Drbdmeta allows you to modify the meta data as well\&. This is intentionally omitted for the command\'s usage output, since you should only use it if you really know what you are doing\&. By setting the generation identifiers to wrong values, you risk to overwrite your up\-to\-data data with an older version of your data\&.
.PP
set\-gi \fIgi\fR
.RS 4
.\" drbdmeta: set-gi
Set\-gi allows you to set the generation identifier\&.
\fIGi\fR
needs to be a generation counter for the 0\&.6 and 0\&.7 format, and a UUID set for 8\&.x\&. Specify it in the same way as get\-gi shows it\&.
.RE
.PP
restore\-md \fIdump_file\fR
.RS 4
.\" drbdmeta: restore-md
Reads the
\fIdump_file\fR
and writes it to the meta data\&.
.RE
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbdadm\fR(8)
drbd-utils-8.9.6/documentation/v83/drbdsetup.xml 0000644 0001750 0001750 00000243647 12504755522 021541 0 ustar apoikos apoikos
5 Dec 2008DRBD8.3.2drbdsetup8System AdministrationdrbdsetupSetup tool for DRBD
drbdsetupdrbdsetupdevicedisklower_devmeta_data_devmeta_data_index-dsize-eerr_handler-ffencing_policy-b-tdisk_timeoutdrbdsetupdevicenetaf:local_addr:portaf:remote_addr:portprotocol-ctime-itime-tval-Ssize-rsize-kcount-emax_epoch_size-bmax_buffers-m-ahash_alg-xshared_secret-Aasb-0p-policy-Basb-1p-policy-Casb-2p-policy-D-Rrole-resync-conflict-policy-pping_timeout-uval-dhash_alg-o-n-gcongestion_policy-fval-hvaldrbdsetupdevicesyncer-adev_minor-rrate-eextents-vverify-hash-alg-ccpu-mask-Ccsums-hash-alg-R-pplan_time-sfill_target-ddelay_target-mmax_rate-nond-policydrbdsetupdevicedisconnectdrbdsetupdevicedetach-fdrbdsetupdevicedowndrbdsetupdeviceprimary-f-odrbdsetupdevicesecondarydrbdsetupdeviceverify-sstart-position-Sstop-positiondrbdsetupdeviceinvalidatedrbdsetupdeviceinvalidate-remotedrbdsetupdevicewait-connect-twfc_timeout-ddegr_wfc_timeout-ooutdated_wfc_timeout-wdrbdsetupdevicewait-sync-twfc_timeout-ddegr_wfc_timeout-ooutdated_wfc_timeout-wdrbdsetupdeviceroledrbdsetupdevicecstatedrbdsetupdevicedstatedrbdsetupdevicestatusdrbdsetupdeviceresize-dsize-fassume-peer-has-space-cassume-cleandrbdsetupdevicecheck-resizedrbdsetupdevicepause-syncdrbdsetupdeviceresume-syncdrbdsetupdeviceoutdatedrbdsetupdeviceshow-gidrbdsetupdeviceget-gidrbdsetupdeviceshowdrbdsetupdevicesuspend-iodrbdsetupdeviceresume-iodrbdsetupdeviceevents-u-adrbdsetupdevicenew-current-uuid-cDescription drbdsetup is used to associate DRBD devices with their backing
block devices, to set up DRBD device pairs to mirror their
backing block devices, and to inspect the configuration of
running DRBD devices.
Note drbdsetup is a low level tool of the DRBD program suite. It is
used by the data disk and drbd scripts to communicate with
the device driver.
Commands Each drbdsetup sub-command might require arguments and bring its own
set of options. All values have default units which might be overruled
by K, M or G. These units are defined in the usual way (e.g. K = 2^10 = 1024).
Common options All drbdsetup sub-commands accept these two options
In case the specified DRBD device (minor number) does not
exist yet, create it implicitly.
When is given on the
command line, all options of the invoked sub-command that
are not explicitly set are reset to their default values.
diskdrbdsetupdisk Associates device with
lower_device to store its data blocks on.
The (or ) should
only be used if you wish not to use as much as possible from the
backing block devices.
If you do not use , the device
is only ready for use as soon as it was connected to its peer once.
(See the command.)
,
You can override DRBD's size determination method with this
option. If you need to use the device before it was ever
connected to its peer, use this option to pass the
size of the DRBD device to the
driver. Default unit is sectors (1s = 512 bytes).
If you use the size parameter in drbd.conf,
we strongly recommend to add an explicit unit postfix.
drbdadm and drbdsetup used to have mismatching default units.
,
If the driver of the lower_device
reports an error to DRBD, DRBD will mark the disk as inconsistent,
call a helper
program, or detach the device from its backing storage and
perform all further IO by requesting it from the peer. The
valid err_handlers are:
,
and .
,
Under we understand preventive
measures to avoid situations where both nodes are primary
and disconnected (AKA split brain).
Valid fencing policies are:
This is the default policy. No fencing actions are done.
If a node becomes a disconnected primary, it tries to outdate
the peer's disk. This is done by calling the fence-peer
handler. The handler is supposed to reach the other node over
alternative communication paths and call 'drbdadm outdate
res' there.
If a node becomes a disconnected primary, it freezes all
its IO operations and calls its fence-peer handler. The
fence-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 command.
,
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 larger than 4 KiB. (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) 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 option, 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 exactly of the same type.
USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING., , , DRBD has four implementations to express write-after-write dependencies to
its backing storage device. DRBD will use the first method that is
supported by the backing storage device and that is not disabled by the user.
When selecting the method you should not only base your decision on the
measurable performance. In case your backing storage device has a volatile
write cache (plain disks, RAID of plain disks) you should use one
of the first two. In case your backing storage device has battery-backed
write cache you may go with option 3.
Option 4 (disable everything, use "none") is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .
Unfortunately device mapper (LVM) might not support barriers.
The letter after "wo:" in /proc/drbd indicates with method is currently in
use for a device: b, f, d, n. The implementations:
barrier The first requires that the driver of the
backing storage device support barriers (called 'tagged command queuing' in
SCSI and 'native command queuing' in SATA speak). The use of this
method can be disabled by the option.
Note: Since Linux-2.6.36 (or RHEL's 2.6.32) this method is disabled.
flush The second requires that the backing device support disk flushes (called
'force unit access' in the drive vendors speak). The use of this method
can be disabled using the option.
drain The third method is simply to let write requests drain before
write requests of a new reordering domain are issued. That was the
only implementation before 8.0.9.
none The fourth method is to not express write-after-write dependencies to
the backing store at all, by also specifying .
This is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .
,
Disables the use of disk flushes and barrier BIOs when
accessing the meta data device. See the notes
on .
,
In some special circumstances the device mapper stack manages to
pass BIOs to DRBD that violate the constraints that are set forth
by DRBD's merge_bvec() function and which have more than one bvec.
A known example is:
phys-disk -> DRBD -> LVM -> Xen -> missaligned partition (63) -> DomU FS.
Then you might see "bio would need to, but cannot, be split:" in
the Dom0's kernel log. The best workaround is to proper align the partition within
the VM (E.g. start it at sector 1024). That costs 480 KiB of storage.
Unfortunately the default of most Linux partitioning tools is
to start the first partition at an odd number (63). Therefore
most distributions install helpers for virtual linux machines will
end up with missaligned partitions.
The second best workaround is to limit DRBD's max bvecs per BIO
(i.e., the option) to 1, but that might cost performance. The default value of is 0, which means that
there is no user imposed limitation.
,
If the driver of the lower_device
does not finish an IO request within disk_timeout,
DRBD considers the disk as failed. If DRBD is connected to a remote host,
it will reissue local pending IO requests to the peer, and ship all new
IO requests to the peer only. The disk state advances to diskless, as soon
as the backing block device has finished all IO requests. The default value of is 0, which means that no timeout is enforced.
The default unit is 100ms. This option is available since 8.3.12.
netdrbdsetupnet Sets up the device to listen on
af:local_addr:port for incoming connections
and to try to connect to af:remote_addr:port.
If port is omitted, 7788 is used as default.
If af is omitted gets
used. Other supported address families are ,
for Dolphin Interconnect Solutions' "super sockets"
and for Sockets Direct Protocol (Infiniband).
On the TCP/IP link the specified protocol
is used. Valid protocol specifiers are A, B, and C.Protocol A: write IO is reported as completed, if it has reached
local disk and local TCP send buffer.Protocol B: write IO is reported as completed, if it has reached
local disk and remote buffer cache.Protocol C: write IO is reported as completed, if it has
reached both local and remote disk.,
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 retries. The
default value is 10 seconds, the unit is 1 second.
,
If the TCP/IP connection linking a DRBD device pair is idle
for more than time seconds, DRBD
will generate a keep-alive packet to check if its partner is
still alive. The default value is 10 seconds, the unit is 1 second.
,
If the partner node fails to send an expected response packet
within val
tenths of a second, the partner node
is considered dead and therefore the TCP/IP connection is
abandoned. The default value is 60 (= 6 seconds).
,
The socket send buffer is used to store packets sent to the
secondary node, which are not yet acknowledged (from a network
point of view) by the secondary node. When using protocol A,
it might be necessary to increase the size of this data
structure in order to increase asynchronicity between primary
and secondary nodes. But keep in mind that more asynchronicity
is synonymous with more data loss in the case of a primary
node failure. Since 8.0.13 resp. 8.2.7 setting the size
value to 0 means that the kernel should autotune this.
The default size is
0, i.e. autotune.
,
Packets received from the network are stored in the socket receive
buffer first. From there they are consumed by DRBD. Before 8.3.2 the
receive buffer's size was always set to the size of the socket
send buffer. Since 8.3.2 they can be tuned independently.
A value of 0 means that the kernel should autotune this.
The default size is
0, i.e. autotune.
,
In case the secondary node fails to complete a single write
request for count times the
timeout, it is expelled from the
cluster, i.e. the primary node goes into StandAlone mode.
To disable this feature, you should explicitly set it to 0; defaults may change between versions.
, With this option the maximal number of write requests between
two barriers is limited. Typically set to the same as
, or the allowed maximum.
Values smaller than 10 can lead to degraded performance.
The default value is 2048.
,
With this option the maximal number of buffer pages allocated
by DRBD's receiver thread is limited. Typically set to the
same as . Small values
could lead to degraded performance. The default value is 2048, the minimum 32.
Increase this if you cannot saturate the IO backend of the receiving side
during linear write or during resync while otherwise idle.
See also drbd.conf5,
This setting has no effect with recent kernels that use explicit on-stack
plugging (upstream Linux kernel 2.6.39, distributions may have backported).
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, yet others don't feel much effect at all.
Minimum 16, default 128, maximum 131072.
,
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!
,
alg 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.
,
secret The shared secret used in peer authentication. May be up to
64 characters.
,
asb-0p-policy possible policies are:
No automatic resynchronization, simply disconnect.
Auto sync from the node that was primary before the split-brain situation occurred.
Auto sync from the node that became primary as second during
the split-brain situation.
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.
Auto sync from the node that touched more blocks during the
split brain situation.
Auto sync to the named node.
,
asb-1p-policy possible policies are:
No automatic resynchronization, simply disconnect.
Discard the version of the secondary if the outcome
of the algorithm would also
destroy the current secondary's data. Otherwise disconnect.
Discard the secondary's version.
Always honor the outcome of the algorithm. In case it decides the current
secondary has the correct data, call the
on the current primary.
Always honor the outcome of the algorithm. In case it decides the current
secondary has the correct data, accept a possible instantaneous
change of the primary's data.
,
asb-2p-policy possible policies are:
No automatic resynchronization, simply disconnect.
Always honor the outcome of the algorithm. In case it decides the current
secondary has the right data, call the
on the current primary.
Always honor the outcome of the algorithm. In case it decides the current
secondary has the right data, accept a possible instantaneous
change of the primary's data.
,
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.
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 have led to strange UUID sets.)
,
role-resync-conflict-policy This option sets DRBD's behavior when DRBD deduces from its
meta data that a resynchronization is needed, and the SyncTarget
node is already primary. The possible settings are:
,
and
. While
speaks for itself, with the
setting the handler is called
which is expected to either change the role of the node to
secondary, or remove the node from the cluster.
The default is . With the setting you allow DRBD
to force a primary node into SyncTarget state. This means
that the data exposed by DRBD changes to
the SyncSource's version of the data instantaneously.
USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.
,
hash_alg DRBD can ensure the data integrity of the user's data on the network
by comparing hash values. Normally this is ensured by the 16 bit checksums
in the headers of TCP/IP packets. This option
can be set to any of the kernel's data digest algorithms.
In a typical kernel configuration you should have
at least one of , , and
available. By default this is not enabled.
See also the notes on data integrity on the drbd.conf manpage.,
DRBD usually uses the TCP socket option TCP_CORK to hint to the network
stack when it can expect more data, and when it should flush out what it
has in its send queue. There is at least one network
stack that performs worse when one uses this hinting method. Therefore
we introduced this option, which disable the setting and clearing of
the TCP_CORK socket option by DRBD.
,
ping_timeout The time the peer has to answer to a keep-alive packet. In case the peer's reply is not received within this
time period, it is considered dead. The default unit is tenths of a second,
the default value is 5 (for half a second).
,
Use this option to manually recover from a split-brain
situation. In case you do not have any automatic after-split-brain policies selected, the nodes refuse to
connect. By passing this option you make this node a
sync target immediately after successful connect.
,
Causes DRBD to abort the connection process after the resync
handshake, i.e. no resync gets performed. You can find out which resync
DRBD would perform by looking at the kernel's log file.
, congestion_policy, fill_threshold, active_extents_thresholdBy default DRBD blocks when the available TCP send queue becomes full.
That means it will slow down the application that generates the write
requests that cause DRBD to send more data down that TCP connection.
When DRBD is deployed with DRBD-proxy it might be more desirable that
DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full.
In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps
the connection open.The advantage of the AHEAD/BEHIND mode is that the
application is not slowed down, even if DRBD-proxy's buffer is
not sufficient to buffer all write requests. The downside is that
the peer node falls behind, and that a resync will be necessary to
bring it back into sync. During that resync the peer node will have
an inconsistent disk. Available congestion_policys are
and . The default is .
Fill_threshold might be in the range of 0 to 10GiBytes. The
default is 0 which disables the check. Active_extents_threshold
has the same limits as .The AHEAD/BEHIND mode and its settings are available since DRBD 8.3.10.syncerdrbdsetupsyncer Changes the synchronization daemon parameters of
device at runtime.
,
To ensure smooth operation of the application on top of DRBD,
it is possible to limit the bandwidth that may be used by
background synchronization. The default is 250 KiB/sec, the
default unit is KiB/sec.
,
Start resync on this device only if the device with
minor is already in connected
state. Otherwise this device waits in SyncPause state.
,
DRBD automatically performs hot area detection. With this
parameter you control how big the hot area (=active set) can
get. Each extent marks 4M of the backing storage. 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 extents is
127. (Minimum: 7, Maximum: 3843)
,
During online verification (as initiated by the
verify sub-command),
rather than doing a bit-wise comparison, DRBD applies a hash function
to the contents of every block being verified, and compares that
hash with the peer. This option defines the hash algorithm being
used for that purpose. It can be set to any of the kernel's data
digest algorithms. In a typical kernel configuration you should have
at least one of , , and
available. By default this is not enabled; you must set this
option explicitly in order to be able to use on-line device verification.
See also the notes on data integrity on the drbd.conf manpage.,
Sets the cpu-affinity-mask for DRBD's kernel threads of this
device. The default value of cpu-mask is
0, which means that DRBD's kernel threads should be spread over
all CPUs of the machine. This value must be given in hexadecimal
notation. If it is too big it will be truncated.
,
A resync process sends all marked data blocks form the source to
the destination node, as long as no is
given. When one is specified the resync process exchanges hash values of all
marked blocks first, and sends only those data blocks over, that have different
hash values.This setting is useful for DRBD setups with low bandwidth links.
During the restart of a crashed primary node, all blocks covered by the
activity log are marked for resync. But a large part of those will actually
be still in sync, therefore using will lower
the required bandwidth in exchange for CPU cycles.
,
During resync-handshake, the dirty-bitmaps of the nodes are
exchanged and merged (using bit-or), so the nodes will have the
same understanding of which blocks are dirty. On large devices,
the fine grained dirty-bitmap can become large as well, and the
bitmap exchange can take quite some time on low-bandwidth links.
Because the bitmap typically contains compact areas where all
bits are unset (clean) or set (dirty), a simple run-length
encoding scheme can considerably reduce the network traffic
necessary for the bitmap exchange.
For backward compatibilty reasons, and because on fast links this
possibly does not improve transfer time but consumes cpu cycles,
this defaults to off.
Introduced in 8.3.2.
,
,
,
,
The dynamic resync speed controller gets enabled with setting
plan_time to a positive value. It aims to
fill the buffers along the data path with either a constant amount of data
fill_target, or aims to have a constant
delay time of delay_target along the
path. The controller has an upper bound of max_rate.
By plan_time the agility of the controller is configured.
Higher values yield for slower/lower responses of the controller to deviation
from the target value. It should be at least 5 times RTT.
For regular data paths a fill_target
in the area of 4k to 100k is appropriate. For a setup that contains drbd-proxy
it is advisable to use delay_target instead.
Only when fill_target is set to 0 the controller
will use delay_target. 5 times RTT is a reasonable
starting value. Max_rate should be set to the
bandwidth available between the DRBD-hosts and the machines hosting
DRBD-proxy, or to the available disk-bandwidth.
The default value of plan_time is 0, the default unit is
0.1 seconds. Fill_target has 0 and sectors as default unit.
Delay_target has 1 (100ms) and 0.1 as default unit.
Max_rate has 10240 (100MiB/s) and KiB/s as default unit.
,
We track the disk IO rate caused by the resync, so we can
detect non-resync IO on the lower level device. If the lower
level device seems to be busy, and the current resync rate is
above min_rate, we throttle the resync.
The default value of min_rate is 4M,
the default unit is k. If you want to not throttle at all, set
it to zero, if you want to throttle always, set it to one.
,
This setting controls what happens to IO requests on a degraded, disk less node
(I.e. no data store is reachable). The available policies are
and .
If ond-policy is set to you
can either resume IO by attaching/connecting the last lost data storage, or by
the drbdadm resume-io res
command. The latter will result in IO errors of course.
The default is . This setting is available since DRBD 8.3.9.
primarydrbdsetupprimary Sets the device into primary role. This
means that applications (e.g. a file system) may open the
device for read and write access. Data
written to the device in primary role are
mirrored to the device in secondary role.
Normally it is not possible to set both devices of a connected DRBD device
pair to primary role. By using the
option, you override this behavior and instruct DRBD to allow two
primaries.
,
Alias for --force.
,
Becoming primary fails if the local replica is
not up-to-date. I.e. when it is inconsistent, outdated of consistent.
By using this option you can force it into
primary role anyway. USE THIS OPTION ONLY IF YOU KNOW WHAT
YOU ARE DOING.
secondarydrbdsetupsecondary Brings the device into secondary role.
This operation fails as long as at least one application (or file
system) has opened the device.
It is possible that both devices of a connected DRBD device pair are secondary.
verifydrbdsetupverify This initiates on-line device verification. During on-line verification,
the contents of every block on the local node are compared to those on
the peer node. Device verification progress can be monitored via
/proc/drbd.
Any blocks whose content differs from that of the corresponding block
on the peer node will be marked out-of-sync in DRBD's on-disk bitmap; they
are not brought back in sync automatically. To
do that, simply disconnect and reconnect the resource.
If on-line verification is already in progress (and this node is "VerifyS"),
this command silently "succeeds". In this case, any start-sector (see
below) will be ignored, and any stop-sector (see below) will be honored.
This can be used to stop a running verify, or to update/shorten/extend
the coverage of the currently running verify.
This command will fail if the device is
not part of a connected device pair.
See also the notes on data integrity on the drbd.conf manpage.,
Since version 8.3.2, on-line verification should resume from the
last position after connection loss. It may also be started from
an arbitrary position by setting this option. If you had reached some
stop-sector before, and you do not specify an explicit start-sector,
verify should resume from the previous stop-sector.
Default unit is sectors. You may also specify a unit explicitly.
The will be rounded down to a multiple of 8 sectors (4kB).
,
Since version 8.3.14, on-line verification can be stopped
before it reaches end-of-device. This can be
Default unit is sectors. You may also specify a unit explicitly.
The may be updated by issuing an additional
drbdsetup verify command on the same node while the verify is running.
invalidatedrbdsetupinvalidate This forces the local device of a pair of connected DRBD devices
into SyncTarget state, which means that all data blocks of the
device are copied over from the peer.
This command will fail if the device is
not either part of a connected device pair, or disconnected Secondary.
invalidate-remotedrbdsetupinvalidate-remote This forces the local device of a pair of connected DRBD devices
into SyncSource state, which means that all data blocks of the
device are copied to the peer.
On a disconnected Primary device, this will set all bits in the out of sync bitmap.
As a side affect this suspends updates to the on disk activity log. Updates
to the on disk activity log resume automatically when necessary.
wait-connectdrbdsetupwait-connect Returns as soon as the device can
communicate with its partner device.
,
,
,
, This command will fail if the
device cannot communicate with its
partner for timeout
seconds. If the peer was working before this node was
rebooted, the wfc_timeout is used. If the peer was already
down before this node was rebooted, the degr_wfc_timeout
is used. If the peer was sucessfully outdated before this
node was rebooted the outdated_wfc_timeout is used.
The default value for all those timeout values
is 0 which means to wait forever.
In case the connection status goes down to StandAlone because
the peer appeared but the devices had a split brain situation,
the default for the command is to terminate. You can change this
behavior with the option.
wait-syncdrbdsetupwait-sync Returns as soon as the device leaves any
synchronization into connected state. The options
are the same as with the wait-connect
command.
disconnectdrbdsetupdisconnect Removes the information set by the command
from the device. This means
that the device goes into unconnected
state and will no longer listen for incoming connections.
detachdrbdsetupdetach Removes the information set by the command
from the device. This means
that the device is detached from its
backing storage device.
,
A regular detach returns after the disk state finally reached
diskless. As a consequence detaching from a frozen backing block device
never terminates.On the other hand A forced detach returns immediately. It allows
you to detach DRBD from a frozen backing block device. Please note that
the disk will be marked as failed until all pending IO requests where
finished by the backing block device.
downdrbdsetupdown Removes all configuration information from the
device and forces it back to
unconfigured state.
roledrbdsetuprole Shows the current roles of the device and
its peer, as local/peer.
statedrbdsetupstateDeprecated alias for "role"cstatedrbdsetupcstate Shows the current connection state of the
device.
dstatedrbdsetupdstate Shows the current states of the backing storage devices, as local/peer.
statusdrbdsetupstatus Shows the current status of the device in XML-like format. Example output:
<resource minor="0" name="s0" cs="SyncTarget" st1="Secondary" st2="Secondary"
ds1="Inconsistent" ds2="UpToDate" resynced_precent="5.9" />resizedrbdsetupresizeThis causes DRBD to reexamine the size of the
device's backing storage device. To
actually do online growing you need to extend the backing storages
on both devices and call the command on one of
your nodes.
The allows you to
resize a device which is currently not connected to the peer.
Use with care, since if you do not resize the peer's disk as well,
further connect attempts of the two will fail.
When the option is given
DRBD will skip the resync of the new storage. Only do this if you
know that the new storage was initialized to the same content
by other means.
check-resizedrbdsetupcheck-resizeTo enable DRBD to detect offline resizing of backing devices
this command may be used to record the current size of backing
devices. The size is stored in files in /var/lib/drbd/ named
drbd-minor-??.lkbd
This command is called by
drbdadm resize res after
drbdsetup device resize returned.
pause-syncdrbdsetuppause-sync Temporarily suspend an ongoing resynchronization by setting the local
pause flag. Resync only progresses if neither the local nor the
remote pause flag is set. It might be desirable to postpone DRBD's
resynchronization after eventual resynchronization of the backing
storage's RAID setup.
resume-syncdrbdsetupresume-sync Unset the local sync pause flag.
outdatedrbdsetupoutdate Mark the data on the local backing storage as outdated. An outdated
device refuses to become primary. This is used in conjunction with
and by the peer's handler.
show-gidrbdsetupshow-gi Displays the device's data generation identifiers verbosely.
get-gidrbdsetupget-gi Displays the device's data generation identifiers.
showdrbdsetupshow Shows all available configuration information of the
device.
suspend-iodrbdsetupsuspend-io This command is of no apparent use and just provided for the sake
of completeness.
resume-iodrbdsetupresume-io If the fence-peer handler fails to stonith the peer node,
and your policy is set to
resource-and-stonith, you can unfreeze IO operations with this
command.
eventsdrbdsetupevents Displays every state change of DRBD and all calls to helper
programs. This might be used to get notified of DRBD's state
changes by piping the output to another program.
,
Display the events of all DRBD minors.
,
This is a debugging aid that displays the content of
all received netlink messages.
new-current-uuiddrbdsetupnew-current-uuid Generates a new current UUID and rotates all other UUID values. This
has at least two use cases, namely to skip the initial sync, and to
reduce network bandwidth when starting in a single node configuration
and then later (re-)integrating a remote site.
Available option:
,
Clears the sync bitmap in addition to generating a new current UUID.
This can be used to skip the initial sync, if you want to start from scratch.
This use-case does only work on "Just Created" meta data.
Necessary steps:
On both nodes, initialize meta data and configure the device.
drbdadm -- --force create-md res They need to do the initial handshake, so they know their sizes.
drbdadm up res They are now Connected Secondary/Secondary Inconsistent/Inconsistent.
Generate a new current-uuid and clear the dirty bitmap.
drbdadm -- --clear-bitmap new-current-uuid res They are now Connected Secondary/Secondary UpToDate/UpToDate.
Make one side primary and create a file system.
drbdadm primary resmkfs -t fs-type $(drbdadm sh-dev res) One obvious side-effect is that the replica is full of old garbage
(unless you made them identical using other means), so any
online-verify is expected to find any number of out-of-sync blocks.
You must not use this on pre-existing data!
Even though it may appear to work at first glance, once you switch to
the other node, your data is toast, as it never got replicated.
So do not leave out the mkfs (or equivalent).
This can also be used to shorten the initial resync of a cluster where the second node
is added after the first node is gone into production, by means of disk shipping.
This use-case works on disconnected devices only, the device may be in
primary or secondary role.
The necessary steps on the current active server are:
drbdsetup device new-current-uuid --clear-bitmap Take the copy of the current active server. E.g. by pulling a disk out of
the RAID1 controller, or by copying with dd. You need to copy the actual
data, and the meta data.
drbdsetup device new-current-uuid
Now add the disk to the new secondary node, and join it to the cluster. You will
get a resync of that parts that were changed since the first call to
drbdsetup in step 1.
Examples For examples, please have a look at the
DRBD User's Guide.
VersionThis document was revised for version 8.3.2 of the DRBD distribution.
AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.comReporting BugsReport bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbd.conf5,
drbd8,
drbddisk8, drbdadm8, DRBD User's Guide,
DRBD web site
drbd-utils-8.9.6/documentation/v83/drbd.8 0000644 0001750 0001750 00000004540 12654452464 020017 0 ustar apoikos apoikos '\" t
.\" Title: drbd
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 15 Oct 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBD" "8" "15 Oct 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbd \- The start and stop script for DRBD
.SH "SYNOPSIS"
.HP \w'\fB/etc/init\&.d/drbd\fR\ 'u
\fB/etc/init\&.d/drbd\fR [\fIresource\fR] {{start}\ |\ {stop}\ |\ {status}\ |\ {reload}\ |\ {restart}\ |\ {force\-reload}}
.SH "INTRODUCTION"
.PP
The
\fB/etc/init\&.d/drbd\fR
script is used to start and stop drbd on a system V style init system\&.
.PP
In order to use
\fB/etc/init\&.d/drbd\fR
you must define a resource, a host, and any other configuration options in the drbd configuration file\&. See
\fB/etc/drbd\&.conf\fR
for details\&. If
\fIresource\fR
is omitted, then all of the resources listed in the config file are configured\&.
.PP
This script might ask you
\(lqDo you want to abort waiting for other server and make this one primary?\(rq
.PP
Only answer this question with
\(lqyes\(rq
if you are sure that it is impossible to repair the other node\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8)\fBdrbdadm\fR(8)\m[blue]\fBDRBD Homepage\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD Homepage
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v83/drbd.conf.xml 0000644 0001750 0001750 00000237226 12504755522 021400 0 ustar apoikos apoikos
5 Dec 2008DRBD8.3.2drbd.conf5Configuration Filesdrbd.confConfiguration file for DRBD's devices
drbd.confIntroduction The file is read by
.
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 should be the same on both nodes of the cluster. Changes to do not apply
immediately.
A small drbd.conf fileglobal { usage-count yes; }
common { syncer { rate 10M; } }
resource r0 {
protocol C;
net {
cram-hmac-alg sha1;
shared-secret "FooFunFactory";
}
on alice {
device minor 1;
disk /dev/sda7;
address 10.1.1.31:7789;
meta-disk internal;
}
on bob {
device minor 1;
disk /dev/sda7;
address 10.1.1.32:7789;
meta-disk internal;
}
}
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 alice uses
/dev/drbd1 as devices for its application, and
/dev/sda7 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.
There may be multiple resource sections in a single drbd.conf file.
For more examples, please have a look at the
DRBD User's Guide.
File Format The file consists of sections and parameters.
A section begins with a keyword, sometimes an additional name, and an
opening brace ({).
A section ends with a closing brace (}.
The braces enclose the parameters.
section [name] { parameter value; [...] }
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 consist only of the identifier.
Parameters are terminated by a semicolon (;).
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).
Comments may be placed into the configuration file and must
begin with a hash sign (#). Subsequent characters are ignored
until the end of the line.
Sectionsdrbd.confskip
Comments out chunks of text, even spanning more than one line.
Characters between the keyword and the opening
brace ({) are ignored. Everything enclosed by the braces
is skipped.
This comes in handy, if you just want to comment out
some '' section: just precede it with 'skip'.
drbd.confglobal
Configures some global parameters. Currently only
, ,
and
are allowed here. You may only have one global section, preferably
as the first section.
drbd.confcommon
All resources inherit the options set in this section.
The common section might have
a ,
a ,
a ,
a and a section.
drbd.confresource
Configures a DRBD resource.
Each resource section needs to have two (or more)
sections
and may have
a ,
a ,
a ,
a and a section.
Required parameter in this section: .
drbd.confon
Carries the necessary configuration parameters for a DRBD
device of the enclosing resource.
host-name is mandatory and must match the
Linux host name (uname -n) of one of the nodes.
You may list more than one host name here, in case you want to use the same
parameters on several hosts (you'd have to move the IP around usually).
Or you may list more than two such sections.
resource r1 {
protocol C;
device minor 1;
meta-disk internal;
on alice bob {
address 10.2.2.100:7801;
disk /dev/mapper/some-san;
}
on charlie {
address 10.2.2.101:7801;
disk /dev/mapper/other-san;
}
on daisy {
address 10.2.2.103:7801;
disk /dev/mapper/other-san-as-seen-from-daisy;
}
}
See also the section keyword.
Required parameters in this section: ,
, , ,
.
drbd.confstacked-on-top-of
For a stacked DRBD setup (3 or 4 nodes), a is used
instead of an section.
Required parameters in this section: and
.
drbd.confon
Carries the necessary configuration parameters for a DRBD
device of the enclosing resource.
This section is very similar to the section.
The difference to the section is that
the matching of the host sections to machines is done by the IP-address
instead of the node name.
Required parameters in this section: ,
, ,
, all of which may be
inherited from the resource section, in which case you may shorten this section
down to just the address identifier.
resource r2 {
protocol C;
device minor 2;
disk /dev/sda7;
meta-disk internal;
# short form, device, disk and meta-disk inherited
floating 10.1.1.31:7802;
# longer form, only device inherited
floating 10.1.1.32:7802 {
disk /dev/sdb;
meta-disk /dev/sdc8;
}
}
drbd.confdisk
This section is used to fine tune DRBD's properties
in respect to the low level storage. Please
refer to drbdsetup8 for detailed description of
the parameters.
Optional parameters: ,
, , ,
, ,
, ,
, .
drbd.confnet
This section is used to fine tune DRBD's properties. Please
refer to drbdsetup8 for a detailed description
of this section's parameters.
Optional parameters:
, ,
,
, ,
,
, ,
, ,
, ,
, ,
, ,
, ,
,
drbd.confstartup
This section is used to fine tune DRBD's properties. Please
refer to drbdsetup8 for a detailed description
of this section's parameters.
Optional parameters:
, ,
,
,
and .
drbd.confsyncer
This section is used to fine tune the synchronization daemon
for the device. Please
refer to drbdsetup8 for a detailed description
of this section's parameters.
Optional parameters:
, , ,
,
, , ,
, ,
, ,
and .
drbd.confhandlers
In this section you can define handlers (executables) that are started
by the DRBD system in response to certain events.
Optional parameters:
, ,
, (formerly oudate-peer),
, , ,
, .
The interface is done via environment variables:
is the name of the resourceis the minor number of the DRBD device, in decimal.
is the path to the primary configuration file; if you
split your configuration into multiple files (e.g. in ),
this will not be helpful.
,
,
are the address family (e.g. ),
the peer's address and hostnames.
(note the singular form) is deprecated, and superseeded by DRBD_PEERS.
Please note that not all of these might be set for all handlers, and that some values might not be useable for a definition.
Parametersdrbd.confminor-count count may be a number from 1 to 255.
Use minor-count
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.drbd.confdialog-refresh time may be 0 or a positive number.
The user dialog redraws the second count every
time seconds (or does no redraws if
time is 0). The default value is 1.drbd.confdisable-ip-verificationUse disable-ip-verification
if, for some obscure reasons, drbdadm can/might not use or
to do a sanity check for the IP address. You can disable the IP verification with
this option.
drbd.confusage-count Please participate in
DRBD's online usage counter.
The most convenient way to do so
is to set this option to . Valid options are:
, and .
drbd.confprotocolOn the TCP/IP link the specified protocol
is used. Valid protocol specifiers are A, B, and C.Protocol A: write IO is reported as completed, if it has
reached local disk and local TCP send buffer.Protocol B: write IO is reported as completed, if it has reached
local disk and remote buffer cache.Protocol C: write IO is reported as completed, if it has
reached both local and remote disk.drbd.confdevice
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
parameter.
One can ether omit the name or
and the minor number. If you omit the name
a default of /dev/drbdminor will be used.
Udev will create additional symlinks in /dev/drbd/by-res and /dev/drbd/by-disk.
drbd.confdisk
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
also holds true for dumpe2fs8 and similar commands.
drbd.confaddress
A resource needs one IP address per device,
which is used to wait for incoming connections from the partner device
respectively to reach the partner device. AF
must be one of , ,
or
(for compatibility reasons is an alias for ).
It may be omited for IPv4 addresses. The actual IPv6 address that follows
the keyword must be placed inside brackets:
ipv6 [fd01:2345:6789:abcd::1]:7800.
Each DRBD resource needs a TCP port
which is used to connect to the node's partner device.
Two different DRBD resources may not use the same
addr:port combination on the same node.
drbd.confmeta-diskdrbd.confflexible-meta-disk
Internal means that the last part of the backing device is used to store
the meta-data. You must not use [index] with
internal. Note: Regardless of whether you use the or
the keyword, it will always be of
the size needed for the remaining storage size.
You can use a single block device 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.
With the 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.drbd.confon-io-errorhandler is taken, if the lower level
device reports io-errors to the upper layers.
handler may be ,
or
: The node downgrades the disk status to inconsistent, marks the
erroneous block as inconsistent in the bitmap and retries the IO on the remote node.: Call the handler script
.: The node drops its low level device, and continues in diskless mode.drbd.conffencing
By we understand preventive
measures to avoid situations where both nodes are primary
and disconnected (AKA split brain).
Valid fencing policies are: This is the default policy. No fencing actions are taken.
If a node becomes a disconnected primary, it tries to fence
the peer's disk. This is done by calling the
handler. The handler is supposed to reach the other node over
alternative communication paths and call '' there.
If a node becomes a disconnected primary, it freezes all
its IO operations and calls its fence-peer handler. The
fence-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 command.
drbd.confuse-bmbv 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 larger than 4KiB. (At the time of writing the only known drivers which have such a function
are: md (software raid driver), dm (device mapper - LVM) and DRBD
itself). To get the 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. Use this option only if you know what you are
doing.drbd.confno-disk-barrierdrbd.confno-disk-flushesdrbd.confno-disk-drain DRBD has four implementations to express write-after-write dependencies to
its backing storage device. DRBD will use the first method that is
supported by the backing storage device and that is not disabled by the user.
When selecting the method you should not only base your decision on the
measurable performance. In case your backing storage device has a volatile
write cache (plain disks, RAID of plain disks) you should use one
of the first two. In case your backing storage device has battery-backed
write cache you may go with option 3.
Option 4 (disable everything, use "none") is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .
Unfortunately device mapper (LVM) might not support barriers.
The letter after "wo:" in /proc/drbd indicates with method is currently in
use for a device: , , , . The implementations are:
barrier The first requires that the driver of the
backing storage device support barriers (called 'tagged command queuing' in
SCSI and 'native command queuing' in SATA speak). The use of this
method can be disabled by the option.
Note: Since Linux-2.6.36 (or RHEL's 2.6.32) this method is disabled.
flush The second requires that the backing device support disk flushes (called
'force unit access' in the drive vendors speak). The use of this method
can be disabled using the option.
drain The third method is simply to let write requests drain before
write requests of a new reordering domain are issued. This was the
only implementation before 8.0.9.
none The fourth method is to not express write-after-write dependencies to
the backing store at all, by also specifying .
This is dangerous
on most IO stacks, may result in write-reordering, and if so,
can theoretically be the reason for data corruption, or disturb
the DRBD protocol, causing spurious disconnect/reconnect cycles.
Do not use .
drbd.confno-md-flushes Disables the use of disk flushes and barrier BIOs when accessing
the meta data device. See the notes on .
drbd.confmax-bio-bvecs In some special circumstances the device mapper stack manages to
pass BIOs to DRBD that violate the constraints that are set forth
by DRBD's merge_bvec() function and which have more than one bvec.
A known example is:
phys-disk -> DRBD -> LVM -> Xen -> misaligned partition (63) -> DomU FS.
Then you might see "bio would need to, but cannot, be split:" in
the Dom0's kernel log. The best workaround is to proper align the partition within
the VM (E.g. start it at sector 1024). This costs 480 KiB of storage.
Unfortunately the default of most Linux partitioning tools is
to start the first partition at an odd number (63). Therefore
most distribution's install helpers for virtual linux machines will
end up with misaligned partitions.
The second best workaround is to limit DRBD's max bvecs per BIO
(= ) to 1, but that might cost performance. The default value of is 0, which means that
there is no user imposed limitation.
drbd.confdisk-timeout
If the driver of the lower_device
does not finish an IO request within disk_timeout,
DRBD considers the disk as failed. If DRBD is connected to a remote host,
it will reissue local pending IO requests to the peer, and ship all new
IO requests to the peer only. The disk state advances to diskless, as soon
as the backing block device has finished all IO requests. The default value of is 0, which means that no timeout is enforced.
The default unit is 100ms. This option is available since 8.3.12.
drbd.confsndbuf-size size is the size of the TCP socket send buffer.
The default value is 0, i.e. autotune. You can specify smaller or larger values. Larger values
are appropriate for reasonable write throughput with protocol A over high
latency networks. Values
below 32K do not make sense. Since 8.0.13 resp. 8.2.7, setting the size
value to 0 means that the kernel should autotune this.
drbd.confrcvbuf-size size is the size of the TCP socket receive buffer.
The default value is 0, i.e. autotune. You can specify smaller or larger values.
Usually this should be left at its default. Setting the size
value to 0 means that the kernel should autotune this.
drbd.conftimeout
If the partner node fails to send an expected response packet within
time tenths
of a second, the partner node
is considered dead and therefore the TCP/IP connection is abandoned. This must be lower than connect-int and ping-int.
The default value is 60 = 6 seconds, the unit 0.1 seconds.
drbd.confconnect-int
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 retries. The default value is 10 seconds, the unit is 1 second.
drbd.confping-int
If the TCP/IP connection linking a DRBD device pair is idle for more than
time 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.
drbd.confping-timeout
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 are tenths of a second.
drbd.confmax-buffers
Limits the memory usage per DRBD minor device on the receiving side,
or for internal buffers during resync or online-verify.
Unit is PAGE_SIZE, which is 4 KiB on most systems.
The minimum possible setting is hard coded to 32 (=128 KiB).
These buffers are used to hold data blocks while they are written to/read from disk.
To avoid possible distributed deadlocks on congestion, this setting is used
as a throttle threshold rather than a hard limit. Once more than max-buffers
pages are in use, further allocation from this pool is throttled.
You want to increase max-buffers if you cannot saturate the IO backend on the
receiving side.
drbd.confko-count
In case the secondary node fails to complete a single write
request for count times the
timeout, it is expelled from the
cluster. (I.e. the primary node goes into mode.)
To disable this feature, you should explicitly set it to 0; defaults may change between versions.
drbd.confmax-epoch-size
The highest number of data blocks between two write barriers.
If you set this smaller than 10, you might decrease your performance.
drbd.confallow-two-primaries
With this option set you may assign the 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!
drbd.confunplug-watermark
This setting has no effect with recent kernels that use explicit on-stack
plugging (upstream Linux kernel 2.6.39, distributions may have backported).
When the number of pending write requests on the standby
(secondary) node exceeds the , 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, yet others don't feel much effect at all.
Minimum 16, default 128, maximum 131072.
drbd.confcram-hmac-alg
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
.
drbd.confshared-secret
The shared secret used in peer authentication. May be up to 64 characters.
Note that peer authentication is disabled as long as no
(see above) is specified.
policydrbd.confafter-sb-0pri possible policies are:
No automatic resynchronization, simply disconnect.
Auto sync from the node that was primary before the split-brain situation happened.
Auto sync from the node that became primary as second during
the split-brain situation.
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.
Auto sync from the node that touched more blocks during the
split brain situation.
Auto sync to the named node.
policydrbd.confafter-sb-1pri possible policies are:
No automatic resynchronization, simply disconnect.
Discard the version of the secondary if the outcome
of the algorithm would also
destroy the current secondary's data. Otherwise disconnect.
Always take the decision of the
algorithm, even if that causes an erratic change of
the primary's view of the data. This is only useful if
you use a one-node FS (i.e. not OCFS2 or GFS) with the
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.
Discard the secondary's version.
Always honor the outcome of the algorithm. In case it decides the current
secondary has the right data, it calls the "pri-lost-after-sb"
handler on the current primary.
policydrbd.confafter-sb-2pri possible policies are:
No automatic resynchronization, simply disconnect.
Always take the decision of the
algorithm, even if that causes an erratic change of
the primary's view of the data. This is only useful if
you use a one-node FS (i.e. not OCFS2 or GFS) with the
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.
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.
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.
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.)
policydrbd.confrr-conflict This option helps to solve the cases when the outcome of the resync decision is
incompatible with the current role assignment in the cluster.
No automatic resynchronization, simply disconnect.
Sync to the primary node is allowed, violating the
assumption that data on a block device are stable for one
of the nodes. Dangerous, do not use. Call the "pri-lost" helper program on one of the
machines. This program is expected to reboot the
machine, i.e. make it secondary.
algdrbd.confdata-integrity-alg DRBD can ensure the data integrity of the user's data on the network
by comparing hash values. Normally this is ensured by the 16 bit checksums
in the headers of TCP/IP packets.This option can be set to any of the kernel's data digest algorithms.
In a typical kernel configuration you should have
at least one of , , and
available. By default this is not enabled.See also the notes on data integrity.drbd.confno-tcp-cork DRBD usually uses the TCP socket option TCP_CORK to hint to the network
stack when it can expect more data, and when it should flush out what it
has in its send queue. It turned out that there is at least one network
stack that performs worse when one uses this hinting method. Therefore
we introducted this option, which disables the setting and clearing of
the TCP_CORK socket option by DRBD.By default DRBD blocks when the available TCP send queue becomes full.
That means it will slow down the application that generates the write
requests that cause DRBD to send more data down that TCP connection.
When DRBD is deployed with DRBD-proxy it might be more desirable that
DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full.
In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps
the connection open.The advantage of the AHEAD/BEHIND mode is that the
application is not slowed down, even if DRBD-proxy's buffer is
not sufficient to buffer all write requests. The downside is that
the peer node falls behind, and that a resync will be necessary to
bring it back into sync. During that resync the peer node will have
an inconsistent disk. Available congestion_policys are
and . The default is .
Fill_threshold might be in the range of 0 to 10GiBytes. The
default is 0 which disables the check. Active_extents_threshold
has the same limits as .The AHEAD/BEHIND mode and its settings are available since DRBD 8.3.10.Wait for connection timeout.
drbd.confwfc-timeout
The init script drbd8 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.
drbd.confdegr-wfc-timeout
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. Value 0 means unlimited.
drbd.confoutdated-wfc-timeout
Wait for connection timeout, if the peer was outdated.
In case a degraded cluster (= cluster with only one node left)
with an outdated peer disk is rebooted, this timeout value is used instead of wfc-timeout,
because the peer is not allowed to become primary in the meantime.
Value 0 means unlimited.
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.
Sets on which node the device should be promoted to primary role by
the init script. The node-name might either
be a host name or the keyword . 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).
Usually and are
ignored for stacked devices, instead twice the amount of
is used for the connection timeouts.
With the keyword you disable this, and force
DRBD to mind the and
statements. Only do that if the peer of the stacked resource is usually not
available or will usually not become primary.
By using this option incorrectly, you run the risk of causing unexpected split brain.
drbd.confrate
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.
drbd.confuse-rle
During resync-handshake, the dirty-bitmaps of the nodes are exchanged and
merged (using bit-or), so the nodes will have the same understanding of
which blocks are dirty. On large devices, the fine grained dirty-bitmap can
become large as well, and the bitmap exchange can take quite some time on
low-bandwidth links.
Because the bitmap typically contains compact areas where
all bits are unset (clean) or set (dirty), a simple run-length
encoding scheme can considerably reduce the network traffic
necessary for the bitmap exchange.
For backward compatibilty reasons, and because on fast
links this possibly does not improve transfer time but
consumes cpu cycles, this defaults to off.
drbd.confafter
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 res-name
is already in connected state (i.e., has finished its resynchronization).
drbd.confal-extents
DRBD automatically performs hot area detection. With this
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 extents is
127. (Minimum: 7, Maximum: 3843)
During online verification (as initiated by the
verify sub-command),
rather than doing a bit-wise comparison, DRBD applies a hash function
to the contents of every block being verified, and compares that
hash with the peer. This option defines the hash algorithm being
used for that purpose. It can be set to any of the kernel's data
digest algorithms. In a typical kernel configuration you should have
at least one of , , and
available. By default this is not enabled; you must set this
option explicitly in order to be able to use on-line device verification.See also the notes on data integrity.A resync process sends all marked data blocks from the source to
the destination node, as long as no is
given. When one is specified the resync process exchanges hash values of all
marked blocks first, and sends only those data blocks that have different
hash values.This setting is useful for DRBD setups with low bandwidth links.
During the restart of a crashed primary node, all blocks covered by the
activity log are marked for resync. But a large part of those will actually
be still in sync, therefore using will lower
the required bandwidth in exchange for CPU cycles.The dynamic resync speed controller gets enabled with setting
plan_time to a positive value. It aims to
fill the buffers along the data path with either a constant amount of data
fill_target, or aims to have a constant
delay time of delay_target along the
path. The controller has an upper bound of max_rate.
By plan_time the agility of the controller is configured.
Higher values yield for slower/lower responses of the controller to deviation
from the target value. It should be at least 5 times RTT.
For regular data paths a fill_target
in the area of 4k to 100k is appropriate. For a setup that contains drbd-proxy
it is advisable to use delay_target instead.
Only when fill_target is set to 0 the controller
will use delay_target. 5 times RTT is a reasonable
starting value. Max_rate should be set to the
bandwidth available between the DRBD-hosts and the machines hosting
DRBD-proxy, or to the available disk-bandwidth.
The default value of plan_time is 0, the default unit is
0.1 seconds. Fill_target has 0 and sectors as default unit.
Delay_target has 1 (100ms) and 0.1 as default unit.
Max_rate has 10240 (100MiB/s) and KiB/s as default unit.
The dynamic resync speed controller and its settings are available since DRBD 8.3.9.
A node that is primary and sync-source has to schedule application
IO requests and resync IO requests. The min_rate
tells DRBD use only up to min_rate for resync IO and to dedicate all
other available IO bandwidth to application requests.Note: The value 0 has a special meaning. It disables the limitation
of resync IO completely, which might slow down application IO considerably.
Set it to a value of 1, if you prefer that resync IO never slows down
application IO.
Note: Although the name might suggest that it is a lower bound for the
dynamic resync speed controller, it is not. If the DRBD-proxy buffer is full,
the dynamic resync speed controller is free to lower the resync speed down
to 0, completely independent of the setting.
Min_rate has 4096 (4MiB/s) and KiB/s as default unit.
This setting controls what happens to IO requests on a degraded, disk less node
(I.e. no data store is reachable). The available policies are
and .
If ond-policy is set to you
can either resume IO by attaching/connecting the last lost data storage, or by
the drbdadm resume-io res
command. The latter will result in IO errors of course.
The default is . This setting is available since DRBD 8.3.9.
drbd.confcpu-mask
Sets the cpu-affinity-mask for DRBD's kernel threads of this device. The
default value of cpu-mask is 0, which means
that DRBD's kernel threads should be spread over all CPUs of the machine.
This value must be given in hexadecimal notation. If it is too big it will
be truncated.
drbd.confpri-on-incon-degr
This handler is called if the node is primary, degraded
and if the local copy of the data is inconsistent.drbd.confpri-lost-after-sb
The node is currently primary, but lost the after-split-brain
auto recovery procedure. As as consequence, it should be abandoned.
drbd.confpri-lost
The node is currently primary, but DRBD's algorithm
thinks that it should become sync target. As a consequence it should
give up its primary role.
drbd.conffence-peer
The handler is part of the
mechanism. This handler is called in case the node needs to fence the
peer's disk. It should use other communication paths than DRBD's network
link. drbd.conflocal-io-error
DRBD got an IO error from the local IO subsystem.
drbd.confinitial-split-brain
DRBD has connected and detected a split brain situation.
This handler can alert someone in all cases of split brain, not just
those that go unresolved.
drbd.confsplit-brain
DRBD detected a split brain situation but remains unresolved.
Manual recovery is necessary. This handler should alert someone on duty.
drbd.confbefore-resync-target
DRBD calls this handler just before a resync begins on the node
that becomes resync target. It might be used to take a snapshot of the
backing block device.
drbd.confafter-resync-target
DRBD calls this handler just after a resync operation finished on the
node whose disk just became consistent after being inconsistent for the
duration of the resync. It might be used to remove a snapshot of the backing device
that was created by the handler.
Other Keywordsdrbd.confinclude
Include all files matching the wildcard pattern file-pattern.
The statement
is only allowed on the top level, i.e. it is not allowed inside any section.
Notes on data integrityThere are two independent methods in DRBD to ensure the integrity of
the mirrored data. The online-verify mechanism and the
of the section.Both mechanisms might deliver false positives if the user of DRBD modifies the
data which gets written to disk while the transfer goes on. This may happen for
swap, or for certain append while global sync, or truncate/rewrite workloads,
and not necessarily poses a problem for the integrity of the data.
Usually when the initiator of the data transfer does this, it already knows that
that data block will not be part of an on disk data structure, or will be resubmitted
with correct data soon enough.The causes the receiving side to log
an error about "Digest integrity check FAILED: Ns +x\n", where N is the sector
offset, and x is the size of the requst in bytes. It will then disconnect, and
reconnect, thus causing a quick resync. If the sending side at the same time
detected a modification, it warns about "Digest mismatch, buffer modified by
upper layers during write: Ns +x\n", which shows that this was a false positive.
The sending side may detect these buffer modifications immediately after the
unmodified data has been copied to the tcp buffers, in which case the receiving
side won't notice it.The most recent (2007) example of systematic corruption was an
issue with the TCP offloading engine and the driver of a certain type
of GBit NIC. The actual corruption happened on the DMA transfer from
core memory to the card. Since the TCP checksum gets calculated on the card,
this type of corruption stays undetected as long as you do not use
either the online or the .We suggest to use the only during a
pre-production phase due to its CPU costs. Further we suggest to do online
runs regularly e.g. once a month during a low load period.VersionThis document was revised for version 8.3.2 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.Reporting BugsReport bugs to drbd-user@lists.linbit.com.CopyrightCopyright 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.See Alsodrbd8,
drbddisk8,
drbdsetup8,
drbdadm8,
DRBD User's Guide,
DRBD web site
drbd-utils-8.9.6/documentation/v83/drbddisk.xml 0000644 0001750 0001750 00000006150 12466702073 021315 0 ustar apoikos apoikos
drbddiskScript to mark devices as primary and mount file systems15 Oct 2008DRBD8.3.2drbddisk8System Administration/etc/ha.d/resource.d/drbddiskresourcestartstopstatusIntroduction The script
brings the local device of resource into
primary role. It is designed to be used by Heartbeat.
In order to use you must
define
a resource, a host, and any other configuration options in the DRBD
configuration file. See for details.
If resource is omitted, then all of the
resources listed in the config file are affected.
VersionThis document was revised for version 8.0.14 of the DRBD distribution.Author Written by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting Bugs Report bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbd.conf5,
drbd8,
drbdsetup8drbdadm8DRBD Homepage
drbd-utils-8.9.6/documentation/v83/drbdsetup.8 0000644 0001750 0001750 00000132077 12654452463 021106 0 ustar apoikos apoikos '\" t
.\" Title: drbdsetup
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 5 Dec 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBDSETUP" "8" "5 Dec 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdsetup \- Setup tool for DRBD .\" drbdsetup
.SH "SYNOPSIS"
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} disk {\fIlower_dev\fR} {\fImeta_data_dev\fR} {\fImeta_data_index\fR} [\-d\ {\fIsize\fR}] [\-e\ {\fIerr_handler\fR}] [\-f\ {\fIfencing_policy\fR}] [\-b] [\-t\ {\fIdisk_timeout\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} net [\fIaf:\fR] {\fIlocal_addr\fR} [\fI:port\fR] [\fIaf:\fR] {\fIremote_addr\fR} [\fI:port\fR] {\fIprotocol\fR} [\-c\ {\fItime\fR}] [\-i\ {\fItime\fR}] [\-t\ {\fIval\fR}] [\-S\ {\fIsize\fR}] [\-r\ {\fIsize\fR}] [\-k\ {\fIcount\fR}] [\-e\ {\fImax_epoch_size\fR}] [\-b\ {\fImax_buffers\fR}] [\-m] [\-a\ {\fIhash_alg\fR}] [\-x\ {\fIshared_secret\fR}] [\-A\ {\fIasb\-0p\-policy\fR}] [\-B\ {\fIasb\-1p\-policy\fR}] [\-C\ {\fIasb\-2p\-policy\fR}] [\-D] [\-R\ {\fIrole\-resync\-conflict\-policy\fR}] [\-p\ {\fIping_timeout\fR}] [\-u\ {\fIval\fR}] [\-d\ {\fIhash_alg\fR}] [\-o] [\-n] [\-g\ {\fIcongestion_policy\fR}] [\-f\ {\fIval\fR}] [\-h\ {\fIval\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} syncer [\-a\ {\fIdev_minor\fR}] [\-r\ {\fIrate\fR}] [\-e\ {\fIextents\fR}] [\-v\ {\fIverify\-hash\-alg\fR}] [\-c\ {\fIcpu\-mask\fR}] [\-C\ {\fIcsums\-hash\-alg\fR}] [\-R] [\-p\ {\fIplan_time\fR}] [\-s\ {\fIfill_target\fR}] [\-d\ {\fIdelay_target\fR}] [\-m\ {\fImax_rate\fR}] [\-n\ {\fIond\-policy\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} disconnect
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} detach [\-f]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} down
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} primary [\-f] [\-o]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} secondary
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} verify [\-s\ {\fIstart\-position\fR}] [\-S\ {\fIstop\-position\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} invalidate
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} invalidate\-remote
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} wait\-connect [\-t\ {\fIwfc_timeout\fR}] [\-d\ {\fIdegr_wfc_timeout\fR}] [\-o\ {\fIoutdated_wfc_timeout\fR}] [\-w]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} wait\-sync [\-t\ {\fIwfc_timeout\fR}] [\-d\ {\fIdegr_wfc_timeout\fR}] [\-o\ {\fIoutdated_wfc_timeout\fR}] [\-w]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} role
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} cstate
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} dstate
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} status
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} resize [\-d\ {\fIsize\fR}] [\-f\ {\fIassume\-peer\-has\-space\fR}] [\-c\ {\fIassume\-clean\fR}]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} check\-resize
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} pause\-sync
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} resume\-sync
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} outdate
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} show\-gi
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} get\-gi
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} show
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} suspend\-io
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} resume\-io
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} events [\-u] [\-a]
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR {\fIdevice\fR} new\-current\-uuid [\-c]
.SH "DESCRIPTION"
.PP
drbdsetup is used to associate DRBD devices with their backing block devices, to set up DRBD device pairs to mirror their backing block devices, and to inspect the configuration of running DRBD devices\&.
.SH "NOTE"
.PP
drbdsetup is a low level tool of the DRBD program suite\&. It is used by the data disk and drbd scripts to communicate with the device driver\&.
.SH "COMMANDS"
.PP
Each drbdsetup sub\-command might require arguments and bring its own set of options\&. All values have default units which might be overruled by K, M or G\&. These units are defined in the usual way (e\&.g\&. K = 2^10 = 1024)\&.
.SS "Common options"
.PP
All drbdsetup sub\-commands accept these two options
.PP
\fB\-\-create\-device\fR
.RS 4
In case the specified DRBD device (minor number) does not exist yet, create it implicitly\&.
.RE
.PP
\fB\-\-set\-defaults\fR
.RS 4
When
\fB\-\-set\-defaults\fR
is given on the command line, all options of the invoked sub\-command that are not explicitly set are reset to their default values\&.
.RE
.SS "disk"
.\" drbdsetup: disk
.PP
Associates
\fIdevice\fR
with
\fIlower_device\fR
to store its data blocks on\&. The
\fB\-d\fR
(or
\fB\-\-disk\-size\fR) should only be used if you wish not to use as much as possible from the backing block devices\&. If you do not use
\fB\-d\fR, the
\fIdevice\fR
is only ready for use as soon as it was connected to its peer once\&. (See the
\fBnet\fR
command\&.)
.PP
\fB\-d\fR, \fB\-\-disk\-size \fR\fB\fIsize\fR\fR
.RS 4
You can override DRBD\'s size determination method with this option\&. If you need to use the device before it was ever connected to its peer, use this option to pass the
\fIsize\fR
of the DRBD device to the driver\&. Default unit is sectors (1s = 512 bytes)\&.
.sp
If you use the
\fIsize\fR
parameter in drbd\&.conf, we strongly recommend to add an explicit unit postfix\&. drbdadm and drbdsetup used to have mismatching default units\&.
.RE
.PP
\fB\-e\fR, \fB\-\-on\-io\-error \fR\fB\fIerr_handler\fR\fR
.RS 4
If the driver of the
\fIlower_device\fR
reports an error to DRBD, DRBD will mark the disk as inconsistent, call a helper program, or detach the device from its backing storage and perform all further IO by requesting it from the peer\&. The valid
\fIerr_handlers\fR
are:
\fBpass_on\fR,
\fBcall\-local\-io\-error\fR
and
\fBdetach\fR\&.
.RE
.PP
\fB\-f\fR, \fB\-\-fencing \fR\fB\fIfencing_policy\fR\fR
.RS 4
Under
\fBfencing\fR
we understand preventive measures to avoid situations where both nodes are primary and disconnected (AKA split brain)\&.
.sp
Valid fencing policies are:
.PP
\fBdont\-care\fR
.RS 4
This is the default policy\&. No fencing actions are done\&.
.RE
.PP
\fBresource\-only\fR
.RS 4
If a node becomes a disconnected primary, it tries to outdate the peer\'s disk\&. This is done by calling the fence\-peer handler\&. The handler is supposed to reach the other node over alternative communication paths and call \'drbdadm outdate res\' there\&.
.RE
.PP
\fBresource\-and\-stonith\fR
.RS 4
If a node becomes a disconnected primary, it freezes all its IO operations and calls its fence\-peer handler\&. The fence\-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
\fBresume\-io\fR
command\&.
.RE
.RE
.PP
\fB\-b\fR, \fB\-\-use\-bmbv\fR
.RS 4
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 larger than 4 KiB\&. (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)
.sp
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 option, 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 exactly of the same type\&. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING\&.
.RE
.PP
\fB\-a\fR, \fB\-\-no\-disk\-barrier\fR, \fB\-i\fR, \fB\-\-no\-disk\-flushes\fR, \fB\-D\fR, \fB\-\-no\-disk\-drain\fR
.RS 4
DRBD has four implementations to express write\-after\-write dependencies to its backing storage device\&. DRBD will use the first method that is supported by the backing storage device and that is not disabled by the user\&.
.sp
When selecting the method you should not only base your decision on the measurable performance\&. In case your backing storage device has a volatile write cache (plain disks, RAID of plain disks) you should use one of the first two\&. In case your backing storage device has battery\-backed write cache you may go with option 3\&. Option 4 (disable everything, use "none")
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fBno\-disk\-drain\fR\&.
.sp
Unfortunately device mapper (LVM) might not support barriers\&.
.sp
The letter after "wo:" in /proc/drbd indicates with method is currently in use for a device: b, f, d, n\&. The implementations:
.PP
barrier
.RS 4
The first requires that the driver of the backing storage device support barriers (called \'tagged command queuing\' in SCSI and \'native command queuing\' in SATA speak)\&. The use of this method can be disabled by the
\fB\-\-no\-disk\-barrier\fR
option\&. Note: Since Linux\-2\&.6\&.36 (or RHEL\'s 2\&.6\&.32) this method is disabled\&.
.RE
.PP
flush
.RS 4
The second requires that the backing device support disk flushes (called \'force unit access\' in the drive vendors speak)\&. The use of this method can be disabled using the
\fB\-\-no\-disk\-flushes\fR
option\&.
.RE
.PP
drain
.RS 4
The third method is simply to let write requests drain before write requests of a new reordering domain are issued\&. That was the only implementation before 8\&.0\&.9\&.
.RE
.PP
none
.RS 4
The fourth method is to not express write\-after\-write dependencies to the backing store at all, by also specifying
\fB\-\-no\-disk\-drain\fR\&. This
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fB\-\-no\-disk\-drain\fR\&.
.RE
.RE
.PP
\fB\-m\fR, \fB\-\-no\-md\-flushes\fR
.RS 4
Disables the use of disk flushes and barrier BIOs when accessing the meta data device\&. See the notes on
\fB\-\-no\-disk\-flushes\fR\&.
.RE
.PP
\fB\-s\fR, \fB\-\-max\-bio\-bvecs\fR
.RS 4
In some special circumstances the device mapper stack manages to pass BIOs to DRBD that violate the constraints that are set forth by DRBD\'s merge_bvec() function and which have more than one bvec\&. A known example is: phys\-disk \-> DRBD \-> LVM \-> Xen \-> missaligned partition (63) \-> DomU FS\&. Then you might see "bio would need to, but cannot, be split:" in the Dom0\'s kernel log\&.
.sp
The best workaround is to proper align the partition within the VM (E\&.g\&. start it at sector 1024)\&. That costs 480 KiB of storage\&. Unfortunately the default of most Linux partitioning tools is to start the first partition at an odd number (63)\&. Therefore most distributions install helpers for virtual linux machines will end up with missaligned partitions\&. The second best workaround is to limit DRBD\'s max bvecs per BIO (i\&.e\&., the
\fBmax\-bio\-bvecs\fR
option) to 1, but that might cost performance\&.
.sp
The default value of
\fBmax\-bio\-bvecs\fR
is 0, which means that there is no user imposed limitation\&.
.RE
.PP
\fB\-t\fR, \fB\-\-disk\-timeout \fR\fB\fIdisk_timeout\fR\fR
.RS 4
If the driver of the
\fIlower_device\fR
does not finish an IO request within
\fIdisk_timeout\fR, DRBD considers the disk as failed\&. If DRBD is connected to a remote host, it will reissue local pending IO requests to the peer, and ship all new IO requests to the peer only\&. The disk state advances to diskless, as soon as the backing block device has finished all IO requests\&.
.sp
The default value of is 0, which means that no timeout is enforced\&. The default unit is 100ms\&. This option is available since 8\&.3\&.12\&.
.RE
.SS "net"
.\" drbdsetup: net
.PP
Sets up the
\fIdevice\fR
to listen on
\fIaf:local_addr:port\fR
for incoming connections and to try to connect to
\fIaf:remote_addr:port\fR\&. If
\fIport\fR
is omitted, 7788 is used as default\&. If
\fIaf\fR
is omitted
\fBipv4\fR
gets used\&. Other supported address families are
\fBipv6\fR,
\fBssocks\fR
for Dolphin Interconnect Solutions\' "super sockets" and
\fBsdp\fR
for Sockets Direct Protocol (Infiniband)\&.
.PP
On the TCP/IP link the specified
\fIprotocol\fR
is used\&. Valid protocol specifiers are A, B, and C\&.
.PP
Protocol A: write IO is reported as completed, if it has reached local disk and local TCP send buffer\&.
.PP
Protocol B: write IO is reported as completed, if it has reached local disk and remote buffer cache\&.
.PP
Protocol C: write IO is reported as completed, if it has reached both local and remote disk\&.
.PP
\fB\-c\fR, \fB\-\-connect\-int \fR\fB\fItime\fR\fR
.RS 4
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 retries\&. The default value is 10 seconds, the unit is 1 second\&.
.RE
.PP
\fB\-i\fR, \fB\-\-ping\-int \fR\fB\fItime\fR\fR
.RS 4
If the TCP/IP connection linking a DRBD device pair is idle for more than
\fItime\fR
seconds, DRBD will generate a keep\-alive packet to check if its partner is still alive\&. The default value is 10 seconds, the unit is 1 second\&.
.RE
.PP
\fB\-t\fR, \fB\-\-timeout \fR\fB\fIval\fR\fR
.RS 4
If the partner node fails to send an expected response packet within
\fIval\fR
tenths of a second, the partner node is considered dead and therefore the TCP/IP connection is abandoned\&. The default value is 60 (= 6 seconds)\&.
.RE
.PP
\fB\-S\fR, \fB\-\-sndbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
The socket send buffer is used to store packets sent to the secondary node, which are not yet acknowledged (from a network point of view) by the secondary node\&. When using protocol A, it might be necessary to increase the size of this data structure in order to increase asynchronicity between primary and secondary nodes\&. But keep in mind that more asynchronicity is synonymous with more data loss in the case of a primary node failure\&. Since 8\&.0\&.13 resp\&. 8\&.2\&.7 setting the
\fIsize\fR
value to 0 means that the kernel should autotune this\&. The default
\fIsize\fR
is 0, i\&.e\&. autotune\&.
.RE
.PP
\fB\-r\fR, \fB\-\-rcvbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
Packets received from the network are stored in the socket receive buffer first\&. From there they are consumed by DRBD\&. Before 8\&.3\&.2 the receive buffer\'s size was always set to the size of the socket send buffer\&. Since 8\&.3\&.2 they can be tuned independently\&. A value of 0 means that the kernel should autotune this\&. The default
\fIsize\fR
is 0, i\&.e\&. autotune\&.
.RE
.PP
\fB\-k\fR, \fB\-\-ko\-count \fR\fB\fIcount\fR\fR
.RS 4
In case the secondary node fails to complete a single write request for
\fIcount\fR
times the
\fItimeout\fR, it is expelled from the cluster, i\&.e\&. the primary node goes into StandAlone mode\&. To disable this feature, you should explicitly set it to 0; defaults may change between versions\&.
.RE
.PP
\fB\-e\fR, \fB\-\-max\-epoch\-size \fR\fB\fIval\fR\fR
.RS 4
With this option the maximal number of write requests between two barriers is limited\&. Typically set to the same as
\fB\-\-max\-buffers\fR, or the allowed maximum\&. Values smaller than 10 can lead to degraded performance\&. The default value is 2048\&.
.RE
.PP
\fB\-b\fR, \fB\-\-max\-buffers \fR\fB\fIval\fR\fR
.RS 4
With this option the maximal number of buffer pages allocated by DRBD\'s receiver thread is limited\&. Typically set to the same as
\fB\-\-max\-epoch\-size\fR\&. Small values could lead to degraded performance\&. The default value is 2048, the minimum 32\&. Increase this if you cannot saturate the IO backend of the receiving side during linear write or during resync while otherwise idle\&.
.sp
See also
\fBdrbd.conf\fR(5)
.RE
.PP
\fB\-u\fR, \fB\-\-unplug\-watermark \fR\fB\fIval\fR\fR
.RS 4
This setting has no effect with recent kernels that use explicit on\-stack plugging (upstream Linux kernel 2\&.6\&.39, distributions may have backported)\&.
.sp
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, yet others don\'t feel much effect at all\&. Minimum 16, default 128, maximum 131072\&.
.RE
.PP
\fB\-m\fR, \fB\-\-allow\-two\-primaries \fR
.RS 4
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!
.RE
.PP
\fB\-a\fR, \fB\-\-cram\-hmac\-alg \fR\fIalg\fR
.RS 4
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\&.
.RE
.PP
\fB\-x\fR, \fB\-\-shared\-secret \fR\fIsecret\fR
.RS 4
The shared secret used in peer authentication\&. May be up to 64 characters\&.
.RE
.PP
\fB\-A\fR, \fB\-\-after\-sb\-0pri \fR\fIasb\-0p\-policy\fR
.RS 4
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBdiscard\-younger\-primary\fR
.RS 4
Auto sync from the node that was primary before the split\-brain situation occurred\&.
.RE
.PP
\fBdiscard\-older\-primary\fR
.RS 4
Auto sync from the node that became primary as second during the split\-brain situation\&.
.RE
.PP
\fBdiscard\-zero\-changes\fR
.RS 4
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\&.
.RE
.PP
\fBdiscard\-least\-changes\fR
.RS 4
Auto sync from the node that touched more blocks during the split brain situation\&.
.RE
.PP
\fBdiscard\-node\-NODENAME\fR
.RS 4
Auto sync to the named node\&.
.RE
.RE
.PP
\fB\-B\fR, \fB\-\-after\-sb\-1pri \fR\fIasb\-1p\-policy\fR
.RS 4
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBconsensus\fR
.RS 4
Discard the version of the secondary if the outcome of the
\fBafter\-sb\-0pri\fR
algorithm would also destroy the current secondary\'s data\&. Otherwise disconnect\&.
.RE
.PP
\fBdiscard\-secondary\fR
.RS 4
Discard the secondary\'s version\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the correct data, call the
\fBpri\-lost\-after\-sb\fR
on the current primary\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the correct data, accept a possible instantaneous change of the primary\'s data\&.
.RE
.RE
.PP
\fB\-C\fR, \fB\-\-after\-sb\-2pri \fR\fIasb\-2p\-policy\fR
.RS 4
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the right data, call the
\fBpri\-lost\-after\-sb\fR
on the current primary\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the right data, accept a possible instantaneous change of the primary\'s data\&.
.RE
.RE
.PP
\fB\-P\fR, \fB\-\-always\-asbp\fR
.RS 4
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\&.
.sp
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 have led to strange UUID sets\&.)
.RE
.PP
\fB\-R\fR, \fB\-\-rr\-conflict \fR\fIrole\-resync\-conflict\-policy\fR
.RS 4
This option sets DRBD\'s behavior when DRBD deduces from its meta data that a resynchronization is needed, and the SyncTarget node is already primary\&. The possible settings are:
\fBdisconnect\fR,
\fBcall\-pri\-lost\fR
and
\fBviolently\fR\&. While
\fBdisconnect\fR
speaks for itself, with the
\fBcall\-pri\-lost\fR
setting the
\fBpri\-lost\fR
handler is called which is expected to either change the role of the node to secondary, or remove the node from the cluster\&. The default is
\fBdisconnect\fR\&.
.sp
With the
\fBviolently\fR
setting you allow DRBD to force a primary node into SyncTarget state\&. This means that the data exposed by DRBD changes to the SyncSource\'s version of the data instantaneously\&. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING\&.
.RE
.PP
\fB\-d\fR, \fB\-\-data\-integrity\-alg \fR\fIhash_alg\fR
.RS 4
DRBD can ensure the data integrity of the user\'s data on the network by comparing hash values\&. Normally this is ensured by the 16 bit checksums in the headers of TCP/IP packets\&. This option can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled\&.
.sp
See also the notes on data integrity on the drbd\&.conf manpage\&.
.RE
.PP
\fB\-o\fR, \fB\-\-no\-tcp\-cork \fR
.RS 4
DRBD usually uses the TCP socket option TCP_CORK to hint to the network stack when it can expect more data, and when it should flush out what it has in its send queue\&. There is at least one network stack that performs worse when one uses this hinting method\&. Therefore we introduced this option, which disable the setting and clearing of the TCP_CORK socket option by DRBD\&.
.RE
.PP
\fB\-p\fR, \fB\-\-ping\-timeout \fR\fIping_timeout\fR
.RS 4
The time the peer has to answer to a keep\-alive packet\&. In case the peer\'s reply is not received within this time period, it is considered dead\&. The default unit is tenths of a second, the default value is 5 (for half a second)\&.
.RE
.PP
\fB\-D\fR, \fB\-\-discard\-my\-data \fR
.RS 4
Use this option to manually recover from a split\-brain situation\&. In case you do not have any automatic after\-split\-brain policies selected, the nodes refuse to connect\&. By passing this option you make this node a sync target immediately after successful connect\&.
.RE
.PP
\fB\-n\fR, \fB\-\-dry\-run \fR
.RS 4
Causes DRBD to abort the connection process after the resync handshake, i\&.e\&. no resync gets performed\&. You can find out which resync DRBD would perform by looking at the kernel\'s log file\&.
.RE
.PP
\fB\-g\fR, \fB\-\-on\-congestion \fR\fIcongestion_policy\fR, \fB\-f\fR, \fB\-\-congestion\-fill \fR\fIfill_threshold\fR, \fB\-h\fR, \fB\-\-congestion\-extents \fR\fIactive_extents_threshold\fR
.RS 4
By default DRBD blocks when the available TCP send queue becomes full\&. That means it will slow down the application that generates the write requests that cause DRBD to send more data down that TCP connection\&.
.sp
When DRBD is deployed with DRBD\-proxy it might be more desirable that DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full\&. In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps the connection open\&.
.sp
The advantage of the AHEAD/BEHIND mode is that the application is not slowed down, even if DRBD\-proxy\'s buffer is not sufficient to buffer all write requests\&. The downside is that the peer node falls behind, and that a resync will be necessary to bring it back into sync\&. During that resync the peer node will have an inconsistent disk\&.
.sp
Available
\fIcongestion_policy\fRs are
\fBblock\fR
and
\fBpull\-ahead\fR\&. The default is
\fBblock\fR\&.
\fIFill_threshold\fR
might be in the range of 0 to 10GiBytes\&. The default is 0 which disables the check\&.
\fIActive_extents_threshold\fR
has the same limits as
\fBal\-extents\fR\&.
.sp
The AHEAD/BEHIND mode and its settings are available since DRBD 8\&.3\&.10\&.
.RE
.SS "syncer"
.\" drbdsetup: syncer
.PP
Changes the synchronization daemon parameters of
\fIdevice\fR
at runtime\&.
.PP
\fB\-r\fR, \fB\-\-rate \fR\fB\fIrate\fR\fR
.RS 4
To ensure smooth operation of the application on top of DRBD, it is possible to limit the bandwidth that may be used by background synchronization\&. The default is 250 KiB/sec, the default unit is KiB/sec\&.
.RE
.PP
\fB\-a\fR, \fB\-\-after \fR\fB\fIminor\fR\fR
.RS 4
Start resync on this device only if the device with
\fIminor\fR
is already in connected state\&. Otherwise this device waits in SyncPause state\&.
.RE
.PP
\fB\-e\fR, \fB\-\-al\-extents \fR\fB\fIextents\fR\fR
.RS 4
DRBD automatically performs hot area detection\&. With this parameter you control how big the hot area (=active set) can get\&. Each extent marks 4M of the backing storage\&. 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
\fIextents\fR
is 127\&. (Minimum: 7, Maximum: 3843)
.RE
.PP
\fB\-v\fR, \fB\-\-verify\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
During online verification (as initiated by the
\fBverify\fR
sub\-command), rather than doing a bit\-wise comparison, DRBD applies a hash function to the contents of every block being verified, and compares that hash with the peer\&. This option defines the hash algorithm being used for that purpose\&. It can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled; you must set this option explicitly in order to be able to use on\-line device verification\&.
.sp
See also the notes on data integrity on the drbd\&.conf manpage\&.
.RE
.PP
\fB\-c\fR, \fB\-\-cpu\-mask \fR\fB\fIcpu\-mask\fR\fR
.RS 4
Sets the cpu\-affinity\-mask for DRBD\'s kernel threads of this device\&. The default value of
\fIcpu\-mask\fR
is 0, which means that DRBD\'s kernel threads should be spread over all CPUs of the machine\&. This value must be given in hexadecimal notation\&. If it is too big it will be truncated\&.
.RE
.PP
\fB\-C\fR, \fB\-\-csums\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
A resync process sends all marked data blocks form the source to the destination node, as long as no
\fBcsums\-alg\fR
is given\&. When one is specified the resync process exchanges hash values of all marked blocks first, and sends only those data blocks over, that have different hash values\&.
.sp
This setting is useful for DRBD setups with low bandwidth links\&. During the restart of a crashed primary node, all blocks covered by the activity log are marked for resync\&. But a large part of those will actually be still in sync, therefore using
\fBcsums\-alg\fR
will lower the required bandwidth in exchange for CPU cycles\&.
.RE
.PP
\fB\-R\fR, \fB\-\-use\-rle\fR
.RS 4
During resync\-handshake, the dirty\-bitmaps of the nodes are exchanged and merged (using bit\-or), so the nodes will have the same understanding of which blocks are dirty\&. On large devices, the fine grained dirty\-bitmap can become large as well, and the bitmap exchange can take quite some time on low\-bandwidth links\&.
.sp
Because the bitmap typically contains compact areas where all bits are unset (clean) or set (dirty), a simple run\-length encoding scheme can considerably reduce the network traffic necessary for the bitmap exchange\&.
.sp
For backward compatibilty reasons, and because on fast links this possibly does not improve transfer time but consumes cpu cycles, this defaults to off\&.
.sp
Introduced in 8\&.3\&.2\&.
.RE
.PP
\fB\-p\fR, \fB\-\-c\-plan\-ahead \fR\fB\fIplan_time\fR\fR, \fB\-s\fR, \fB\-\-c\-fill\-target \fR\fB\fIfill_target\fR\fR, \fB\-d\fR, \fB\-\-c\-delay\-target \fR\fB\fIdelay_target\fR\fR, \fB\-M\fR, \fB\-\-c\-max\-rate \fR\fB\fImax_rate\fR\fR
.RS 4
The dynamic resync speed controller gets enabled with setting
\fIplan_time\fR
to a positive value\&. It aims to fill the buffers along the data path with either a constant amount of data
\fIfill_target\fR, or aims to have a constant delay time of
\fIdelay_target\fR
along the path\&. The controller has an upper bound of
\fImax_rate\fR\&.
.sp
By
\fIplan_time\fR
the agility of the controller is configured\&. Higher values yield for slower/lower responses of the controller to deviation from the target value\&. It should be at least 5 times RTT\&. For regular data paths a
\fIfill_target\fR
in the area of 4k to 100k is appropriate\&. For a setup that contains drbd\-proxy it is advisable to use
\fIdelay_target\fR
instead\&. Only when
\fIfill_target\fR
is set to 0 the controller will use
\fIdelay_target\fR\&. 5 times RTT is a reasonable starting value\&.
\fIMax_rate\fR
should be set to the bandwidth available between the DRBD\-hosts and the machines hosting DRBD\-proxy, or to the available disk\-bandwidth\&.
.sp
The default value of
\fIplan_time\fR
is 0, the default unit is 0\&.1 seconds\&.
\fIFill_target\fR
has 0 and sectors as default unit\&.
\fIDelay_target\fR
has 1 (100ms) and 0\&.1 as default unit\&.
\fIMax_rate\fR
has 10240 (100MiB/s) and KiB/s as default unit\&.
.RE
.PP
\fB\-m\fR, \fB\-\-c\-min\-rate \fR\fB\fImin_rate\fR\fR
.RS 4
We track the disk IO rate caused by the resync, so we can detect non\-resync IO on the lower level device\&. If the lower level device seems to be busy, and the current resync rate is above
\fImin_rate\fR, we throttle the resync\&.
.sp
The default value of
\fImin_rate\fR
is 4M, the default unit is k\&. If you want to not throttle at all, set it to zero, if you want to throttle always, set it to one\&.
.RE
.PP
\fB\-n\fR, \fB\-\-on\-no\-data\-accessible \fR\fB\fIond\-policy\fR\fR
.RS 4
This setting controls what happens to IO requests on a degraded, disk less node (I\&.e\&. no data store is reachable)\&. The available policies are
\fBio\-error\fR
and
\fBsuspend\-io\fR\&.
.sp
If
\fIond\-policy\fR
is set to
\fBsuspend\-io\fR
you can either resume IO by attaching/connecting the last lost data storage, or by the
\fBdrbdadm resume\-io \fR\fB\fIres\fR\fR
command\&. The latter will result in IO errors of course\&.
.sp
The default is
\fBio\-error\fR\&. This setting is available since DRBD 8\&.3\&.9\&.
.RE
.SS "primary"
.\" drbdsetup: primary
.PP
Sets the
\fIdevice\fR
into primary role\&. This means that applications (e\&.g\&. a file system) may open the
\fIdevice\fR
for read and write access\&. Data written to the
\fIdevice\fR
in primary role are mirrored to the device in secondary role\&.
.PP
Normally it is not possible to set both devices of a connected DRBD device pair to primary role\&. By using the
\fB\-\-allow\-two\-primaries\fR
option, you override this behavior and instruct DRBD to allow two primaries\&.
.PP
\fB\-o\fR, \fB\-\-overwrite\-data\-of\-peer\fR
.RS 4
Alias for \-\-force\&.
.RE
.PP
\fB\-f\fR, \fB\-\-force\fR
.RS 4
Becoming primary fails if the local replica is not up\-to\-date\&. I\&.e\&. when it is inconsistent, outdated of consistent\&. By using this option you can force it into primary role anyway\&. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING\&.
.RE
.SS "secondary"
.\" drbdsetup: secondary
.PP
Brings the
\fIdevice\fR
into secondary role\&. This operation fails as long as at least one application (or file system) has opened the device\&.
.PP
It is possible that both devices of a connected DRBD device pair are secondary\&.
.SS "verify"
.\" drbdsetup: verify
.PP
This initiates on\-line device verification\&. During on\-line verification, the contents of every block on the local node are compared to those on the peer node\&. Device verification progress can be monitored via
/proc/drbd\&. Any blocks whose content differs from that of the corresponding block on the peer node will be marked out\-of\-sync in DRBD\'s on\-disk bitmap; they are
\fInot\fR
brought back in sync automatically\&. To do that, simply disconnect and reconnect the resource\&.
.PP
If on\-line verification is already in progress (and this node is "VerifyS"), this command silently "succeeds"\&. In this case, any start\-sector (see below) will be ignored, and any stop\-sector (see below) will be honored\&. This can be used to stop a running verify, or to update/shorten/extend the coverage of the currently running verify\&.
.PP
This command will fail if the
\fIdevice\fR
is not part of a connected device pair\&.
.PP
See also the notes on data integrity on the drbd\&.conf manpage\&.
.PP
\fB\-s\fR, \fB\-\-start \fR\fB\fIstart\-sector\fR\fR
.RS 4
Since version 8\&.3\&.2, on\-line verification should resume from the last position after connection loss\&. It may also be started from an arbitrary position by setting this option\&. If you had reached some stop\-sector before, and you do not specify an explicit start\-sector, verify should resume from the previous stop\-sector\&.
.sp
Default unit is sectors\&. You may also specify a unit explicitly\&. The
\fBstart\-sector\fR
will be rounded down to a multiple of 8 sectors (4kB)\&.
.RE
.PP
\fB\-S\fR, \fB\-\-stop \fR\fB\fIstop\-sector\fR\fR
.RS 4
Since version 8\&.3\&.14, on\-line verification can be stopped before it reaches end\-of\-device\&. This can be
.sp
Default unit is sectors\&. You may also specify a unit explicitly\&. The
\fBstop\-sector\fR
may be updated by issuing an additional drbdsetup verify command on the same node while the verify is running\&.
.RE
.SS "invalidate"
.\" drbdsetup: invalidate
.PP
This forces the local device of a pair of connected DRBD devices into SyncTarget state, which means that all data blocks of the device are copied over from the peer\&.
.PP
This command will fail if the
\fIdevice\fR
is not either part of a connected device pair, or disconnected Secondary\&.
.SS "invalidate\-remote"
.\" drbdsetup: invalidate-remote
.PP
This forces the local device of a pair of connected DRBD devices into SyncSource state, which means that all data blocks of the device are copied to the peer\&.
.PP
On a disconnected Primary device, this will set all bits in the out of sync bitmap\&. As a side affect this suspends updates to the on disk activity log\&. Updates to the on disk activity log resume automatically when necessary\&.
.SS "wait\-connect"
.\" drbdsetup: wait-connect
.PP
Returns as soon as the
\fIdevice\fR
can communicate with its partner device\&.
.PP
\fB\-t\fR, \fB\-\-wfc\-timeout \fR\fB\fIwfc_timeout\fR\fR, \fB\-d\fR, \fB\-\-degr\-wfc\-timeout \fR\fB\fIdegr_wfc_timeout\fR\fR, \fB\-o\fR, \fB\-\-outdated\-wfc\-timeout \fR\fB\fIoutdated_wfc_timeout\fR\fR, \fB\-w\fR, \fB\-\-wait\-after\-sb\fR
.RS 4
This command will fail if the
\fIdevice\fR
cannot communicate with its partner for
\fItimeout\fR
seconds\&. If the peer was working before this node was rebooted, the
\fIwfc_timeout\fR
is used\&. If the peer was already down before this node was rebooted, the
\fIdegr_wfc_timeout\fR
is used\&. If the peer was sucessfully outdated before this node was rebooted the
\fIoutdated_wfc_timeout\fR
is used\&. The default value for all those timeout values is 0 which means to wait forever\&. In case the connection status goes down to StandAlone because the peer appeared but the devices had a split brain situation, the default for the command is to terminate\&. You can change this behavior with the
\fB\-\-wait\-after\-sb\fR
option\&.
.RE
.SS "wait\-sync"
.\" drbdsetup: wait-sync
.PP
Returns as soon as the
\fIdevice\fR
leaves any synchronization into connected state\&. The options are the same as with the
\fIwait\-connect\fR
command\&.
.SS "disconnect"
.\" drbdsetup: disconnect
.PP
Removes the information set by the
\fBnet\fR
command from the
\fIdevice\fR\&. This means that the
\fIdevice\fR
goes into unconnected state and will no longer listen for incoming connections\&.
.SS "detach"
.\" drbdsetup: detach
.PP
Removes the information set by the
\fBdisk\fR
command from the
\fIdevice\fR\&. This means that the
\fIdevice\fR
is detached from its backing storage device\&.
.PP
\fB\-f\fR, \fB\-\-force\fR
.RS 4
A regular detach returns after the disk state finally reached diskless\&. As a consequence detaching from a frozen backing block device never terminates\&.
.sp
On the other hand A forced detach returns immediately\&. It allows you to detach DRBD from a frozen backing block device\&. Please note that the disk will be marked as failed until all pending IO requests where finished by the backing block device\&.
.RE
.SS "down"
.\" drbdsetup: down
.PP
Removes all configuration information from the
\fIdevice\fR
and forces it back to unconfigured state\&.
.SS "role"
.\" drbdsetup: role
.PP
Shows the current roles of the
\fIdevice\fR
and its peer, as
\fIlocal\fR/\fIpeer\fR\&.
.SS "state"
.\" drbdsetup: state
.PP
Deprecated alias for "role"
.SS "cstate"
.\" drbdsetup: cstate
.PP
Shows the current connection state of the
\fIdevice\fR\&.
.SS "dstate"
.\" drbdsetup: dstate
.PP
Shows the current states of the backing storage devices, as
\fIlocal\fR/\fIpeer\fR\&.
.SS "status"
.\" drbdsetup: status
.PP
Shows the current status of the device in XML\-like format\&. Example output:
.sp
.if n \{\
.RS 4
.\}
.nf
.fi
.if n \{\
.RE
.\}
.sp
.SS "resize"
.\" drbdsetup: resize
.PP
This causes DRBD to reexamine the size of the
\fIdevice\fR\'s backing storage device\&. To actually do online growing you need to extend the backing storages on both devices and call the
\fBresize\fR
command on one of your nodes\&.
.PP
The
\fB\-\-assume\-peer\-has\-space\fR
allows you to resize a device which is currently not connected to the peer\&. Use with care, since if you do not resize the peer\'s disk as well, further connect attempts of the two will fail\&.
.PP
When the
\fB\-\-assume\-clean\fR
option is given DRBD will skip the resync of the new storage\&. Only do this if you know that the new storage was initialized to the same content by other means\&.
.SS "check\-resize"
.\" drbdsetup: check-resize
.PP
To enable DRBD to detect offline resizing of backing devices this command may be used to record the current size of backing devices\&. The size is stored in files in /var/lib/drbd/ named drbd\-minor\-??\&.lkbd
.PP
This command is called by
\fBdrbdadm resize \fR\fB\fIres\fR\fR
after
\fBdrbdsetup \fR\fB\fIdevice\fR\fR\fB resize\fR
returned\&.
.SS "pause\-sync"
.\" drbdsetup: pause-sync
.PP
Temporarily suspend an ongoing resynchronization by setting the local pause flag\&. Resync only progresses if neither the local nor the remote pause flag is set\&. It might be desirable to postpone DRBD\'s resynchronization after eventual resynchronization of the backing storage\'s RAID setup\&.
.SS "resume\-sync"
.\" drbdsetup: resume-sync
.PP
Unset the local sync pause flag\&.
.SS "outdate"
.\" drbdsetup: outdate
.PP
Mark the data on the local backing storage as outdated\&. An outdated device refuses to become primary\&. This is used in conjunction with
\fBfencing\fR
and by the peer\'s
\fBfence\-peer\fR
handler\&.
.SS "show\-gi"
.\" drbdsetup: show-gi
.PP
Displays the device\'s data generation identifiers verbosely\&.
.SS "get\-gi"
.\" drbdsetup: get-gi
.PP
Displays the device\'s data generation identifiers\&.
.SS "show"
.\" drbdsetup: show
.PP
Shows all available configuration information of the
\fIdevice\fR\&.
.SS "suspend\-io"
.\" drbdsetup: suspend-io
.PP
This command is of no apparent use and just provided for the sake of completeness\&.
.SS "resume\-io"
.\" drbdsetup: resume-io
.PP
If the fence\-peer handler fails to stonith the peer node, and your
\fBfencing\fR
policy is set to resource\-and\-stonith, you can unfreeze IO operations with this command\&.
.SS "events"
.\" drbdsetup: events
.PP
Displays every state change of DRBD and all calls to helper programs\&. This might be used to get notified of DRBD\'s state changes by piping the output to another program\&.
.PP
\fB\-a\fR, \fB\-\-all\-devices\fR
.RS 4
Display the events of all DRBD minors\&.
.RE
.PP
\fB\-u\fR, \fB\-\-unfiltered\fR
.RS 4
This is a debugging aid that displays the content of all received netlink messages\&.
.RE
.SS "new\-current\-uuid"
.\" drbdsetup: new-current-uuid
.PP
Generates a new current UUID and rotates all other UUID values\&. This has at least two use cases, namely to skip the initial sync, and to reduce network bandwidth when starting in a single node configuration and then later (re\-)integrating a remote site\&.
.PP
Available option:
.PP
\fB\-c\fR, \fB\-\-clear\-bitmap\fR
.RS 4
Clears the sync bitmap in addition to generating a new current UUID\&.
.RE
.PP
This can be used to skip the initial sync, if you want to start from scratch\&. This use\-case does only work on "Just Created" meta data\&. Necessary steps:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
On
\fIboth\fR
nodes, initialize meta data and configure the device\&.
.sp
\fBdrbdadm \-\- \-\-force create\-md \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
They need to do the initial handshake, so they know their sizes\&.
.sp
\fBdrbdadm up \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
They are now Connected Secondary/Secondary Inconsistent/Inconsistent\&. Generate a new current\-uuid and clear the dirty bitmap\&.
.sp
\fBdrbdadm \-\- \-\-clear\-bitmap new\-current\-uuid \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
They are now Connected Secondary/Secondary UpToDate/UpToDate\&. Make one side primary and create a file system\&.
.sp
\fBdrbdadm primary \fR\fB\fIres\fR\fR
.sp
\fBmkfs \-t \fR\fB\fIfs\-type\fR\fR\fB $(drbdadm sh\-dev \fR\fB\fIres\fR\fR\fB)\fR
.RE
.sp
.RE
.PP
One obvious side\-effect is that the replica is full of old garbage (unless you made them identical using other means), so any online\-verify is expected to find any number of out\-of\-sync blocks\&.
.PP
\fIYou must not use this on pre\-existing data!\fR
Even though it may appear to work at first glance, once you switch to the other node, your data is toast, as it never got replicated\&. So
\fIdo not leave out the mkfs\fR
(or equivalent)\&.
.PP
This can also be used to shorten the initial resync of a cluster where the second node is added after the first node is gone into production, by means of disk shipping\&. This use\-case works on disconnected devices only, the device may be in primary or secondary role\&.
.PP
The necessary steps on the current active server are:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
\fBdrbdsetup \fR\fB\fIdevice\fR\fR\fB new\-current\-uuid \-\-clear\-bitmap\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
Take the copy of the current active server\&. E\&.g\&. by pulling a disk out of the RAID1 controller, or by copying with dd\&. You need to copy the actual data, and the meta data\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
\fBdrbdsetup \fR\fB\fIdevice\fR\fR\fB new\-current\-uuid\fR
.RE
.sp
.RE
Now add the disk to the new secondary node, and join it to the cluster\&. You will get a resync of that parts that were changed since the first call to
\fBdrbdsetup\fR
in step 1\&.
.SH "EXAMPLES"
.PP
For examples, please have a look at the
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fBDRBD web site\fR\m[]\&\s-2\u[2]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD User's Guide
.RS 4
\%http://www.drbd.org/users-guide/
.RE
.IP " 2." 4
DRBD web site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v83/drbdadm.xml 0000644 0001750 0001750 00000051326 12466702073 021131 0 ustar apoikos apoikos
5 Dec 2008DRBD8.3.2drbdadm8System AdministrationdrbdadmAdministration tool for DRBD
drbdadmdrbdadm-d-cfile-tfile-scmd-mcmd-S-hhost--backend-optionscommandallresourceDescription is the high level tool of the DRBD program suite. is to
and what / is to . reads its
configuration file and performs the specified commands by calling the
and/or the program.
Options, Just prints the calls of to stdout, but does not run
the commands.
, file Specifies the configuration file drbdadm will use. If this parameter
is not specified, drbdadm will look for ,
and .
, file Specifies an additional configuration file drbdadm to check. This option
is only allowed with the dump and the sh-nop commands.
, file Specifies the full path to the program. If this option is
omitted, drbdadm will look for and .
, file Specifies the full path to the program. If this option is
omitted, drbdadm will look for and
.
, Specifies that this command should be performed on a stacked resource.
, Specifies to which peer node to connect. Only necessary if there are
more than two host sections in the resource you are working on.
backend-optionsAll options following the doubly hyphen are considered backend-options.
These are passed through to the backend command. I.e. to ,
or .
Commandsattach Attaches a local backing block device to the DRBD resource's device.
detachdrbdadmdetach
Removes the backing storage device from a DRBD resource's device.
connectdrbdadmconnect
Sets up the network configuration of the resource's device. If the
peer device is already configured, the two DRBD devices will connect.
If there are more than two host sections in the resource you need
to use the option to select the peer you want to
connect to.
disconnectdrbdadmdisconnect
Removes the network configuration from the resource. The device
will then go into StandAlone state.
syncerdrbdadmsyncer
Loads the resynchronization parameters into the device.
updrbdadmup
Is a shortcut for attach and connect.
downdrbdadmdown
Is a shortcut for disconnect and detach.
primarydrbdadmprimary
Promote the resource's device into primary role. You need to do
this before any access to the device, such as creating or mounting a file system.
secondarydrbdadmsecondary
Brings the device back into secondary role. This is needed since in
a connected DRBD device pair, only one of the two peers may have
primary role (except if is explicitly set in
the configuration file).
invalidatedrbdadminvalidate
Forces DRBD to consider the data on the local backing
storage device as out-of-sync. Therefore DRBD will copy each
and every block from its peer, to bring the local storage
device back in sync.
To avoid races, you need an established replication link,
or be disconnected Secondary.
invalidate-remotedrbdadminvalidate-remote
This command is similar to the invalidate command, however, the
peer's backing storage is invalidated and hence rewritten
with the data of the local node.
To avoid races, you need an established replication link,
or be disconnected Primary.
resizedrbdadmresize
Causes DRBD to re-examine all sizing constraints, and resize the
resource's device accordingly. For example, if you increased the
size of your backing storage devices (on both nodes, of course),
then DRBD will adopt the new size after you called
this command on one of your nodes. Since new storage space must be
synchronised this command only works if there is at least one primary
node present.
The allows you to
resize a device which is currently not connected to the peer.
Use with care, since if you do not resize the peer's disk as well,
further connect attempts of the two will fail.
The allows you to resize an existing device and avoid
syncing the new space. This is useful when adding addtional blank storage to your device.
Example:
# drbdadm -- --assume-clean resize r0check-resizedrbdadmcheck-resize
Calls drbdmeta to eventually move internal meta data. If the backing
device was resized, while DRBD was not running, meta data has to be
moved to the end of the device, so that the next command
can succeed.
create-mddrbdadmcreate-md
Initializes the meta data storage. This needs to be
done before a DRBD resource can be taken online for the first
time. In case of issues with that command have a look at
drbdmeta8get-gidrbdadmget-gi
Shows a short textual representation of the data generation
identifiers.
show-gidrbdadmshow-gi
Prints a textual representation of the data generation
identifiers including explanatory information.
dump-mddrbdadmdump-md
Dumps the whole contents of the meta data storage, including
the stored bit-map and activity-log, in a textual representation.
outdatedrbdadmoutdate
Sets the outdated flag in the meta data.
adjustdrbdadmadjust
Synchronizes the configuration of the device with your configuration
file. You should always examine the output of the dry-run
mode before actually executing this command.
wait-connectdrbdadmwait-connect
Waits until the device is connected to its peer device.
roledrbdadmrole
Shows the current roles of the devices (local/peer).
E.g. Primary/Secondary
statedrbdadmstate
Deprecated alias for "role", see above.
cstatedrbdadmcstate
Shows the current connection state of the devices.
statusdrbdadmstatus
Shows the current status of all devices defined in the current config file,
in XML-like format. Example output:
<drbd-status version="8.3.2" api="88">
<resources config_file="/etc/drbd.conf">
<resource minor="0" name="s0" cs="SyncTarget" st1="Secondary" st2="Secondary"
ds1="Inconsistent" ds2="UpToDate" resynced_precent="5.9" />
<resource minor="1" name="s1" cs="WFConnection" st1="Secondary"
st2="Unknown" ds1="Inconsistent" ds2="Outdated" />
<resource minor="3" name="dummy" cs="Unconfigured" />
<!-- resource minor="4" name="scratch" not available or not yet created -->
</resources>
</drbd-status>dumpdrbdadmdump
Just parse the configuration file and dump it to stdout. May
be used to check the configuration file for syntactic correctness.
outdatedrbdadmoutdate
Used to mark the node's data as outdated. Usually used by the
peer's fence-peer handler.
verifydrbdadmverify
Starts online verify. During online verify, data on
both nodes is compared for equality. See
/proc/drbd for online verify progress. If out-of-sync
blocks are found, they are not resynchronized
automatically. To do that, disconnect and
connect the resource when verification has completed.
See also the notes on data integrity on the drbd.conf manpage.pause-syncdrbdadmpause-sync
Temporarily suspend an ongoing resynchronization by setting the
local pause flag. Resync only progresses if neither the local
nor the remote pause flag is set. It might be desirable to
postpone DRBD's resynchronization until after any
resynchronization of the backing storage's RAID setup.
resume-syncdrbdadmresume-sync
Unset the local sync pause flag.
new-current-uuiddrbdadmnew-current-uuid
Generates a new currend UUID and rotates all other UUID values.
This can be used to shorten the initial resync of a cluster.
See the manpage for a more details.
dstatedrbdadmdstate
Show the current state of the backing storage devices. (local/peer)
hidden-commands Shows all commands undocumented on purpose.
VersionThis document was revised for version 8.3.2 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.comReporting BugsReport bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbd.conf5,
drbd8,
drbddisk8,
drbdsetup8,
drbdmeta8 and the
DRBD project web site
drbd-utils-8.9.6/documentation/v83/drbdmeta.xml 0000644 0001750 0001750 00000022053 12466702073 021311 0 ustar apoikos apoikos
15 Oct 2008DRBD8.3.2drbdmeta8System AdministrationdrbdmetaDRBD's meta data management tool
drbdmetadrbdmeta--force--ignore-sanity-checksdevicev06 minorv07 meta_dev indexv08 meta_dev indexcommandcmd argsDescription Drbdmeta is used to create, display and modify the contents of
DRBD's meta data storage. Usually you do not want to use this
command directly, but start it via the frontend
drbdadm8.
This command only works if the DRBD resource is currently down,
or at least detached from its backing storage. The first parameter
is the device node associated to the resource. With the second
parameter you can select the version of the meta data. Currently
all major DRBD releases (0.6, 0.7 and 8) are supported.
Options--forcedrbdmeta--force
All questions that get asked by drbdmeta are treated as if
the user answered 'yes'.--ignore-sanity-checksdrbdmeta--ignore-sanity-checks
Some sanity checks cause drbdmeta to terminate. E.g. if a file system image would get
destroyed by creating the meta data. By using that option you can force drbdmeta
to ignore these checks.Commandscreate-md drbdmetacreate-md
Create-md initializes the meta data storage. This needs to be
done before a DRBD resource can be taken online for the first
time. In case there is already a meta data signature of an
older format in place, drbdmeta will ask you if it should
convert the older format to the selected format.
If you will use the resource before it is connected to its peer
for the first time DRBD may perform better if you use the
option. For DRBD versions of
the peer use up to these values: <8.3.7 -> 4k, 8.3.8 -> 32k, 8.3.9 -> 128k, 8.4.0 -> 1M.
get-gidrbdmetaget-gi
Get-gi shows a short textual representation of the data generation
identifier. In version 0.6 and 0.7 these are generation counters,
while in version 8 it is a set of UUIDs.
show-gidrbdmetashow-gi
Show-gi prints a textual representation of the data generation
identifiers including explanatory information.
dump-mddrbdmetadump-md
Dumps the whole contents of the meta data storage including
the stored bit-map and activity-log in a textual representation.
outdatedrbdmetaoutdate
Sets the outdated flag in the meta data. This is used by the
peer node when it wants to become primary, but cannot
communicate with the DRBD stack on this host.
dstatedrbdmetadstate
Prints the state of the data on the backing storage. The output
is always followed by '/DUnknown' since drbdmeta only looks
at the local meta data.
check-resizedrbdmetacheck-resize
Examines the device size of a backing device, and it's last known device size,
recorded in a file /var/lib/drbd/drbd-minor-??.lkbd. In case the size of the
backing device changed, and the meta data can be found at the old position,
it moves the meta data to the right position at the end of the block device.
Expert's commands Drbdmeta allows you to modify the meta data as well. This is
intentionally omitted for the command's usage output, since you
should only use it if you really know what you are doing.
By setting the generation identifiers to wrong values, you
risk to overwrite your up-to-data data with an older version
of your data.
set-gi gidrbdmetaset-gi
Set-gi allows you to set the generation identifier.
Gi needs to be a generation
counter for the 0.6 and 0.7 format, and a UUID set for 8.x.
Specify it in the same way as get-gi shows it.
restore-md dump_filedrbdmetarestore-md
Reads the dump_file and writes
it to the meta data.
VersionThis document was revised for version 8.3.2 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting BugsReport bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbdadm8
drbd-utils-8.9.6/documentation/v83/Makefile.in 0000644 0001750 0001750 00000007476 12634271674 021073 0 ustar apoikos apoikos # Makefile in documentation directory
#
# This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
#
# drbd is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# drbd is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with drbd; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# variables set by configure
DISTRO = @DISTRO@
prefix = @prefix@
exec_prefix = @exec_prefix@
localstatedir = @localstatedir@
datarootdir = @datarootdir@
datadir = @datadir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
mandir = @mandir@
BASH_COMPLETION_SUFFIX = @BASH_COMPLETION_SUFFIX@
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
INITDIR = @INITDIR@
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
CC = @CC@
CFLAGS = @CFLAGS@
XSLTPROC = @XSLTPROC@
# features enabled or disabled by configure
WITH_83_SUPPORT = @WITH_83_SUPPORT@
WITH_UDEV = @WITH_UDEV@
WITH_XEN = @WITH_XEN@
WITH_PACEMAKER = @WITH_PACEMAKER@
WITH_HEARTBEAT = @WITH_HEARTBEAT@
WITH_RGMANAGER = @WITH_RGMANAGER@
WITH_BASHCOMPLETION = @WITH_BASHCOMPLETION@
# variables meant to be overridden from the make command line
DESTDIR ?= /
# Needed for pattern substitution
SHELL=/bin/bash
MANPAGES := drbdsetup.8 drbd.conf.5 drbd.8 drbdadm.8 drbdmeta.8
ifeq ($(WITH_HEARTBEAT),yes)
MANPAGES += drbddisk.8
endif
SOURCES := $(wildcard *.xml)
STYLESHEET_PREFIX ?= http://docbook.sourceforge.net/release/xsl/current
MANPAGES_STYLESHEET ?= $(STYLESHEET_PREFIX)/manpages/docbook.xsl
HTML_STYLESHEET ?= $(STYLESHEET_PREFIX)/xhtml/docbook.xsl
FO_STYLESHEET ?= $(STYLESHEET_PREFIX)/fo/docbook.xsl
XSLTPROC_OPTIONS ?= --xinclude
XSLTPROC_MANPAGES_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_HTML_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_FO_OPTIONS ?= $(XSLTPROC_OPTIONS)
make_doc := $(shell $(XSLTPROC) \
$(XSLTPROC_MANPAGES_OPTIONS) \
$(MANPAGES_STYLESHEET) < /dev/null > /dev/null 2>&1 && echo doc )
ifeq ($(make_doc),doc)
all: doc
else
all:
@echo "To (re)make the documentation: make doc"
endif
clean:
@echo "To clean the documentation: make doc-clean"
ifeq ($(WITH_83_SUPPORT),yes)
doc: man
else
doc:
endif
doc-clean: distclean
####### Implicit rules
.SUFFIXES: .sgml .5 .8 .html .pdf .ps
%.5 %.8: %.xml
$(XSLTPROC) \
$(XSLTPROC_MANPAGES_OPTIONS) \
$(MANPAGES_STYLESHEET) $<
%.html: %.xml
$(XSLTPROC) -o $@ \
$(XSLTPROC_HTML_OPTIONS) \
$(HTML_STYLESHEET) $<
%.fo: %.xml
$(XSLTPROC) -o $@ \
$(XSLTPROC_FO_OPTIONS) \
$(FO_STYLESHEET) $<
distclean:
rm -f *.[58] manpage.links manpage.refs *~ manpage.log
rm -f *.ps.gz *.pdf *.ps *.html pod2htm*
#######
man: $(MANPAGES)
install:
ifeq ($(WITH_83_SUPPORT),yes)
@ok=true; for f in $(MANPAGES) ; \
do [ -e $$f ] || { echo $$f missing ; ok=false; } ; \
done ; $$ok
set -e; for f in $(MANPAGES) ; do \
s=$${f##*.}; \
b=$${f%.[0-9]}; \
install -v -D -m 644 $$f $(DESTDIR)$(mandir)/man$$s/$$b-8.3.$$s ; \
done
endif
uninstall:
ifeq ($(WITH_83_SUPPORT),yes)
@ set -e; for f in $(MANPAGES) ; do \
s=$${f##*.}; \
b=$${f%.[0-9]}; \
rm -v $(DESTDIR)$(mandir)/man$$s/$$b-8.3.$$s ; \
done
endif
html: $(SOURCES:.xml=.html)
pdf: $(SOURCES:.xml=.pdf)
ps: $(SOURCES:.xml=.ps)
../../configure:
@echo "please (re-)run ./autogen.sh with appropriate arguments"; exit 1
../../config.status: ../../configure
@echo "please (re-)run ./configure with appropriate arguments"; exit 1
Makefile.in: ;
Makefile: Makefile.in ../../config.status
cd ../.. && ./config.status documentation/v83/Makefile
drbd-utils-8.9.6/documentation/v83/drbd.xml 0000644 0001750 0001750 00000006702 12466702073 020445 0 ustar apoikos apoikos
drbdThe start and stop script for DRBDDRBD8.3.215 Oct 2008drbd8System Administration/etc/init.d/drbdresourcestartstopstatusreloadrestartforce-reloadIntroduction The script is used
to start and stop drbd on a system V style init system.
In order to use you must define
a resource, a host, and any other configuration options in the drbd
configuration file. See for details.
If resource is omitted, then all of the
resources listed in the config file are configured.
This script might ask you Do you want to abort waiting for
other server and make this one primary? Only answer this question with yes if you are sure
that it is impossible to repair the other node.
VersionThis document was revised for version 8.3.2 of the DRBD distribution.
Author Written by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting Bugs Report bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 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.
See Alsodrbd.conf5,
drbddisk8,
drbdsetup8drbdadm8DRBD Homepage
drbd-utils-8.9.6/documentation/v83/drbddisk.8 0000644 0001750 0001750 00000004321 12654452465 020670 0 ustar apoikos apoikos '\" t
.\" Title: drbddisk
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 15 Oct 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBDDISK" "8" "15 Oct 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbddisk \- Script to mark devices as primary and mount file systems
.SH "SYNOPSIS"
.HP \w'\fB/etc/ha\&.d/resource\&.d/drbddisk\fR\ 'u
\fB/etc/ha\&.d/resource\&.d/drbddisk\fR [\fIresource\fR] {{start}\ |\ {stop}\ |\ {status}}
.SH "INTRODUCTION"
.PP
The
\fB/etc/ha\&.d/resource\&.d/drbddisk\fR
script brings the local device of
\fIresource\fR
into primary role\&. It is designed to be used by Heartbeat\&.
.PP
In order to use
\fB/etc/ha\&.d/resource\&.d/drbddisk\fR
you must define a resource, a host, and any other configuration options in the DRBD configuration file\&. See
\fB/etc/drbd\&.conf\fR
for details\&. If
\fIresource\fR
is omitted, then all of the resources listed in the config file are affected\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.0\&.14 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbdsetup\fR(8)\fBdrbdadm\fR(8)\m[blue]\fBDRBD Homepage\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD Homepage
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v83/drbdadm.8 0000644 0001750 0001750 00000025143 12654452464 020503 0 ustar apoikos apoikos '\" t
.\" Title: drbdadm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 5 Dec 2008
.\" Manual: System Administration
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBDADM" "8" "5 Dec 2008" "DRBD 8.3.2" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdadm \- Administration tool for DRBD .\" drbdadm
.SH "SYNOPSIS"
.HP \w'\fBdrbdadm\fR\ 'u
\fBdrbdadm\fR [\-d] [\-c\ {\fIfile\fR}] [\-t\ {\fIfile\fR}] [\-s\ {\fIcmd\fR}] [\-m\ {\fIcmd\fR}] [\-S] [\-h\ {\fIhost\fR}] [\-\-\ {\fIbackend\-options\fR}] {\fIcommand\fR} [all | \fIresource\fR...]
.SH "DESCRIPTION"
.PP
\fBDrbdadm\fR
is the high level tool of the DRBD program suite\&.
\fBDrbdadm\fR
is to
\fBdrbdsetup\fR
and
\fBdrbdmeta\fR
what
\fBifup\fR/\fBifdown\fR
is to
\fBifconfig\fR\&.
\fBDrbdadm\fR
reads its configuration file and performs the specified commands by calling the
\fBdrbdsetup\fR
and/or the
\fBdrbdmeta\fR
program\&.
.SH "OPTIONS"
.PP
\fB\-d\fR, \fB\-\-dry\-run\fR
.RS 4
Just prints the calls of
\fBdrbdsetup\fR
to stdout, but does not run the commands\&.
.RE
.PP
\fB\-c\fR, \fB\-\-config\-file\fR \fIfile\fR
.RS 4
Specifies the configuration file drbdadm will use\&. If this parameter is not specified, drbdadm will look for
\fB/etc/drbd\-83\&.conf\fR,
\fB/etc/drbd\-08\&.conf\fR
and
\fB/etc/drbd\&.conf\fR\&.
.RE
.PP
\fB\-t\fR, \fB\-\-config\-to\-test\fR \fIfile\fR
.RS 4
Specifies an additional configuration file drbdadm to check\&. This option is only allowed with the dump and the sh\-nop commands\&.
.RE
.PP
\fB\-s\fR, \fB\-\-drbdsetup\fR \fIfile\fR
.RS 4
Specifies the full path to the
\fBdrbdsetup\fR
program\&. If this option is omitted, drbdadm will look for
\fB/sbin/drbdsetup\fR
and
\fB\&./drbdsetup\fR\&.
.RE
.PP
\fB\-m\fR, \fB\-\-drbdmeta\fR \fIfile\fR
.RS 4
Specifies the full path to the
\fBdrbdmeta\fR
program\&. If this option is omitted, drbdadm will look for
\fB/sbin/drbdmeta\fR
and
\fB\&./drbdmeta\fR\&.
.RE
.PP
\fB\-S\fR, \fB\-\-stacked\fR
.RS 4
Specifies that this command should be performed on a stacked resource\&.
.RE
.PP
\fB\-P\fR, \fB\-\-peer\fR
.RS 4
Specifies to which peer node to connect\&. Only necessary if there are more than two host sections in the resource you are working on\&.
.RE
.PP
\fB\-\-\fR \fIbackend\-options\fR
.RS 4
All options following the doubly hyphen are considered
\fIbackend\-options\fR\&. These are passed through to the backend command\&. I\&.e\&. to
\fBdrbdsetup\fR,
\fBdrbdmeta\fR
or
\fBdrbd\-proxy\-ctl\fR\&.
.RE
.SH "COMMANDS"
.PP
attach
.RS 4
Attaches a local backing block device to the DRBD resource\'s device\&.
.RE
.PP
detach
.RS 4
.\" drbdadm: detach
Removes the backing storage device from a DRBD resource\'s device\&.
.RE
.PP
connect
.RS 4
.\" drbdadm: connect
Sets up the network configuration of the resource\'s device\&. If the peer device is already configured, the two DRBD devices will connect\&. If there are more than two host sections in the resource you need to use the
\fB\-\-peer\fR
option to select the peer you want to connect to\&.
.RE
.PP
disconnect
.RS 4
.\" drbdadm: disconnect
Removes the network configuration from the resource\&. The device will then go into StandAlone state\&.
.RE
.PP
syncer
.RS 4
.\" drbdadm: syncer
Loads the resynchronization parameters into the device\&.
.RE
.PP
up
.RS 4
.\" drbdadm: up
Is a shortcut for attach and connect\&.
.RE
.PP
down
.RS 4
.\" drbdadm: down
Is a shortcut for disconnect and detach\&.
.RE
.PP
primary
.RS 4
.\" drbdadm: primary
Promote the resource\'s device into primary role\&. You need to do this before any access to the device, such as creating or mounting a file system\&.
.RE
.PP
secondary
.RS 4
.\" drbdadm: secondary
Brings the device back into secondary role\&. This is needed since in a connected DRBD device pair, only one of the two peers may have primary role (except if
\fBallow\-two\-primaries\fR
is explicitly set in the configuration file)\&.
.RE
.PP
invalidate
.RS 4
.\" drbdadm: invalidate
Forces DRBD to consider the data on the
\fIlocal\fR
backing storage device as out\-of\-sync\&. Therefore DRBD will copy each and every block from its peer, to bring the local storage device back in sync\&. To avoid races, you need an established replication link, or be disconnected Secondary\&.
.RE
.PP
invalidate\-remote
.RS 4
.\" drbdadm: invalidate-remote
This command is similar to the invalidate command, however, the
\fIpeer\'s\fR
backing storage is invalidated and hence rewritten with the data of the local node\&. To avoid races, you need an established replication link, or be disconnected Primary\&.
.RE
.PP
resize
.RS 4
.\" drbdadm: resize
Causes DRBD to re\-examine all sizing constraints, and resize the resource\'s device accordingly\&. For example, if you increased the size of your backing storage devices (on both nodes, of course), then DRBD will adopt the new size after you called this command on one of your nodes\&. Since new storage space must be synchronised this command only works if there is at least one primary node present\&.
.sp
The
\fB\-\-assume\-peer\-has\-space\fR
allows you to resize a device which is currently not connected to the peer\&. Use with care, since if you do not resize the peer\'s disk as well, further connect attempts of the two will fail\&.
.sp
The
\fB\-\-assume\-clean\fR
allows you to resize an existing device and avoid syncing the new space\&. This is useful when adding addtional blank storage to your device\&. Example:
.sp
.if n \{\
.RS 4
.\}
.nf
# drbdadm \-\- \-\-assume\-clean resize r0
.fi
.if n \{\
.RE
.\}
.sp
.RE
.PP
check\-resize
.RS 4
.\" drbdadm: check-resize
Calls drbdmeta to eventually move internal meta data\&. If the backing device was resized, while DRBD was not running, meta data has to be moved to the end of the device, so that the next
\fBattach\fR
command can succeed\&.
.RE
.PP
create\-md
.RS 4
.\" drbdadm: create-md
Initializes the meta data storage\&. This needs to be done before a DRBD resource can be taken online for the first time\&. In case of issues with that command have a look at
\fBdrbdmeta\fR(8)
.RE
.PP
get\-gi
.RS 4
.\" drbdadm: get-gi
Shows a short textual representation of the data generation identifiers\&.
.RE
.PP
show\-gi
.RS 4
.\" drbdadm: show-gi
Prints a textual representation of the data generation identifiers including explanatory information\&.
.RE
.PP
dump\-md
.RS 4
.\" drbdadm: dump-md
Dumps the whole contents of the meta data storage, including the stored bit\-map and activity\-log, in a textual representation\&.
.RE
.PP
outdate
.RS 4
.\" drbdadm: outdate
Sets the outdated flag in the meta data\&.
.RE
.PP
adjust
.RS 4
.\" drbdadm: adjust
Synchronizes the configuration of the device with your configuration file\&. You should always examine the output of the dry\-run mode before actually executing this command\&.
.RE
.PP
wait\-connect
.RS 4
.\" drbdadm: wait-connect
Waits until the device is connected to its peer device\&.
.RE
.PP
role
.RS 4
.\" drbdadm: role
Shows the current roles of the devices (local/peer)\&. E\&.g\&. Primary/Secondary
.RE
.PP
state
.RS 4
.\" drbdadm: state
Deprecated alias for "role", see above\&.
.RE
.PP
cstate
.RS 4
.\" drbdadm: cstate
Shows the current connection state of the devices\&.
.RE
.PP
status
.RS 4
.\" drbdadm: status
Shows the current status of all devices defined in the current config file, in XML\-like format\&. Example output:
.sp
.if n \{\
.RS 4
.\}
.nf
.fi
.if n \{\
.RE
.\}
.sp
.RE
.PP
dump
.RS 4
.\" drbdadm: dump
Just parse the configuration file and dump it to stdout\&. May be used to check the configuration file for syntactic correctness\&.
.RE
.PP
outdate
.RS 4
.\" drbdadm: outdate
Used to mark the node\'s data as outdated\&. Usually used by the peer\'s fence\-peer handler\&.
.RE
.PP
verify
.RS 4
.\" drbdadm: verify
Starts online verify\&. During online verify, data on both nodes is compared for equality\&. See
/proc/drbd
for online verify progress\&. If out\-of\-sync blocks are found, they are
\fInot\fR
resynchronized automatically\&. To do that,
\fBdisconnect\fR
and
\fBconnect\fR
the resource when verification has completed\&.
.sp
See also the notes on data integrity on the drbd\&.conf manpage\&.
.RE
.PP
pause\-sync
.RS 4
.\" drbdadm: pause-sync
Temporarily suspend an ongoing resynchronization by setting the local pause flag\&. Resync only progresses if neither the local nor the remote pause flag is set\&. It might be desirable to postpone DRBD\'s resynchronization until after any resynchronization of the backing storage\'s RAID setup\&.
.RE
.PP
resume\-sync
.RS 4
.\" drbdadm: resume-sync
Unset the local sync pause flag\&.
.RE
.PP
new\-current\-uuid
.RS 4
.\" drbdadm: new-current-uuid
Generates a new currend UUID and rotates all other UUID values\&.
.sp
This can be used to shorten the initial resync of a cluster\&. See the
\fBdrbdsetup\fR
manpage for a more details\&.
.RE
.PP
dstate
.RS 4
.\" drbdadm: dstate
Show the current state of the backing storage devices\&. (local/peer)
.RE
.PP
hidden\-commands
.RS 4
Shows all commands undocumented on purpose\&.
.RE
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8),
\fBdrbdmeta\fR(8)
and the
\m[blue]\fBDRBD project web site\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD project web site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v83/drbd.conf.5 0000644 0001750 0001750 00000135521 12654452463 020743 0 ustar apoikos apoikos '\" t
.\" Title: drbd.conf
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 5 Dec 2008
.\" Manual: Configuration Files
.\" Source: DRBD 8.3.2
.\" Language: English
.\"
.TH "DRBD\&.CONF" "5" "5 Dec 2008" "DRBD 8.3.2" "Configuration Files"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbd.conf \- Configuration file for DRBD\'s devices .\" drbd.conf
.SH "INTRODUCTION"
.PP
The file
\fB/etc/drbd\&.conf\fR
is read by
\fBdrbdadm\fR\&.
.PP
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
\fB/etc/drbd\&.conf\fR
should be the same on both nodes of the cluster\&. Changes to
\fB/etc/drbd\&.conf\fR
do not apply immediately\&.
.PP \fBExample\ \&1.\ \&A small drbd.conf file\fR .sp .if n \{\ .RS 4 .\} .nf global { usage\-count yes; } common { syncer { rate 10M; } } resource r0 { protocol C; net { cram\-hmac\-alg sha1; shared\-secret "FooFunFactory"; } on alice { device minor 1; disk /dev/sda7; address 10\&.1\&.1\&.31:7789; meta\-disk internal; } on bob { device minor 1; disk /dev/sda7; address 10\&.1\&.1\&.32:7789; meta\-disk internal; } } .fi .if n \{\ .RE .\}
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
\fIalice\fR
uses
\fI/dev/drbd1\fR
as devices for its application, and
\fI/dev/sda7\fR
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\&.
.PP
There may be multiple resource sections in a single drbd\&.conf file\&. For more examples, please have a look at the
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "FILE FORMAT"
.PP
The file consists of sections and parameters\&. A section begins with a keyword, sometimes an additional name, and an opening brace (\(lq{\(rq)\&. A section ends with a closing brace (\(lq}\(rq\&. The braces enclose the parameters\&.
.PP
section [name] { parameter value; [\&.\&.\&.] }
.PP
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 consist only of the identifier\&. Parameters are terminated by a semicolon (\(lq;\(rq)\&.
.PP
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)\&.
.PP
Comments may be placed into the configuration file and must begin with a hash sign (\(lq#\(rq)\&. Subsequent characters are ignored until the end of the line\&.
.SS "Sections"
.PP
\fBskip\fR
.RS 4
.\" drbd.conf: skip
Comments out chunks of text, even spanning more than one line\&. Characters between the keyword
\fBskip\fR
and the opening brace (\(lq{\(rq) are ignored\&. Everything enclosed by the braces is skipped\&. This comes in handy, if you just want to comment out some \'\fBresource [name] {\&.\&.\&.}\fR\' section: just precede it with \'\(lqskip\(rq\'\&.
.RE
.PP
\fBglobal\fR
.RS 4
.\" drbd.conf: global
Configures some global parameters\&. Currently only
\fBminor\-count\fR,
\fBdialog\-refresh\fR,
\fBdisable\-ip\-verification\fR
and
\fBusage\-count\fR
are allowed here\&. You may only have one global section, preferably as the first section\&.
.RE
.PP
\fBcommon\fR
.RS 4
.\" drbd.conf: common
All resources inherit the options set in this section\&. The common section might have a
\fBstartup\fR, a
\fBsyncer\fR, a
\fBhandlers\fR, a
\fBnet\fR
and a
\fBdisk\fR
section\&.
.RE
.PP
\fBresource \fR\fB\fIname\fR\fR
.RS 4
.\" drbd.conf: resource
Configures a DRBD resource\&. Each resource section needs to have two (or more)
\fBon \fR\fB\fIhost\fR\fR
sections and may have a
\fBstartup\fR, a
\fBsyncer\fR, a
\fBhandlers\fR, a
\fBnet\fR
and a
\fBdisk\fR
section\&. Required parameter in this section:
\fBprotocol\fR\&.
.RE
.PP
\fBon \fR\fB\fIhost\-name\fR\fR
.RS 4
.\" drbd.conf: on
Carries the necessary configuration parameters for a DRBD device of the enclosing resource\&.
\fIhost\-name\fR
is mandatory and must match the Linux host name (uname \-n) of one of the nodes\&. You may list more than one host name here, in case you want to use the same parameters on several hosts (you\'d have to move the IP around usually)\&. Or you may list more than two such sections\&.
.sp
.if n \{\
.RS 4
.\}
.nf
resource r1 {
protocol C;
device minor 1;
meta\-disk internal;
on alice bob {
address 10\&.2\&.2\&.100:7801;
disk /dev/mapper/some\-san;
}
on charlie {
address 10\&.2\&.2\&.101:7801;
disk /dev/mapper/other\-san;
}
on daisy {
address 10\&.2\&.2\&.103:7801;
disk /dev/mapper/other\-san\-as\-seen\-from\-daisy;
}
}
.fi
.if n \{\
.RE
.\}
.sp
See also the
\fBfloating\fR
section keyword\&. Required parameters in this section:
\fBdevice\fR,
\fBdisk\fR,
\fBaddress\fR,
\fBmeta\-disk\fR,
\fBflexible\-meta\-disk\fR\&.
.RE
.PP
\fBstacked\-on\-top\-of \fR\fB\fIresource\fR\fR
.RS 4
.\" drbd.conf: stacked-on-top-of
For a stacked DRBD setup (3 or 4 nodes), a
\fBstacked\-on\-top\-of\fR
is used instead of an
\fBon\fR
section\&. Required parameters in this section:
\fBdevice\fR
and
\fBaddress\fR\&.
.RE
.PP
\fBfloating \fR\fB\fIAF addr:port\fR\fR
.RS 4
.\" drbd.conf: on
Carries the necessary configuration parameters for a DRBD device of the enclosing resource\&. This section is very similar to the
\fBon\fR
section\&. The difference to the
\fBon\fR
section is that the matching of the host sections to machines is done by the IP\-address instead of the node name\&. Required parameters in this section:
\fBdevice\fR,
\fBdisk\fR,
\fBmeta\-disk\fR,
\fBflexible\-meta\-disk\fR, all of which
\fImay\fR
be inherited from the resource section, in which case you may shorten this section down to just the address identifier\&.
.sp
.if n \{\
.RS 4
.\}
.nf
resource r2 {
protocol C;
device minor 2;
disk /dev/sda7;
meta\-disk internal;
# short form, device, disk and meta\-disk inherited
floating 10\&.1\&.1\&.31:7802;
# longer form, only device inherited
floating 10\&.1\&.1\&.32:7802 {
disk /dev/sdb;
meta\-disk /dev/sdc8;
}
}
.fi
.if n \{\
.RE
.\}
.sp
.RE
.PP
\fBdisk\fR
.RS 4
.\" drbd.conf: disk
This section is used to fine tune DRBD\'s properties in respect to the low level storage\&. Please refer to
\fBdrbdsetup\fR(8)
for detailed description of the parameters\&. Optional parameters:
\fBon\-io\-error\fR,
\fBsize\fR,
\fBfencing\fR,
\fBuse\-bmbv\fR,
\fBno\-disk\-barrier\fR,
\fBno\-disk\-flushes\fR,
\fBno\-disk\-drain\fR,
\fBno\-md\-flushes\fR,
\fBmax\-bio\-bvecs\fR,
\fBdisk\-timeout\fR\&.
.RE
.PP
\fBnet\fR
.RS 4
.\" drbd.conf: net
This section is used to fine tune DRBD\'s properties\&. Please refer to
\fBdrbdsetup\fR(8)
for a detailed description of this section\'s parameters\&. Optional parameters:
\fBsndbuf\-size\fR,
\fBrcvbuf\-size\fR,
\fBtimeout\fR,
\fBconnect\-int\fR,
\fBping\-int\fR,
\fBping\-timeout\fR,
\fBmax\-buffers\fR,
\fBmax\-epoch\-size\fR,
\fBko\-count\fR,
\fBallow\-two\-primaries\fR,
\fBcram\-hmac\-alg\fR,
\fBshared\-secret\fR,
\fBafter\-sb\-0pri\fR,
\fBafter\-sb\-1pri\fR,
\fBafter\-sb\-2pri\fR,
\fBdata\-integrity\-alg\fR,
\fBno\-tcp\-cork\fR,
\fBon\-congestion\fR,
\fBcongestion\-fill\fR,
\fBcongestion\-extents\fR
.RE
.PP
\fBstartup\fR
.RS 4
.\" drbd.conf: startup
This section is used to fine tune DRBD\'s properties\&. Please refer to
\fBdrbdsetup\fR(8)
for a detailed description of this section\'s parameters\&. Optional parameters:
\fBwfc\-timeout\fR,
\fBdegr\-wfc\-timeout\fR,
\fBoutdated\-wfc\-timeout\fR,
\fBwait\-after\-sb\fR,
\fBstacked\-timeouts\fR
and
\fBbecome\-primary\-on\fR\&.
.RE
.PP
\fBsyncer\fR
.RS 4
.\" drbd.conf: syncer
This section is used to fine tune the synchronization daemon for the device\&. Please refer to
\fBdrbdsetup\fR(8)
for a detailed description of this section\'s parameters\&. Optional parameters:
\fBrate\fR,
\fBafter\fR,
\fBal\-extents\fR,
\fBuse\-rle\fR,
\fBcpu\-mask\fR,
\fBverify\-alg\fR,
\fBcsums\-alg\fR,
\fBc\-plan\-ahead\fR,
\fBc\-fill\-target\fR,
\fBc\-delay\-target\fR,
\fBc\-max\-rate\fR,
\fBc\-min\-rate\fR
and
\fBon\-no\-data\-accessible\fR\&.
.RE
.PP
\fBhandlers\fR
.RS 4
.\" drbd.conf: handlers
In this section you can define handlers (executables) that are started by the DRBD system in response to certain events\&. Optional parameters:
\fBpri\-on\-incon\-degr\fR,
\fBpri\-lost\-after\-sb\fR,
\fBpri\-lost\fR,
\fBfence\-peer\fR
(formerly oudate\-peer),
\fBlocal\-io\-error\fR,
\fBinitial\-split\-brain\fR,
\fBsplit\-brain\fR,
\fBbefore\-resync\-target\fR,
\fBafter\-resync\-target\fR\&.
.sp
The interface is done via environment variables:
.PP
\fBDRBD_RESOURCE\fR
.RS 4
is the name of the resource
.RE
.PP
\fBDRBD_MINOR\fR
.RS 4
is the minor number of the DRBD device, in decimal\&.
.RE
.PP
\fBDRBD_CONF\fR
.RS 4
is the path to the primary configuration file; if you split your configuration into multiple files (e\&.g\&. in
\fB/etc/drbd\&.conf\&.d/\fR), this will not be helpful\&.
.RE
.PP
\fBDRBD_PEER_AF\fR, \fBDRBD_PEER_ADDRESS\fR, \fBDRBD_PEERS\fR
.RS 4
are the address family (e\&.g\&.
\fBipv6\fR), the peer\'s address and hostnames\&.
.RE
.sp
\fBDRBD_PEER\fR
(note the singular form) is deprecated, and superseeded by DRBD_PEERS\&.
.sp
Please note that not all of these might be set for all handlers, and that some values might not be useable for a
\fBfloating\fR
definition\&.
.RE
.SS "Parameters"
.PP
\fBminor\-count \fR\fB\fIcount\fR\fR
.RS 4
.\" drbd.conf: minor-count\fIcount\fR
may be a number from 1 to 255\&.
.sp
Use
\fIminor\-count\fR
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\&.
.RE
.PP
\fBdialog\-refresh \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: dialog-refresh\fItime\fR
may be 0 or a positive number\&.
.sp
The user dialog redraws the second count every
\fItime\fR
seconds (or does no redraws if
\fItime\fR
is 0)\&. The default value is 1\&.
.RE
.PP
\fBdisable\-ip\-verification\fR
.RS 4
.\" drbd.conf: disable-ip-verification
Use
\fIdisable\-ip\-verification\fR
if, for some obscure reasons, drbdadm can/might not use
\fBip\fR
or
\fBifconfig\fR
to do a sanity check for the IP address\&. You can disable the IP verification with this option\&.
.RE
.PP
\fBusage\-count \fR\fB\fIval\fR\fR
.RS 4
.\" drbd.conf: usage-count
Please participate in
\m[blue]\fBDRBD\'s online usage counter\fR\m[]\&\s-2\u[2]\d\s+2\&. The most convenient way to do so is to set this option to
\fByes\fR\&. Valid options are:
\fByes\fR,
\fBno\fR
and
\fBask\fR\&.
.RE
.PP
\fBprotocol \fR\fB\fIprot\-id\fR\fR
.RS 4
.\" drbd.conf: protocol
On the TCP/IP link the specified
\fIprotocol\fR
is used\&. Valid protocol specifiers are A, B, and C\&.
.sp
Protocol A: write IO is reported as completed, if it has reached local disk and local TCP send buffer\&.
.sp
Protocol B: write IO is reported as completed, if it has reached local disk and remote buffer cache\&.
.sp
Protocol C: write IO is reported as completed, if it has reached both local and remote disk\&.
.RE
.PP
\fBdevice \fR\fB\fIname\fR\fR\fB minor \fR\fB\fInr\fR\fR
.RS 4
.\" drbd.conf: device
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
\fBdisk\fR
parameter\&.
.sp
One can ether omit the
\fIname\fR
or
\fBminor\fR
and the
\fIminor number\fR\&. If you omit the
\fIname\fR
a default of /dev/drbd\fIminor\fR
will be used\&.
.sp
Udev will create additional symlinks in /dev/drbd/by\-res and /dev/drbd/by\-disk\&.
.RE
.PP
\fBdisk \fR\fB\fIname\fR\fR
.RS 4
.\" drbd.conf: disk
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 also holds true for
\fBdumpe2fs\fR(8)
and similar commands\&.
.RE
.PP
\fBaddress \fR\fB\fIAF addr:port\fR\fR
.RS 4
.\" drbd.conf: address
A resource needs one
\fIIP\fR
address per device, which is used to wait for incoming connections from the partner device respectively to reach the partner device\&.
\fIAF\fR
must be one of
\fBipv4\fR,
\fBipv6\fR,
\fBssocks\fR
or
\fBsdp\fR
(for compatibility reasons
\fBsci\fR
is an alias for
\fBssocks\fR)\&. It may be omited for IPv4 addresses\&. The actual IPv6 address that follows the
\fBipv6\fR
keyword must be placed inside brackets:
ipv6 [fd01:2345:6789:abcd::1]:7800\&.
.sp
Each DRBD resource needs a TCP
\fIport\fR
which is used to connect to the node\'s partner device\&. Two different DRBD resources may not use the same
\fIaddr:port\fR
combination on the same node\&.
.RE
.PP
\fBmeta\-disk \fR\fB\fIinternal\fR\fR, \fBflexible\-meta\-disk \fR\fB\fIinternal\fR\fR, \fBmeta\-disk \fR\fB\fIdevice [index]\fR\fR, \fBflexible\-meta\-disk \fR\fB\fIdevice \fR\fR
.RS 4
.\" drbd.conf: meta-disk.\" drbd.conf: flexible-meta-disk
Internal means that the last part of the backing device is used to store the meta\-data\&. You must not use
\fI[index]\fR
with internal\&. Note: Regardless of whether you use the
\fBmeta\-disk\fR
or the
\fBflexible\-meta\-disk\fR
keyword, it will always be of the size needed for the remaining storage size\&.
.sp
You can use a single block
\fIdevice\fR
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\&.
.sp
With the
\fBflexible\-meta\-disk\fR
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\&.
.RE
.PP
\fBon\-io\-error \fR\fB\fIhandler\fR\fR
.RS 4
.\" drbd.conf: on-io-error\fIhandler\fR
is taken, if the lower level device reports io\-errors to the upper layers\&.
.sp
\fIhandler\fR
may be
\fBpass_on\fR,
\fBcall\-local\-io\-error\fR
or
\fBdetach\&.\fR
.sp
\fBpass_on\fR: The node downgrades the disk status to inconsistent, marks the erroneous block as inconsistent in the bitmap and retries the IO on the remote node\&.
.sp
\fBcall\-local\-io\-error\fR: Call the handler script
\fBlocal\-io\-error\fR\&.
.sp
\fBdetach\fR: The node drops its low level device, and continues in diskless mode\&.
.RE
.PP
\fBfencing \fR\fB\fIfencing_policy\fR\fR
.RS 4
.\" drbd.conf: fencing
By
\fBfencing\fR
we understand preventive measures to avoid situations where both nodes are primary and disconnected (AKA split brain)\&.
.sp
Valid fencing policies are:
.PP
\fBdont\-care\fR
.RS 4
This is the default policy\&. No fencing actions are taken\&.
.RE
.PP
\fBresource\-only\fR
.RS 4
If a node becomes a disconnected primary, it tries to fence the peer\'s disk\&. This is done by calling the
\fBfence\-peer\fR
handler\&. The handler is supposed to reach the other node over alternative communication paths and call \'\fBdrbdadm outdate res\fR\' there\&.
.RE
.PP
\fBresource\-and\-stonith\fR
.RS 4
If a node becomes a disconnected primary, it freezes all its IO operations and calls its fence\-peer handler\&. The fence\-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
\fBresume\-io\fR
command\&.
.RE
.RE
.PP
\fBuse\-bmbv\fR
.RS 4
.\" drbd.conf: use-bmbv
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 larger than 4KiB\&. (At the time of writing the only known drivers which have such a function are: md (software raid driver), dm (device mapper \- LVM) and DRBD itself)\&.
.sp
To get the 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\&.
\fIUse this option only if you know what you are doing\&.\fR
.RE
.PP
\fBno\-disk\-barrier\fR, \fBno\-disk\-flushes\fR, \fBno\-disk\-drain\fR
.RS 4
.\" drbd.conf: no-disk-barrier
.\" drbd.conf: no-disk-flushes
.\" drbd.conf: no-disk-drain
DRBD has four implementations to express write\-after\-write dependencies to its backing storage device\&. DRBD will use the first method that is supported by the backing storage device and that is not disabled by the user\&.
.sp
When selecting the method you should not only base your decision on the measurable performance\&. In case your backing storage device has a volatile write cache (plain disks, RAID of plain disks) you should use one of the first two\&. In case your backing storage device has battery\-backed write cache you may go with option 3\&. Option 4 (disable everything, use "none")
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fBno\-disk\-drain\fR\&.
.sp
Unfortunately device mapper (LVM) might not support barriers\&.
.sp
The letter after "wo:" in /proc/drbd indicates with method is currently in use for a device:
\fBb\fR,
\fBf\fR,
\fBd\fR,
\fBn\fR\&. The implementations are:
.PP
barrier
.RS 4
The first requires that the driver of the backing storage device support barriers (called \'tagged command queuing\' in SCSI and \'native command queuing\' in SATA speak)\&. The use of this method can be disabled by the
\fBno\-disk\-barrier\fR
option\&. Note: Since Linux\-2\&.6\&.36 (or RHEL\'s 2\&.6\&.32) this method is disabled\&.
.RE
.PP
flush
.RS 4
The second requires that the backing device support disk flushes (called \'force unit access\' in the drive vendors speak)\&. The use of this method can be disabled using the
\fBno\-disk\-flushes\fR
option\&.
.RE
.PP
drain
.RS 4
The third method is simply to let write requests drain before write requests of a new reordering domain are issued\&. This was the only implementation before 8\&.0\&.9\&.
.RE
.PP
none
.RS 4
The fourth method is to not express write\-after\-write dependencies to the backing store at all, by also specifying
\fBno\-disk\-drain\fR\&. This
\fIis dangerous\fR
on most IO stacks, may result in write\-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles\&.
\fIDo not use\fR
\fBno\-disk\-drain\fR\&.
.RE
.RE
.PP
\fBno\-md\-flushes\fR
.RS 4
.\" drbd.conf: no-md-flushes
Disables the use of disk flushes and barrier BIOs when accessing the meta data device\&. See the notes on
\fBno\-disk\-flushes\fR\&.
.RE
.PP
\fBmax\-bio\-bvecs\fR
.RS 4
.\" drbd.conf: max-bio-bvecs
In some special circumstances the device mapper stack manages to pass BIOs to DRBD that violate the constraints that are set forth by DRBD\'s merge_bvec() function and which have more than one bvec\&. A known example is: phys\-disk \-> DRBD \-> LVM \-> Xen \-> misaligned partition (63) \-> DomU FS\&. Then you might see "bio would need to, but cannot, be split:" in the Dom0\'s kernel log\&.
.sp
The best workaround is to proper align the partition within the VM (E\&.g\&. start it at sector 1024)\&. This costs 480 KiB of storage\&. Unfortunately the default of most Linux partitioning tools is to start the first partition at an odd number (63)\&. Therefore most distribution\'s install helpers for virtual linux machines will end up with misaligned partitions\&. The second best workaround is to limit DRBD\'s max bvecs per BIO (=
\fBmax\-bio\-bvecs\fR) to 1, but that might cost performance\&.
.sp
The default value of
\fBmax\-bio\-bvecs\fR
is 0, which means that there is no user imposed limitation\&.
.RE
.PP
\fBdisk\-timeout\fR
.RS 4
.\" drbd.conf: disk-timeout
If the driver of the
\fIlower_device\fR
does not finish an IO request within
\fIdisk_timeout\fR, DRBD considers the disk as failed\&. If DRBD is connected to a remote host, it will reissue local pending IO requests to the peer, and ship all new IO requests to the peer only\&. The disk state advances to diskless, as soon as the backing block device has finished all IO requests\&.
.sp
The default value of is 0, which means that no timeout is enforced\&. The default unit is 100ms\&. This option is available since 8\&.3\&.12\&.
.RE
.PP
\fBsndbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
.\" drbd.conf: sndbuf-size\fIsize\fR
is the size of the TCP socket send buffer\&. The default value is 0, i\&.e\&. autotune\&. You can specify smaller or larger values\&. Larger values are appropriate for reasonable write throughput with protocol A over high latency networks\&. Values below 32K do not make sense\&. Since 8\&.0\&.13 resp\&. 8\&.2\&.7, setting the
\fIsize\fR
value to 0 means that the kernel should autotune this\&.
.RE
.PP
\fBrcvbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
.\" drbd.conf: rcvbuf-size\fIsize\fR
is the size of the TCP socket receive buffer\&. The default value is 0, i\&.e\&. autotune\&. You can specify smaller or larger values\&. Usually this should be left at its default\&. Setting the
\fIsize\fR
value to 0 means that the kernel should autotune this\&.
.RE
.PP
\fBtimeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: timeout
If the partner node fails to send an expected response packet within
\fItime\fR
tenths of a second, the partner node is considered dead and therefore the TCP/IP connection is abandoned\&. This must be lower than
\fIconnect\-int\fR
and
\fIping\-int\fR\&. The default value is 60 = 6 seconds, the unit 0\&.1 seconds\&.
.RE
.PP
\fBconnect\-int \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: connect-int
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 retries\&. The default value is 10 seconds, the unit is 1 second\&.
.RE
.PP
\fBping\-int \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: ping-int
If the TCP/IP connection linking a DRBD device pair is idle for more than
\fItime\fR
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\&.
.RE
.PP
\fBping\-timeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: ping-timeout
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 are tenths of a second\&.
.RE
.PP
\fBmax\-buffers \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: max-buffers
Limits the memory usage per DRBD minor device on the receiving side, or for internal buffers during resync or online\-verify\&. Unit is PAGE_SIZE, which is 4 KiB on most systems\&. The minimum possible setting is hard coded to 32 (=128 KiB)\&. These buffers are used to hold data blocks while they are written to/read from disk\&. To avoid possible distributed deadlocks on congestion, this setting is used as a throttle threshold rather than a hard limit\&. Once more than max\-buffers pages are in use, further allocation from this pool is throttled\&. You want to increase max\-buffers if you cannot saturate the IO backend on the receiving side\&.
.RE
.PP
\fBko\-count \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: ko-count
In case the secondary node fails to complete a single write request for
\fIcount\fR
times the
\fItimeout\fR, it is expelled from the cluster\&. (I\&.e\&. the primary node goes into
\fBStandAlone\fR
mode\&.) To disable this feature, you should explicitly set it to 0; defaults may change between versions\&.
.RE
.PP
\fBmax\-epoch\-size \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: max-epoch-size
The highest number of data blocks between two write barriers\&. If you set this smaller than 10, you might decrease your performance\&.
.RE
.PP
\fBallow\-two\-primaries\fR
.RS 4
.\" drbd.conf: allow-two-primaries
With this option set you may assign the 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!
.RE
.PP
\fBunplug\-watermark \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: unplug-watermark
This setting has no effect with recent kernels that use explicit on\-stack plugging (upstream Linux kernel 2\&.6\&.39, distributions may have backported)\&.
.sp
When the number of pending write requests on the standby (secondary) node exceeds the
\fBunplug\-watermark\fR, 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, yet others don\'t feel much effect at all\&. Minimum 16, default 128, maximum 131072\&.
.RE
.PP
\fBcram\-hmac\-alg\fR
.RS 4
.\" drbd.conf: cram-hmac-alg
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
\fB/proc/crypto\fR\&.
.RE
.PP
\fBshared\-secret\fR
.RS 4
.\" drbd.conf: shared-secret
The shared secret used in peer authentication\&. May be up to 64 characters\&. Note that peer authentication is disabled as long as no
\fBcram\-hmac\-alg\fR
(see above) is specified\&.
.RE
.PP
\fBafter\-sb\-0pri \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: after-sb-0pri
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBdiscard\-younger\-primary\fR
.RS 4
Auto sync from the node that was primary before the split\-brain situation happened\&.
.RE
.PP
\fBdiscard\-older\-primary\fR
.RS 4
Auto sync from the node that became primary as second during the split\-brain situation\&.
.RE
.PP
\fBdiscard\-zero\-changes\fR
.RS 4
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\&.
.RE
.PP
\fBdiscard\-least\-changes\fR
.RS 4
Auto sync from the node that touched more blocks during the split brain situation\&.
.RE
.PP
\fBdiscard\-node\-NODENAME\fR
.RS 4
Auto sync to the named node\&.
.RE
.RE
.PP
\fBafter\-sb\-1pri \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: after-sb-1pri
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBconsensus\fR
.RS 4
Discard the version of the secondary if the outcome of the
\fBafter\-sb\-0pri\fR
algorithm would also destroy the current secondary\'s data\&. Otherwise disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm, even if that causes an erratic change of the primary\'s view of the data\&. This is only useful if you use a one\-node FS (i\&.e\&. not OCFS2 or GFS) with the
\fBallow\-two\-primaries\fR
flag,
\fIAND\fR
if you really know what you are doing\&. This is
\fIDANGEROUS and MAY CRASH YOUR MACHINE\fR
if you have an FS mounted on the primary node\&.
.RE
.PP
\fBdiscard\-secondary\fR
.RS 4
Discard the secondary\'s version\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always honor the outcome of the
\fBafter\-sb\-0pri \fR
algorithm\&. In case it decides the current secondary has the right data, it calls the "pri\-lost\-after\-sb" handler on the current primary\&.
.RE
.RE
.PP
\fBafter\-sb\-2pri \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: after-sb-2pri
possible policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm, even if that causes an erratic change of the primary\'s view of the data\&. This is only useful if you use a one\-node FS (i\&.e\&. not OCFS2 or GFS) with the
\fBallow\-two\-primaries\fR
flag,
\fIAND\fR
if you really know what you are doing\&. This is
\fIDANGEROUS and MAY CRASH YOUR MACHINE\fR
if you have an FS mounted on the primary node\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
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\&.
.RE
.RE
.PP
\fBalways\-asbp\fR
.RS 4
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\&.
.sp
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\&.)
.RE
.PP
\fBrr\-conflict \fR \fIpolicy\fR
.RS 4
.\" drbd.conf: rr-conflict
This option helps to solve the cases when the outcome of the resync decision is incompatible with the current role assignment in the cluster\&.
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\fR
.RS 4
Sync to the primary node is allowed, violating the assumption that data on a block device are stable for one of the nodes\&.
\fIDangerous, do not use\&.\fR
.RE
.PP
\fBcall\-pri\-lost\fR
.RS 4
Call the "pri\-lost" helper program on one of the machines\&. This program is expected to reboot the machine, i\&.e\&. make it secondary\&.
.RE
.RE
.PP
\fBdata\-integrity\-alg \fR \fIalg\fR
.RS 4
.\" drbd.conf: data-integrity-alg
DRBD can ensure the data integrity of the user\'s data on the network by comparing hash values\&. Normally this is ensured by the 16 bit checksums in the headers of TCP/IP packets\&.
.sp
This option can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled\&.
.sp
See also the notes on data integrity\&.
.RE
.PP
\fBno\-tcp\-cork\fR
.RS 4
.\" drbd.conf: no-tcp-cork
DRBD usually uses the TCP socket option TCP_CORK to hint to the network stack when it can expect more data, and when it should flush out what it has in its send queue\&. It turned out that there is at least one network stack that performs worse when one uses this hinting method\&. Therefore we introducted this option, which disables the setting and clearing of the TCP_CORK socket option by DRBD\&.
.RE
.PP
\fBon\-congestion \fR\fB\fIcongestion_policy\fR\fR, \fBcongestion\-fill \fR\fB\fIfill_threshold\fR\fR, \fBcongestion\-extents \fR\fB\fIactive_extents_threshold\fR\fR
.RS 4
By default DRBD blocks when the available TCP send queue becomes full\&. That means it will slow down the application that generates the write requests that cause DRBD to send more data down that TCP connection\&.
.sp
When DRBD is deployed with DRBD\-proxy it might be more desirable that DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full\&. In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps the connection open\&.
.sp
The advantage of the AHEAD/BEHIND mode is that the application is not slowed down, even if DRBD\-proxy\'s buffer is not sufficient to buffer all write requests\&. The downside is that the peer node falls behind, and that a resync will be necessary to bring it back into sync\&. During that resync the peer node will have an inconsistent disk\&.
.sp
Available
\fIcongestion_policy\fRs are
\fBblock\fR
and
\fBpull\-ahead\fR\&. The default is
\fBblock\fR\&.
\fIFill_threshold\fR
might be in the range of 0 to 10GiBytes\&. The default is 0 which disables the check\&.
\fIActive_extents_threshold\fR
has the same limits as
\fBal\-extents\fR\&.
.sp
The AHEAD/BEHIND mode and its settings are available since DRBD 8\&.3\&.10\&.
.RE
.PP
\fBwfc\-timeout \fR\fB\fItime\fR\fR
.RS 4
Wait for connection timeout\&.
.\" drbd.conf: wfc-timeout
The init script
\fBdrbd\fR(8)
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\&.
.RE
.PP
\fBdegr\-wfc\-timeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: degr-wfc-timeout
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\&. Value 0 means unlimited\&.
.RE
.PP
\fBoutdated\-wfc\-timeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: outdated-wfc-timeout
Wait for connection timeout, if the peer was outdated\&. In case a degraded cluster (= cluster with only one node left) with an outdated peer disk is rebooted, this timeout value is used instead of wfc\-timeout, because the peer is not allowed to become primary in the meantime\&. Value 0 means unlimited\&.
.RE
.PP
\fBwait\-after\-sb\fR
.RS 4
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\&.
.RE
.PP
\fBbecome\-primary\-on \fR\fB\fInode\-name\fR\fR
.RS 4
Sets on which node the device should be promoted to primary role by the init script\&. The
\fInode\-name\fR
might either be a host name or the keyword
\fBboth\fR\&. 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)\&.
.RE
.PP
\fBstacked\-timeouts\fR
.RS 4
Usually
\fBwfc\-timeout\fR
and
\fBdegr\-wfc\-timeout\fR
are ignored for stacked devices, instead twice the amount of
\fBconnect\-int\fR
is used for the connection timeouts\&. With the
\fBstacked\-timeouts\fR
keyword you disable this, and force DRBD to mind the
\fBwfc\-timeout\fR
and
\fBdegr\-wfc\-timeout\fR
statements\&. Only do that if the peer of the stacked resource is usually not available or will usually not become primary\&. By using this option incorrectly, you run the risk of causing unexpected split brain\&.
.RE
.PP
\fBrate \fR\fB\fIrate\fR\fR
.RS 4
.\" drbd.conf: rate
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\&.
.RE
.PP
\fBuse\-rle\fR
.RS 4
.\" drbd.conf: use-rle
During resync\-handshake, the dirty\-bitmaps of the nodes are exchanged and merged (using bit\-or), so the nodes will have the same understanding of which blocks are dirty\&. On large devices, the fine grained dirty\-bitmap can become large as well, and the bitmap exchange can take quite some time on low\-bandwidth links\&.
.sp
Because the bitmap typically contains compact areas where all bits are unset (clean) or set (dirty), a simple run\-length encoding scheme can considerably reduce the network traffic necessary for the bitmap exchange\&.
.sp
For backward compatibilty reasons, and because on fast links this possibly does not improve transfer time but consumes cpu cycles, this defaults to off\&.
.RE
.PP
\fBafter \fR\fB\fIres\-name\fR\fR
.RS 4
.\" drbd.conf: after
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
\fIres\-name\fR
is already in connected state (i\&.e\&., has finished its resynchronization)\&.
.RE
.PP
\fBal\-extents \fR\fB\fIextents\fR\fR
.RS 4
.\" drbd.conf: al-extents
DRBD automatically performs hot area detection\&. With this 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
\fIextents\fR
is 127\&. (Minimum: 7, Maximum: 3843)
.RE
.PP
\fBverify\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
During online verification (as initiated by the
\fBverify\fR
sub\-command), rather than doing a bit\-wise comparison, DRBD applies a hash function to the contents of every block being verified, and compares that hash with the peer\&. This option defines the hash algorithm being used for that purpose\&. It can be set to any of the kernel\'s data digest algorithms\&. In a typical kernel configuration you should have at least one of
\fBmd5\fR,
\fBsha1\fR, and
\fBcrc32c\fR
available\&. By default this is not enabled; you must set this option explicitly in order to be able to use on\-line device verification\&.
.sp
See also the notes on data integrity\&.
.RE
.PP
\fBcsums\-alg \fR\fB\fIhash\-alg\fR\fR
.RS 4
A resync process sends all marked data blocks from the source to the destination node, as long as no
\fBcsums\-alg\fR
is given\&. When one is specified the resync process exchanges hash values of all marked blocks first, and sends only those data blocks that have different hash values\&.
.sp
This setting is useful for DRBD setups with low bandwidth links\&. During the restart of a crashed primary node, all blocks covered by the activity log are marked for resync\&. But a large part of those will actually be still in sync, therefore using
\fBcsums\-alg\fR
will lower the required bandwidth in exchange for CPU cycles\&.
.RE
.PP
\fBc\-plan\-ahead \fR\fB\fIplan_time\fR\fR, \fBc\-fill\-target \fR\fB\fIfill_target\fR\fR, \fBc\-delay\-target \fR\fB\fIdelay_target\fR\fR, \fBc\-max\-rate \fR\fB\fImax_rate\fR\fR
.RS 4
The dynamic resync speed controller gets enabled with setting
\fIplan_time\fR
to a positive value\&. It aims to fill the buffers along the data path with either a constant amount of data
\fIfill_target\fR, or aims to have a constant delay time of
\fIdelay_target\fR
along the path\&. The controller has an upper bound of
\fImax_rate\fR\&.
.sp
By
\fIplan_time\fR
the agility of the controller is configured\&. Higher values yield for slower/lower responses of the controller to deviation from the target value\&. It should be at least 5 times RTT\&. For regular data paths a
\fIfill_target\fR
in the area of 4k to 100k is appropriate\&. For a setup that contains drbd\-proxy it is advisable to use
\fIdelay_target\fR
instead\&. Only when
\fIfill_target\fR
is set to 0 the controller will use
\fIdelay_target\fR\&. 5 times RTT is a reasonable starting value\&.
\fIMax_rate\fR
should be set to the bandwidth available between the DRBD\-hosts and the machines hosting DRBD\-proxy, or to the available disk\-bandwidth\&.
.sp
The default value of
\fIplan_time\fR
is 0, the default unit is 0\&.1 seconds\&.
\fIFill_target\fR
has 0 and sectors as default unit\&.
\fIDelay_target\fR
has 1 (100ms) and 0\&.1 as default unit\&.
\fIMax_rate\fR
has 10240 (100MiB/s) and KiB/s as default unit\&.
.sp
The dynamic resync speed controller and its settings are available since DRBD 8\&.3\&.9\&.
.RE
.PP
\fBc\-min\-rate \fR\fB\fImin_rate\fR\fR
.RS 4
A node that is primary and sync\-source has to schedule application IO requests and resync IO requests\&. The
\fImin_rate\fR
tells DRBD use only up to min_rate for resync IO and to dedicate all other available IO bandwidth to application requests\&.
.sp
Note: The value 0 has a special meaning\&. It disables the limitation of resync IO completely, which might slow down application IO considerably\&. Set it to a value of 1, if you prefer that resync IO never slows down application IO\&.
.sp
Note: Although the name might suggest that it is a lower bound for the dynamic resync speed controller, it is not\&. If the DRBD\-proxy buffer is full, the dynamic resync speed controller is free to lower the resync speed down to 0, completely independent of the
\fBc\-min\-rate\fR
setting\&.
.sp
\fIMin_rate\fR
has 4096 (4MiB/s) and KiB/s as default unit\&.
.RE
.PP
\fBon\-no\-data\-accessible \fR\fB\fIond\-policy\fR\fR
.RS 4
This setting controls what happens to IO requests on a degraded, disk less node (I\&.e\&. no data store is reachable)\&. The available policies are
\fBio\-error\fR
and
\fBsuspend\-io\fR\&.
.sp
If
\fIond\-policy\fR
is set to
\fBsuspend\-io\fR
you can either resume IO by attaching/connecting the last lost data storage, or by the
\fBdrbdadm resume\-io \fR\fB\fIres\fR\fR
command\&. The latter will result in IO errors of course\&.
.sp
The default is
\fBio\-error\fR\&. This setting is available since DRBD 8\&.3\&.9\&.
.RE
.PP
\fBcpu\-mask \fR\fB\fIcpu\-mask\fR\fR
.RS 4
.\" drbd.conf: cpu-mask
Sets the cpu\-affinity\-mask for DRBD\'s kernel threads of this device\&. The default value of
\fIcpu\-mask\fR
is 0, which means that DRBD\'s kernel threads should be spread over all CPUs of the machine\&. This value must be given in hexadecimal notation\&. If it is too big it will be truncated\&.
.RE
.PP
\fBpri\-on\-incon\-degr \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-on-incon-degr
This handler is called if the node is primary, degraded and if the local copy of the data is inconsistent\&.
.RE
.PP
\fBpri\-lost\-after\-sb \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-lost-after-sb
The node is currently primary, but lost the after\-split\-brain auto recovery procedure\&. As as consequence, it should be abandoned\&.
.RE
.PP
\fBpri\-lost \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-lost
The node is currently primary, but DRBD\'s algorithm thinks that it should become sync target\&. As a consequence it should give up its primary role\&.
.RE
.PP
\fBfence\-peer \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: fence-peer
The handler is part of the
\fBfencing\fR
mechanism\&. This handler is called in case the node needs to fence the peer\'s disk\&. It should use other communication paths than DRBD\'s network link\&.
.RE
.PP
\fBlocal\-io\-error \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: local-io-error
DRBD got an IO error from the local IO subsystem\&.
.RE
.PP
\fBinitial\-split\-brain \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: initial-split-brain
DRBD has connected and detected a split brain situation\&. This handler can alert someone in all cases of split brain, not just those that go unresolved\&.
.RE
.PP
\fBsplit\-brain \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: split-brain
DRBD detected a split brain situation but remains unresolved\&. Manual recovery is necessary\&. This handler should alert someone on duty\&.
.RE
.PP
\fBbefore\-resync\-target \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: before-resync-target
DRBD calls this handler just before a resync begins on the node that becomes resync target\&. It might be used to take a snapshot of the backing block device\&.
.RE
.PP
\fBafter\-resync\-target \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: after-resync-target
DRBD calls this handler just after a resync operation finished on the node whose disk just became consistent after being inconsistent for the duration of the resync\&. It might be used to remove a snapshot of the backing device that was created by the
\fBbefore\-resync\-target\fR
handler\&.
.RE
.SS "Other Keywords"
.PP
\fBinclude \fR\fB\fIfile\-pattern\fR\fR
.RS 4
.\" drbd.conf: include
Include all files matching the wildcard pattern
\fIfile\-pattern\fR\&. The
\fBinclude\fR
statement is only allowed on the top level, i\&.e\&. it is not allowed inside any section\&.
.RE
.SH "NOTES ON DATA INTEGRITY"
.PP
There are two independent methods in DRBD to ensure the integrity of the mirrored data\&. The online\-verify mechanism and the
\fBdata\-integrity\-alg\fR
of the
\fBnetwork\fR
section\&.
.PP
Both mechanisms might deliver false positives if the user of DRBD modifies the data which gets written to disk while the transfer goes on\&. This may happen for swap, or for certain append while global sync, or truncate/rewrite workloads, and not necessarily poses a problem for the integrity of the data\&. Usually when the initiator of the data transfer does this, it already knows that that data block will not be part of an on disk data structure, or will be resubmitted with correct data soon enough\&.
.PP
The
\fBdata\-integrity\-alg\fR
causes the receiving side to log an error about "Digest integrity check FAILED: Ns +x\en", where N is the sector offset, and x is the size of the requst in bytes\&. It will then disconnect, and reconnect, thus causing a quick resync\&. If the sending side at the same time detected a modification, it warns about "Digest mismatch, buffer modified by upper layers during write: Ns +x\en", which shows that this was a false positive\&. The sending side may detect these buffer modifications immediately after the unmodified data has been copied to the tcp buffers, in which case the receiving side won\'t notice it\&.
.PP
The most recent (2007) example of systematic corruption was an issue with the TCP offloading engine and the driver of a certain type of GBit NIC\&. The actual corruption happened on the DMA transfer from core memory to the card\&. Since the TCP checksum gets calculated on the card, this type of corruption stays undetected as long as you do not use either the online
\fBverify\fR
or the
\fBdata\-integrity\-alg\fR\&.
.PP
We suggest to use the
\fBdata\-integrity\-alg\fR
only during a pre\-production phase due to its CPU costs\&. Further we suggest to do online
\fBverify\fR
runs regularly e\&.g\&. once a month during a low load period\&.
.SH "VERSION"
.sp
This document was revised for version 8\&.3\&.2 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
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\&.
.SH "SEE ALSO"
.PP
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fBDRBD web site\fR\m[]\&\s-2\u[3]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD User's Guide
.RS 4
\%http://www.drbd.org/users-guide/
.RE
.IP " 2." 4
DRBD's online usage counter
.RS 4
\%http://usage.drbd.org
.RE
.IP " 3." 4
DRBD web site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v9/ 0000755 0001750 0001750 00000000000 12654475367 016735 5 ustar apoikos apoikos drbd-utils-8.9.6/documentation/v9/drbdsetup.xsl 0000644 0001750 0001750 00000002330 12466702073 021443 0 ustar apoikos apoikos
drbd-utils-8.9.6/documentation/v9/drbdmeta.8 0000644 0001750 0001750 00000017633 12654452461 020610 0 ustar apoikos apoikos '\" t
.\" Title: drbdmeta
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 6 December 2012
.\" Manual: System Administration
.\" Source: DRBD 9.0.0
.\" Language: English
.\"
.TH "DRBDMETA" "8" "6 December 2012" "DRBD 9.0.0" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdmeta \- Manipulate the DRBD on\-disk metadata.\" drbdmeta
.SH "SYNOPSIS"
.HP \w'\fBdrbdmeta\fR\ 'u
\fBdrbdmeta\fR [\-\-force] [\-\-ignore\-sanity\-checks] {\fIdevice\fR} {v06\ \fIminor\fR | v07\ \fImeta_dev\ index\fR | v08\ \fImeta_dev\ index\fR | v09\ \fImeta_dev\ index\fR} {\fIcommand\fR} [\fIcmd\ args\fR...]
.SH "DESCRIPTION"
.PP
The
\fBdrbdmeta\fR
utility is used for creating, displaying, and modifying DRBD\'s on\-disk metadata\&. Users usually interact with the
\fBdrbdadm\fR
utility, which provides a more high\-level interface to DRBD than
\fBdrbdmeta\fR\&. (See
\fBdrbdadm\fR\'s
\fB\-\-dry\-run\fR
option to see how
\fBdrbdadm\fR
uses
\fBdrbdmeta\fR\&.)
.PP
This utility can only be used on devices which are not currently in use by the kernel\&.
.PP
The first argument (\fIdevice\fR) specifies the drbd device associated with a volume, or
\(lq\-\(rq
if no device is associated with that volume\&. If the drbd device is specified, the
\fBdrbdmeta\fR
utility makes sure that the drbd device does not currently have a volume attached to prevent meta\-data of an active volume from being destroyed\&.
.PP
The second argument specifies the metadata version to use (v06, v07, v08, v09)\&. In most metadata versions, the third argument (\fImeta_dev\fR) specifies the device which contains the metadata; this argument can be the same as
\fIdevice\fR\&. The fourth argument (\fIindex\fR) can be one of the keywords
\fBinternal\fR
(for internal metadata),
\fBflex\-internal\fR
(in v07 for variable\-sized metadata; v07 otherwise defaults to fixed\-size internal metadata),
\fBflex\-external\fR
(for variable\-sized external metadata), or a numeric matadata index (for fixed\-size external metadata)\&. See the
\fBmeta\-disk\fR
parameter in
\fBdrbd.conf\fR(5)\&.
.SH "OPTIONS"
.PP
\-\-force
.RS 4
.\" drbdmeta: --force
Assume yes as the answer to all questions drbdmeta would ask\&.
.RE
.PP
\-\-ignore\-sanity\-checks
.RS 4
.\" drbdmeta: --ignore-sanity-checks
Normally,
\fBdrbdmeta\fR
performs some sanity checks before writing to the metadata device: for example, if the device appears to contain a file system, it refuses to destroy the file system by writing into it\&. Use this option to ignore these checks\&.
.RE
.SH "COMMANDS"
.PP
\fBcreate\-md\fR [\fB\-\-peer\-max\-bio\-size=\fR\fIval\fR] (metadata versions v06, v07, and v08),
.br
\fBcreate\-md\fR {number\-of\-bitmap\-slots} [\fB\-\-peer\-max\-bio\-size=\fR\fIval\fR] [\fB\-\-al\-stripes=\fR\fIval\fR] [\fB\-\-al\-stripe\-size\-kB=\fR\fIval\fR] (metadata version v09)
.RS 4
.\" drbdmeta: create-md
Initialize the metadata\&. This is necessary before a DRBD resource can be attached\&. If
\fBdrbdmeta\fR
finds an older version of DRBD metadata on the device, it asks if the format should be converted\&.
.sp
When
\fBdrbdadm\fR
calls
\fBdrbdmeta\fR\'s
\fBcreate\-md\fR
command for a device, it sets the
\fInumber\-of\-bitmap\-slots\fR
argument to the number of peers in the resource\&. To reserve additional bitmap slots (which allows to add more peers in the future), call
\fBdrbdmeta\fR
directly instead\&.
.sp
When a device is used before being connected to its peers the first time, DRBD assumes that peers can only handle 4 KiB requests by default\&. The
\fB\-\-peer\-max\-bio\-size\fR
option allows to set more optimistic values; use this if the versions of DRBD that this device will connect to are known\&. DRBD supports a maximum bio size of 32 KiB since version 8\&.3\&.8, of 128 KiB since version 8\&.3\&.9, and of 1 MiB since version 8\&.4\&.0\&.
.sp
If you want to use more than 6433 activity log extents, or live on top of a spriped RAID, you may specify the number of stripes (\fB\-\-al\-stripes\fR, default 1), and the stripe size (\fB\-\-al\-stripe\-size\-kB\fR, default 32)\&. To just use a larger linear on\-disk ring\-buffer, leave the number of stripes at 1, and increase the size only:
\fBdrbdmeta 0 v08 /dev/vg23/lv42 internal create\-md \-\-al\-stripe\-size 1M\fR
.sp
To avoid a single "spindle" from becoming a bottleneck, increase the number of stripes, to achieve an interleaved layout of the on\-disk activity\-log transactions\&. What you give as "stripe\-size" should be what is a\&.k\&.a\&. "chunk size" or "granularity" or "strip unit": the minimum skip to the next "spindle"\&.
\fBdrbdmeta 0 v08 /dev/vg23/lv42 internal create\-md \-\-al\-stripes 7 \-\-al\-stripe\-size 64\fR
.RE
.PP
\fBget\-gi\fR [\fB\-\-node\-id=\fR\fIid\fR]
.RS 4
.\" drbdmeta: get-gi
Show the data generation identifiers for a device on a particular connection\&. DRBD version 9\&.0\&.0 and beyond support multiple peers; use the
\fInode\-id\fR
option to define which peer\'s data generation identifiers to show\&.
.RE
.PP
\fBshow\-gi\fR [\fB\-\-node\-id=\fR\fIid\fR]
.RS 4
.\" drbdmeta: show-gi
Similar to
\fBget\-gi\fR, but with explanatory information\&.
.RE
.PP
\fBdump\-md\fR
.RS 4
.\" drbdmeta: dump-md
Dump the metadata of a device in text form, including the bitmap and activity log\&.
.RE
.PP
\fBoutdate\fR
.RS 4
Mark the data on a lower\-level device as outdated\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
\fBdstate\fR
.RS 4
Show the current disk state of a lower\-level device\&.
.RE
.PP
\fBcheck\-resize\fR
.RS 4
.\" drbdmeta: check-resize
Examine the device size of a lower\-level device and its last known device size (saved in
\fB/var/lib/drbd/drbd\-minor\-\fR\fB\fIminor\fR\fR\fB\&.lkbd\fR
by
\fBdrbdsetup check\-resize\fR)\&. For internal metadata, if the size of the lower\-level device has changed and the metadata can be found at the previous position, move the metadata to the new position at the end of the block device\&.
.RE
.PP
\fBapply\-al\fR
.RS 4
.\" drbdmeta: apply-al
Apply the activity log of the specified device\&. This is necessary before the device can be attached by the kernel again\&.
.RE
.SH "EXPERT COMMANDS"
.PP
The
\fBdrbdmeta\fR
utility can be used to fine tune metdata\&. Please note that this can lead to destroyed metadata or even silent data corruption; use with great care only\&.
.PP
\fBset\-gi\fR \fIgi\fR [\fB\-\-node\-id=\fR\fIid\fR]
.RS 4
.\" drbdmeta: set-gi
Set the generation identifiers\&. The
\fIgi\fR
argument is a generation counter for the v06 and v07 formats, and a set of UUIDs for v08 and beyond\&. Accepts the same syntax as in the
\fBget\-gi\fR
output\&. DRBD version 9\&.0\&.0 and beyond support multiple peers; use the
\fI\-\-node\-id\fR
option to define which peer\'s data generation identifiers to set\&.
.RE
.PP
\fBrestore\-md\fR \fIdump_file\fR
.RS 4
.\" drbdmeta: restore-md
Replace the metadata on the device with the contents of
\fIdump_file\fR\&. The dump file format is defined by the output of the
\fBdump\-md\fR
command\&.
.RE
.SH "VERSION"
.sp
This document was revised for version 9\&.0\&.0 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
Copyright 2001\-2008,2012 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\&.
.SH "SEE ALSO"
.PP
\fBdrbdadm\fR(8)
\fBdrbd.conf\fR(5)
drbd-utils-8.9.6/documentation/v9/drbd.8 0000644 0001750 0001750 00000004347 12654452460 017736 0 ustar apoikos apoikos '\" t
.\" Title: drbd
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 24 June 2014
.\" Manual: System Administration
.\" Source: DRBD 9.0.0
.\" Language: English
.\"
.TH "DRBD" "8" "24 June 2014" "DRBD 9.0.0" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbd \- The start and stop script for DRBD
.SH "SYNOPSIS"
.HP \w'\fB/etc/init\&.d/drbd\fR\ 'u
\fB/etc/init\&.d/drbd\fR {start | stop | status | reload | restart | force\-reload}
.SH "INTRODUCTION"
.PP
The
\fB/etc/init\&.d/drbd\fR
script is used to start and stop drbd on a system V style init system\&.
.PP
When using a cluster resource manger such as Pacemaker, DRBD should usually
\fInot\fR
be started by the init system, but should typically be exclusively controlled by the cluster manager\&. You should not use, and disable, the init script in this case\&.
\fBchmod \-x /etc/init\&.d/drbd\fR
has proven most effective for this\&.
.PP
In order to use
\fB/etc/init\&.d/drbd\fR, define a drbd configuration\&. See
\fBdrbd.conf\fR(5)
for details\&.
.SH "VERSION"
.sp
This document was revised for version 9\&.0\&.0 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
Copyright 2001\-2014 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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbdsetup\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD Homepage\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD Homepage
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v9/drbd.conf.xsl 0000644 0001750 0001750 00000001651 12466702073 021313 0 ustar apoikos apoikos
drbd-utils-8.9.6/documentation/v9/drbdsetup.xml.in 0000644 0001750 0001750 00000126761 12647177714 022072 0 ustar apoikos apoikos
]>
&drbdsetup_options;
3 December 2011DRBD9.0.0drbdsetup8System AdministrationdrbdsetupConfigure the DRBD kernel moduledrbdsetupdrbdsetupcommandargumentoptionDescriptionThe drbdsetup utility serves to
configure the DRBD kernel module and to show its current configuration.
Users usually interact with the drbdadm utility, which provides a more
high-level interface to DRBD than drbdsetup. (See 's
option to see how
uses .)Some option arguments have a default scale which applies when a plain
number is specified (for example Kilo, or 1024 times the numeric value).
Such default scales can be overridden by using a suffix (for example, M
for Mega). The common suffixes K = 2^10 = 1024, M = 1024 K, and G = 1024
M are supported.CommandsdrbdsetupdiskThe command attaches a lower-level
device to an existing replicated device. The
command changes the disk options of
an attached lower-level device. In either case, the replicated
device must have been created with drbdsetup new-minor.Both commands refer to the replicated device by its
minor number.
lower_dev is the name of the lower-level
device. meta_data_dev is the name of
the device containing the metadata, and may be the same as
lower_dev.
meta_data_index is either a numeric
metadata index, or the keyword for
internal metadata, or the keyword for
variable-size external metadata. Available
options:drbdsetuppeer-device-optionsThese are options that affect the peer's device.
drbdsetupcheck-resizeRemember the current size of the lower-level device of the
specified replicated device. Used by drbdadm. The size information
is stored in file
/var/lib/drbd/drbd-minor-minor.lkbd.drbdsetupnetThe command creates a connection within
a resource. The resource
must have been created with drbdsetup
new-resource. The command
changes the network options of an existing connection. Before a
connection can be activated with the
command, at least one path need to added with the
command. Available options:drbdsetupnetThe command creates a path within
a connection. The connection
must have been created with drbdsetup
new-peer. Local_addr and
remote_addr refer to the local and remote
protocol, network address, and port in the format
address-family:address:port.
The address families ,
, (Dolphin Interconnect
Solutions' "super sockets"), (Infiniband Sockets
Direct Protocol), and are supported
( is an alias for ). If
no address family is specified, is assumed. For
all address families except , the
address uses IPv4 address notation (for
example, 1.2.3.4). For , the address is enclosed
in brackets and uses IPv6 address notation (for example,
[fd01:2345:6789:abcd::1]). The port
defaults to 7788.drbdsetupnetThe command activates a connection.
That means that the DRBD driver will bind and listen on all local
addresses of the connection-'s paths. It will begin to try to establish
one or more paths of the connection. Available options: drbdsetupnetThe command removes a connection from
a resource.drbdsetupnetThe command removes a path from
a connection. Please not that it fails if
the path is necessary to keep a connected connection in tact. In order
to remove all paths, disconnect the connection first.drbdsetupcstateShow the current state of a connection. The connection is
identified by the node-id of the peer; see the drbdsetup connect command.Remove a replicated device. No lower-level device may be
attached; see drbdsetup detach.Remove a resource. All volumes and connections must be removed
first (drbdsetup del-minor,
drbdsetup disconnect).
Alternatively, drbdsetup down can
be used to remove a resource together with all its volumes and
connections.drbdsetupdetachDetach the lower-level device of a replicated device. Available options:
Force the detach and return immediately. This puts the
lower-level device into failed state until all pending I/O
has completed, and then detaches the device. Any I/O not yet
submitted to the lower-level device (for example, because I/O
on the device was suspended) is assumed to have failed.drbdsetupdisconnectRemove a connection to a peer host. The connection is
identified by the node-id of the peer; see the drbdsetup connect command.drbdsetupdownTake a resource down by removing all volumes, connections, and
the resource itself.
drbdsetupdstateShow the current disk state of a lower-level device.drbdsetupevents2Show the current state of all configured DRBD objects, followed
by all changes to the state.The output format is meant to be human as well as machine
readable. The line starts with a word that indicates the kind of event:
for an existing object;
, , and
if an object is created, destroyed, or
changed; or or if
an event handler is called or it returns. The second word indicates
the object the event applies to: ,
, ,
, , or a dash
() to indicate that the current state has been
dumped completely.The remaining words identify the object and describe the state
that he object is in. Available options:
Terminate after reporting the current state. The
default is to continuously listen and report state
changes.Include statistics in the output.drbdsetupget-giShow the data generation identifiers for a device on a
particular connection. The device is identified by its volume
number. The connection is identified by its endpoints; see the
drbdsetup connect command.The output consists of the current UUID, bitmap UUID, and the
first two history UUIDS, folowed by a set of flags. The current UUID
and history UUIDs are device specific; the bitmap UUID and flags are
peer device specific. This command only shows the first two history
UUIDs. Internally, DRBD maintains one history UUID for each possible
peer device.drbdsetupinvalidateReplace the local data of a device with that of a peer. All
the local data will be marked out-of-sync, and a resync with the
specified peer device will be initialted.drbdsetupinvalidate-remoteReplace a peer device's data of a resource with the local data.
The peer device's data will be marked out-of-sync, and a resync
from the local node to the specified peer will be initiated.drbdsetupnew-current-uuidGenerate a new current UUID and rotates all other UUID values. This has at least two
use cases, namely to skip the initial sync, and to reduce network bandwidth when starting in
a single node configuration and then later (re-)integrating a remote site.Available option: Clears the sync bitmap in addition to generating a new current UUID.This can be used to skip the initial sync, if you want to start from scratch. This
use-case does only work on "Just Created" meta data. Necessary steps: On both nodes, initialize meta data and configure the
device.drbdadm create-md --force
resThey need to do the initial handshake, so they know their sizes.drbdadm up
resThey are now Connected Secondary/Secondary Inconsistent/Inconsistent.
Generate a new current-uuid and clear the dirty bitmap.drbdadm --clear-bitmap new-current-uuid
resThey are now Connected Secondary/Secondary UpToDate/UpToDate. Make one side
primary and create a file system.drbdadm primary
resmkfs -t fs-type $(drbdadm
sh-dev res)One obvious side-effect is that the replica is full of old garbage (unless you made
them identical using other means), so any online-verify is expected to find any number of
out-of-sync blocks.You must not use this on pre-existing data! Even though it may
appear to work at first glance, once you switch to the other node, your data is toast, as it
never got replicated. So do not leave out the mkfs (or
equivalent).This can also be used to shorten the initial resync of a cluster where the second node
is added after the first node is gone into production, by means of disk shipping. This
use-case works on disconnected devices only, the device may be in primary or secondary
role.The necessary steps on the current active server are: drbdsetup new-current-uuid --clear-bitmap minorTake the copy of the current active server. E.g. by pulling a disk out of the
RAID1 controller, or by copying with dd. You need to copy the actual data, and the
meta data.drbdsetup new-current-uuid minor Now add the disk to the new secondary node, and join it to the cluster. You
will get a resync of that parts that were changed since the first call to drbdsetup in step 1.Create a new replicated device within a resource. The command
creates a block device inode for the replicated device (by default,
/dev/drbdminor). The
volume number identifies the device
within the resource.The command creates a new
resource. The command changes
the resource options of an existing resource. Available options:
drbdsetupoutdateMark the data on a lower-level device as outdated. This
is used for fencing, and prevents the resource the device is part
of from becoming primary in the future. See the
disk option.drbdsetuppause-syncStop resynchronizing between a local and a peer device by
setting the local pause flag. The resync can only resume if the
pause flags on both sides of a connection are cleared.drbdsetupprimaryChange the role of a node in a resource to primary. This
allows the replicated devices in this resource to be mounted or
opened for writing. Available options:This option is an alias for the option.Force the resource to become primary even if some devices
are not guaranteed to have up-to-date data. This option is
used to turn one of the nodes in a newly created cluster into
the primary node, or when manually recovering from a
disaster.Note that this can lead to split-brain scenarios. Also,
when forcefully turning an inconsistent device into an
up-to-date device, it is highly recommended to use any
integrity checks available (such as a filesystem check) to
make sure that the device can at least be used without
crashing the system.Note that DRBD usually only allows one node in a cluster to be
in primary role at any time; this allows DRBD to coordinate access
to the devices in a resource across nodes. The
network option changes this;
in that case, a mechanism outside of DRBD needs to coordinate
device access.drbdsetupresizeReexamine the size of the lower-level devices of a replicated
device on all nodes. This command is called after the lower-level
devices on all nodes have been grown to adjust the size of the
replicated device. Available options:
Resize the device even if some of the peer devices are
not connected at the moment. DRBD will try to resize the peer
devices when they next connect. It will refuse to connect to a
peer device which is too small.Do not resynchronize the added disk space; instead,
assume that it is identical on all nodes. This option can be
used when the disk space is uninitialized and differences do
not matter, or when it is known to be identical on all nodes.
See the drbdsetup verify
command.This option can be used to online shrink the usable
size of a drbd device. It's the users responsibility to
make sure that a file system on the device is not
truncated by that operation.These options may be used to change the layout of
the activity log online. In case of internal meta data
this may invovle shrinking the user visible size at the
same time (unsing the ) or
increasing the avalable space on the backing
devices.drbdsetupresume-ioResume I/O on a replicated device. See the
net option.drbdsetupresume-syncAllow resynchronization to resume by clearing the local sync pause flag.drbdsetuproleShow the current role of a resource.drbdsetupsecondaryChange the role of a node in a resource to secondary. This
command fails if the replicated device is in use.drbdsetupshowShow the current configuration of a resource, or of all
resources. Available options:
Show all configuration parameters, even the ones with
default values. Normally, parameters with default values are
not shown.drbdsetupshow-giShow the data generation identifiers for a device on a
particular connection. In addition, explain the output. The output
otherwise is the same as in the drbdsetup
get-gi command.drbdsetupstatedrbdsetupstateThis is an alias for drbdsetup
role. Deprecated.drbdsetupstatusShow the status of a resource, or of all resources. The
output consists of one paragraph for each configured resource. Each
paragraph contains one line for each resource, followed by one line
for each device, and one line for each connection. The device and
connection lines are indented. The connection lines are followed by
one line for each peer device; these lines are indented against the
connection line.Long lines are wrapped around at terminal width, and indented
to indicate how the lines belongs together. Available options:
Include more information in the output even when it is
likely redundant or irrelevant.Include data transfer statistics in the output.Colorize the output. With
,
emits color codes only when standard output is connected to
a terminal.
For example, the non-verbose output for a resource with only
one connection and only one volume could look like this:
drbd0 role:Primary
disk:UpToDate
host2.example.com role:Secondary
disk:UpToDate
With the option, the same resource
could be reported as:
drbd0 node-id:1 role:Primary suspended:no
volume:0 minor:1 disk:UpToDate blocked:no
host2.example.com local:ipv4:192.168.123.4:7788
peer:ipv4:192.168.123.2:7788 node-id:0 connection:WFReportParams
role:Secondary congested:no
volume:0 replication:Connected disk:UpToDate resync-suspended:no
drbdsetupsuspend-ioSuspend I/O on a replicated device. It is not usually
necessary to use this command.drbdsetupverifyStart online verification, change which part of the device will
be verified, or stop online verification. The command requires the
specified peer to be connected.Online verification compares each disk block on the local and
peer node. Blocks which differ between the nodes are marked
as out-of-sync, but they are not automatically
brought back into sync. To bring them into sync, the resource must
be disconnected and reconnected. Progress can be monitored in the
output of drbdsetup status
--statistics. Available options:Define where online verification should start. This
parameter is ignored if online verification is already in
progress. If the start parameter is not specified, online
verification will continue where it was interrupted (if the
connection to the peer was lost while verifying), after the
previous stop sector (if the previous online verification has
finished), or at the beginning of the device (if the end of the
device was reached, or online verify has not run
before).The position on disk is specified in disk sectors (512
bytes) by default.Define where online verification should stop. If online
verification is already in progress, the stop position of the
active online verification process is changed. Use this to
stop online verification.The position on disk is specified in disk sectors (512
bytes) by default.Also see the notes on data integrity in the drbd.conf5 manual page.drbdsetupwait-connect-volumewait-connect-connectionwait-connect-resourcedrbdsetupwait-sync-volumewait-sync-connectionwait-sync-resourceThe commands waits until a device
on a peer is visible. The commands waits
until a device on a peer is up to date. Available options for both
commands:
drbdsetupforget-peerThe command removes all traces of
a peer node from the meta-data. It frees a bitmap slot in the meta-data
and make it avalable for futher bitmap slot allocation in case a
so-far never seen node connects.The connection must be taken down before this command may be used.
In case the peer re-connects at a later point a bit-map based resync
will be turned into a full-sync.ExamplesPlease see the DRBD User's Guide
for examples.VersionThis document was revised for version 9.0.0 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com and Lars
Ellenberg lars.ellenberg@linbit.com.Reporting BugsReport bugs to drbd-user@lists.linbit.com.CopyrightCopyright 2001-2012 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.See Alsodrbd.conf5, drbd8, drbddisk8, drbdadm8,
DRBD User's Guide,
DRBD Web Site
drbd-utils-8.9.6/documentation/v9/drbd-overview.8 0000644 0001750 0001750 00000004051 12654452462 021574 0 ustar apoikos apoikos '\" t
.\" Title: drbd-overview
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 24 June 2014
.\" Manual: System Administration
.\" Source: DRBD 9.0.0
.\" Language: English
.\"
.TH "DRBD\-OVERVIEW" "8" "24 June 2014" "DRBD 9.0.0" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbd-overview \- Overview of all configured DRBD resources
.SH "SYNOPSIS"
.HP \w'\fBdrbd\-overview\fR\ 'u
\fBdrbd\-overview\fR
.SH "DESCRIPTION"
.PP
drbd\-overview offers an overview of the state of all configured DRBD resources\&. It provides information about the connection status of each DRBD resource\&. It will also use auxiliary information provided by
\fBdf\fR(1),
\fBlvm\fR(8),
\fBxm\fR(1)
and
\fBvirsh\fR(1)
for DRBD resources used as mounted filesystems, LVM physical volumes, Xen domain backing disks and libvirt instance disks respectively\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&. Initial man\-page contributed by Apollon Oikonomopoulos apoikos@gmail\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
Copyright 2008\-2014 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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbdsetup\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD Homepage\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD Homepage
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v9/drbdsetup.8 0000644 0001750 0001750 00000175264 12654452457 021034 0 ustar apoikos apoikos '\" t
.\" Title: drbdsetup
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 3 December 2011
.\" Manual: System Administration
.\" Source: DRBD 9.0.0
.\" Language: English
.\"
.TH "DRBDSETUP" "8" "3 December 2011" "DRBD 9.0.0" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdsetup \- Configure the DRBD kernel module.\" drbdsetup
.SH "SYNOPSIS"
.HP \w'\fBdrbdsetup\fR\ 'u
\fBdrbdsetup\fR command {argument...} [option...]
.SH "DESCRIPTION"
.PP
The
\fBdrbdsetup\fR
utility serves to configure the DRBD kernel module and to show its current configuration\&. Users usually interact with the
\fBdrbdadm\fR
utility, which provides a more high\-level interface to DRBD than
\fBdrbdsetup\fR\&. (See
\fBdrbdadm\fR\'s
\fB\-\-dry\-run\fR
option to see how
\fBdrbdadm\fR
uses
\fBdrbdsetup\fR\&.)
.PP
Some option arguments have a default scale which applies when a plain number is specified (for example Kilo, or 1024 times the numeric value)\&. Such default scales can be overridden by using a suffix (for example, M for Mega)\&. The common suffixes K = 2^10 = 1024, M = 1024 K, and G = 1024 M are supported\&.
.SH "COMMANDS"
.PP
\fBdrbdsetup\fR attach \fIminor\fR \fIlower_dev\fR \fImeta_data_dev\fR \fImeta_data_index\fR,
.br
\fBdrbdsetup\fR disk\-options \fIminor\fR
.RS 4
.\" drbdsetup: disk
The
\fBattach\fR
command attaches a lower\-level device to an existing replicated device\&. The
\fBdisk\-options\fR
command changes the disk options of an attached lower\-level device\&. In either case, the replicated device must have been created with
\fBdrbdsetup new\-minor\fR\&.
.sp
Both commands refer to the replicated device by its
\fIminor\fR
number\&.
\fIlower_dev\fR
is the name of the lower\-level device\&.
\fImeta_data_dev\fR
is the name of the device containing the metadata, and may be the same as
\fIlower_dev\fR\&.
\fImeta_data_index\fR
is either a numeric metadata index, or the keyword
\fBinternal\fR
for internal metadata, or the keyword
\fBflexible\fR
for variable\-size external metadata\&. Available options:
.PP
\fB\-\-al\-extents \fR\fB\fIextents\fR\fR
.RS 4
DRBD automatically maintains a "hot" or "active" disk area likely to be written to again soon based on the recent write activity\&. The "active" disk area can be written to immediately, while "inactive" disk areas must be "activated" first, which requires a meta\-data write\&. We also refer to this active disk area as the "activity log"\&.
.sp
The activity log saves meta\-data writes, but the whole log must be resynced upon recovery of a failed node\&. The size of the activity log is a major factor of how long a resync will take and how fast a replicated disk will become consistent after a crash\&.
.sp
The activity log consists of a number of 4\-Megabyte segments; the
\fIal\-extents\fR
parameter determines how many of those segments can be active at the same time\&. The default value for
\fIal\-extents\fR
is 1237, with a minimum of 7 and a maximum of 65536\&.
.sp
Note that the effective maximum may be smaller, depending on how you created the device meta data, see also
\fBdrbdmeta\fR(8)
The effective maximum is 919 * (available on\-disk activity\-log ring\-buffer area/4kB \-1), the default 32kB ring\-buffer effects a maximum of 6433 (covers more than 25 GiB of data) We recommend to keep this well within the amount your backend storage and replication link are able to resync inside of about 5 minutes\&.
.RE
.PP
\fB\-\-al\-updates \fR\fB{yes | no}\fR\fB \fR
.RS 4
With this parameter, the activity log can be turned off entirely (see the
\fBal\-extents\fR
parameter)\&. This will speed up writes because fewer meta\-data writes will be necessary, but the entire device needs to be resynchronized opon recovery of a failed primary node\&. The default value for
\fBal\-updates\fR
is
\fByes\fR\&.
.RE
.PP
\fB\-\-disk\-barrier\fR,
.br
\fB\-\-disk\-flushes\fR,
.br
\fB\-\-disk\-drain\fR
.RS 4
DRBD has three methods of handling the ordering of dependent write requests:
.PP
\fBdisk\-barrier\fR
.RS 4
Use disk barriers to make sure that requests are written to disk in the right order\&. Barriers ensure that all requests submitted before a barrier make it to the disk before any requests submitted after the barrier\&. This is implemented using \'tagged command queuing\' on SCSI devices and \'native command queuing\' on SATA devices\&. Only some devices and device stacks support this method\&. The device mapper (LVM) only supports barriers in some configurations\&.
.sp
Note that on systems which do not support disk barriers, enabling this option can lead to data loss or corruption\&. Until DRBD 8\&.4\&.1,
\fBdisk\-barrier\fR
was turned on if the I/O stack below DRBD did support barriers\&. Kernels since linux\-2\&.6\&.36 (or 2\&.6\&.32 RHEL6) no longer allow to detect if barriers are supported\&. Since drbd\-8\&.4\&.2, this option is off by default and needs to be enabled explicitly\&.
.RE
.PP
\fBdisk\-flushes\fR
.RS 4
Use disk flushes between dependent write requests, also referred to as \'force unit access\' by drive vendors\&. This forces all data to disk\&. This option is enabled by default\&.
.RE
.PP
\fBdisk\-drain\fR
.RS 4
Wait for the request queue to "drain" (that is, wait for the requests to finish) before submitting a dependent write request\&. This method requires that requests are stable on disk when they finish\&. Before DRBD 8\&.0\&.9, this was the only method implemented\&. This option is enabled by default\&. Do not disable in production environments\&.
.RE
.sp
From these three methods, drbd will use the first that is enabled and supported by the backing storage device\&. If all three of these options are turned off, DRBD will submit write requests without bothering about dependencies\&. Depending on the I/O stack, write requests can be reordered, and they can be submitted in a different order on different cluster nodes\&. This can result in data loss or corruption\&. Therefore, turning off all three methods of controlling write ordering is strongly discouraged\&.
.sp
A general guideline for configuring write ordering is to use disk barriers or disk flushes when using ordinary disks (or an ordinary disk array) with a volatile write cache\&. On storage without cache or with a battery backed write cache, disk draining can be a reasonable choice\&.
.RE
.PP
\fB\-\-disk\-timeout\fR
.RS 4
If the lower\-level device on which a DRBD device stores its data does not finish an I/O request within the defined
\fBdisk\-timeout\fR, DRBD treats this as a failure\&. The lower\-level device is detached, and the device\'s disk state advances to Diskless\&. If DRBD is connected to one or more peers, the failed request is passed on to one of them\&.
.sp
This option is
\fIdangerous and may lead to kernel panic!\fR
.sp
"Aborting" requests, or force\-detaching the disk, is intended for completely blocked/hung local backing devices which do no longer complete requests at all, not even do error completions\&. In this situation, usually a hard\-reset and failover is the only way out\&.
.sp
By "aborting", basically faking a local error\-completion, we allow for a more graceful swichover by cleanly migrating services\&. Still the affected node has to be rebooted "soon"\&.
.sp
By completing these requests, we allow the upper layers to re\-use the associated data pages\&.
.sp
If later the local backing device "recovers", and now DMAs some data from disk into the original request pages, in the best case it will just put random data into unused pages; but typically it will corrupt meanwhile completely unrelated data, causing all sorts of damage\&.
.sp
Which means delayed successful completion, especially for READ requests, is a reason to panic()\&. We assume that a delayed *error* completion is OK, though we still will complain noisily about it\&.
.sp
The default value of
\fBdisk\-timeout\fR
is 0, which stands for an infinite timeout\&. Timeouts are specified in units of 0\&.1 seconds\&. This option is available since DRBD 8\&.3\&.12\&.
.RE
.PP
\fB\-\-md\-flushes\fR
.RS 4
Enable disk flushes and disk barriers on the meta\-data device\&. This option is enabled by default\&. See the
\fBdisk\-flushes\fR
parameter\&.
.RE
.PP
\fB\-\-on\-io\-error \fR\fB\fIhandler\fR\fR
.RS 4
Configure how DRBD reacts to I/O errors on a lower\-level device\&. The following policies are defined:
.PP
\fBpass_on\fR
.RS 4
Change the disk status to Inconsistent, mark the failed block as inconsistent in the bitmap, and retry the I/O operation on a remote cluster node\&.
.RE
.PP
\fBcall\-local\-io\-error\fR
.RS 4
Call the
\fBlocal\-io\-error\fR
handler (see the
\fBhandlers\fR
section)\&.
.RE
.PP
\fBdetach\fR
.RS 4
Detach the lower\-level device and continue in diskless mode\&.
.RE
.sp
.RE
.PP
\fB\-\-read\-balancing \fR\fB\fIpolicy\fR\fR
.RS 4
Distribute read requests among cluster nodes as defined by
\fIpolicy\fR\&. The supported policies are
\fBprefer\-local\fR
(the default),
\fBprefer\-remote\fR,
\fBround\-robin\fR,
\fBleast\-pending\fR,
\fBwhen\-congested\-remote\fR,
\fB32K\-striping\fR,
\fB64K\-striping\fR,
\fB128K\-striping\fR,
\fB256K\-striping\fR,
\fB512K\-striping\fR
and
\fB1M\-striping\fR\&.
.sp
This option is available since DRBD 8\&.4\&.1\&.
.RE
.PP
\fBresync\-after \fR\fB\fIminor\fR\fR
.RS 4
Define that a device should only resynchronize after the specified other device\&. By default, no order between devices is defined, and all devices will resynchronize in parallel\&. Depending on the configuration of the lower\-level devices, and the available network and disk bandwidth, this can slow down the overall resync process\&. This option can be used to form a chain or tree of dependencies among devices\&.
.RE
.PP
\fB\-\-size \fR\fB\fIsize\fR\fR
.RS 4
Specify the size of the lower\-level device explicitly instead of determining it automatically\&. The device size must be determined once and is remembered for the lifetime of the device\&. In order to determine it automatically, all the lower\-level devices on all nodes must be attached, and all nodes must be connected\&. If the size is specified explicitly, this is not necessary\&. The
\fBsize\fR
value is assumed to be in units of sectors (512 bytes) by default\&.
.RE
.PP
\fB\-\-discard\-zeroes\-if\-aligned \fR\fB{yes | no}\fR
.RS 4
There are several aspects to discard/trim/unmap support on linux block devices\&. Even if discard is supported in general, it may fail silently, or may partially ignore discard requests\&. Devices also announce whether reading from unmapped blocks returns defined data (usually zeroes), or undefined data (possibly old data, possibly garbage)\&.
.sp
If on different nodes, DRBD is backed by devices with differing discard characteristics, discards may lead to data divergence (old data or garbage left over on one backend, zeroes due to unmapped areas on the other backend)\&. Online verify would now potentially report tons of spurious differences\&. While probably harmless for most use cases (fstrim on a file system), DRBD cannot have that\&.
.sp
To play safe, we have to disable discard support, if our local backend (on a Primary) does not support "discard_zeroes_data=true"\&. We also have to translate discards to explicit zero\-out on the receiving side, unless the receiving side (Secondary) supports "discard_zeroes_data=true", thereby allocating areas what were supposed to be unmapped\&.
.sp
There are some devices (notably the LVM/DM thin provisioning) that are capable of discard, but announce discard_zeroes_data=false\&. In the case of DM\-thin, discards aligned to the chunk size will be unmapped, and reading from unmapped sectors will return zeroes\&. However, unaligned partial head or tail areas of discard requests will be silently ignored\&.
.sp
If we now add a helper to explicitly zero\-out these unaligned partial areas, while passing on the discard of the aligned full chunks, we effectively achieve discard_zeroes_data=true on such devices\&.
.sp
Setting
\fBdiscard\-zeroes\-if\-aligned\fR
to
\fByes\fR
will allow DRBD to use discards, and to announce discard_zeroes_data=true, even on backends that announce discard_zeroes_data=false\&.
.sp
Setting
\fBdiscard\-zeroes\-if\-aligned\fR
to
\fBno\fR
will cause DRBD to always fall\-back to zero\-out on the receiving side, and to not even announce discard capabilities on the Primary, if the respective backend announces discard_zeroes_data=false\&.
.sp
We used to ignore the discard_zeroes_data setting completely\&. To not break established and expected behaviour, and suddenly cause fstrim on thin\-provisioned LVs to run out\-of\-space instead of freeing up space, the default value is
\fByes\fR\&.
.sp
This option is available since 8\&.4\&.7\&.
.RE
.PP
\fB\-\-rs\-discard\-granularity \fR\fB\fIbyte\fR\fR
.RS 4
When
\fBrs\-discard\-granularity\fR
is set to a non zero, positive value then DRBD tries to do a resync operation in requests of this size\&. In case such a block contains only zero bytes on the sync source node, the sync target node will issue a discard/trim/unmap command for the area\&.
.sp
The value is constrained by the discard granularity of the backing block device\&. In case
\fBrs\-discard\-granularity\fR
is not a multiplier of the discard granularity of the backing block device DRBD rounds it up\&. The feature only gets active if the backing block device reads back zeroes after a discard command\&.
.sp
The default value of is 0\&. This option is available since 8\&.4\&.7\&.
.RE
.RE
.PP
\fBdrbdsetup\fR peer\-device\-options \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR
.RS 4
.\" drbdsetup: peer-device-options
These are options that affect the
\fIpeer\fR\'s device\&.
.PP
\fB\-\-c\-delay\-target \fR\fB\fIdelay_target\fR\fR,
.br
\fB\-\-c\-fill\-target \fR\fB\fIfill_target\fR\fR,
.br
\fB\-\-c\-max\-rate \fR\fB\fImax_rate\fR\fR,
.br
\fB\-\-c\-plan\-ahead \fR\fB\fIplan_time\fR\fR
.RS 4
Dynamically control the resync speed\&. This mechanism is enabled by setting the
\fBc\-plan\-ahead\fR
parameter to a positive value\&. The goal is to either fill the buffers along the data path with a defined amount of data if
\fBc\-fill\-target\fR
is defined, or to have a defined delay along the path if
\fBc\-delay\-target\fR
is defined\&. The maximum bandwidth is limited by the
\fBc\-max\-rate\fR
parameter\&.
.sp
The
\fBc\-plan\-ahead\fR
parameter defines how fast drbd adapts to changes in the resync speed\&. It should be set to five times the network round\-trip time or more\&. Common values for
\fBc\-fill\-target\fR
for "normal" data paths range from 4K to 100K\&. If drbd\-proxy is used, it is advised to use
\fBc\-delay\-target\fR
instead of
\fBc\-fill\-target\fR\&. The
\fBc\-delay\-target\fR
parameter is used if the
\fBc\-fill\-target\fR
parameter is undefined or set to 0\&. The
\fBc\-delay\-target\fR
parameter should be set to five times the network round\-trip time or more\&. The
\fBc\-max\-rate\fR
option should be set to either the bandwidth available between the DRBD\-hosts and the machines hosting DRBD\-proxy, or to the available disk bandwidth\&.
.sp
The default values of these parameters are:
\fBc\-plan\-ahead\fR
= 20 (in units of 0\&.1 seconds),
\fBc\-fill\-target\fR
= 0 (in units of sectors),
\fBc\-delay\-target\fR
= 1 (in units of 0\&.1 seconds), and
\fBc\-max\-rate\fR
= 102400 (in units of KiB/s)\&.
.sp
Dynamic resync speed control is available since DRBD 8\&.3\&.9\&.
.RE
.PP
.RS 4
.RE
.PP
.RS 4
.RE
.PP
\fB\-\-c\-min\-rate \fR\fB\fImin_rate\fR\fR
.RS 4
A node which is primary and sync\-source has to schedule application I/O requests and resync I/O requests\&. The
\fBc\-min\-rate\fR
parameter limits how much bandwidth is available for resync I/O; the remaining bandwidth is used for application I/O\&.
.sp
A
\fBc\-min\-rate\fR
value of 0 means that there is no limit on the resync I/O bandwidth\&. This can slow down application I/O significantly\&. Use a value of 1 (1 KiB/s) for the lowest possible resync rate\&.
.sp
The default value of
\fBc\-min\-rate\fR
is 4096, in units of KiB/s\&.
.RE
.PP
.RS 4
.RE
.PP
\fB\-\-resync\-rate \fR\fB\fIrate\fR\fR
.RS 4
Define how much bandwidth DRBD may use for resynchronizing\&. DRBD allows "normal" application I/O even during a resync\&. If the resync takes up too much bandwidth, application I/O can become very slow\&. This parameter allows to avoid that\&. Please note this is option only works when the dynamic resync controller is disabled\&.
.RE
.RE
.PP
\fBdrbdsetup\fR check\-resize \fIminor\fR
.RS 4
.\" drbdsetup: check-resize
Remember the current size of the lower\-level device of the specified replicated device\&. Used by drbdadm\&. The size information is stored in file /var/lib/drbd/drbd\-minor\-\fIminor\fR\&.lkbd\&.
.RE
.PP
\fBdrbdsetup\fR new\-peer \fIresource\fR \fIpeer_node_id\fR,
.br
\fBdrbdsetup\fR net\-options \fIresource\fR \fIpeer_node_id\fR
.RS 4
.\" drbdsetup: net
The
\fBnew\-peer\fR
command creates a connection within a
\fIresource\fR\&. The resource must have been created with
\fBdrbdsetup new\-resource\fR\&. The
\fBnet\-options\fR
command changes the network options of an existing connection\&. Before a connection can be activated with the
\fBconnect\fR
command, at least one path need to added with the
\fBnew\-path\fR
command\&. Available options:
.PP
\fB\-\-after\-sb\-0pri \fR\fB\fIpolicy\fR\fR
.RS 4
Define how to react if a split\-brain scenario is detected and none of the two nodes is in primary role\&. (We detect split\-brain scenarios when two nodes connect; split\-brain decisions are always between two nodes\&.) The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization; simply disconnect\&.
.RE
.PP
\fBdiscard\-younger\-primary\fR,
.br
\fBdiscard\-older\-primary\fR
.RS 4
Resynchronize from the node which became primary first (\fBdiscard\-younger\-primary\fR) or last (\fBdiscard\-older\-primary\fR)\&. If both nodes became primary independently, the
\fBdiscard\-least\-changes\fR
policy is used\&.
.RE
.PP
\fBdiscard\-zero\-changes\fR
.RS 4
If only one of the nodes wrote data since the split brain situation was detected, resynchronize from this node to the other\&. If both nodes wrote data, disconnect\&.
.RE
.PP
\fBdiscard\-least\-changes\fR
.RS 4
Resynchronize from the node with more modified blocks\&.
.RE
.PP
\fBdiscard\-node\-\fR\fB\fInodename\fR\fR
.RS 4
Always resynchronize to the named node\&.
.RE
.RE
.PP
\fB\-\-after\-sb\-1pri \fR\fB\fIpolicy\fR\fR
.RS 4
Define how to react if a split\-brain scenario is detected, with one node in primary role and one node in secondary role\&. (We detect split\-brain scenarios when two nodes connect, so split\-brain decisions are always among two nodes\&.) The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBconsensus\fR
.RS 4
Discard the data on the secondary node if the
\fBafter\-sb\-0pri\fR
algorithm would also discard the data on the secondary node\&. Otherwise, disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm, even if it causes an erratic change of the primary\'s view of the data\&. This is only useful if a single\-node file system (i\&.e\&., not OCFS2 or GFS) with the
\fBallow\-two\-primaries\fR
flag is used\&. This option can cause the primary node to crash, and should not be used\&.
.RE
.PP
\fBdiscard\-secondary\fR
.RS 4
Discard the data on the secondary node\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm\&. If the decision is to discard the data on the primary node, call the
\fBpri\-lost\-after\-sb\fR
handler on the primary node\&.
.RE
.RE
.PP
\fB\-\-after\-sb\-2pri \fR\fB\fIpolicy\fR\fR
.RS 4
Define how to react if a split\-brain scenario is detected and both nodes are in primary role\&. (We detect split\-brain scenarios when two nodes connect, so split\-brain decisions are always among two nodes\&.) The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
See the
\fBviolently\-as0p\fR
policy for
\fBafter\-sb\-1pri\fR\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Call the
\fBpri\-lost\-after\-sb\fR
helper program on one of the machines unless that machine can demote to secondary\&. The helper program is expected to reboot the machine, which brings the node into a secondary role\&. Which machine runs the helper program is determined by the
\fBafter\-sb\-0pri\fR
strategy\&.
.RE
.RE
.PP
\fB\-\-allow\-two\-primaries\fR
.RS 4
The most common way to configure DRBD devices is to allow only one node to be primary (and thus writable) at a time\&.
.sp
In some scenarios it is preferable to allow two nodes to be primary at once; a mechanism outside of DRBD then must make sure that writes to the shared, replicated device happen in a coordinated way\&. This can be done with a shared\-storage cluster file system like OCFS2 and GFS, or with virtual machine images and a virtual machine manager that can migrate virtual machines between physical machines\&.
.sp
The
\fBallow\-two\-primaries\fR
parameter tells DRBD to allow two nodes to be primary at the same time\&. Never enable this option when using a non\-distributed file system; otherwise, data corruption and node crashes will result!
.RE
.PP
\fB\-\-always\-asbp\fR
.RS 4
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\&.
.sp
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\&.)
.RE
.PP
\fB\-\-connect\-int \fR\fB\fItime\fR\fR
.RS 4
As soon as a connection between two nodes is configured with
\fBdrbdsetup connect\fR, DRBD immediately tries to establish the connection\&. If this fails, DRBD waits for
\fBconnect\-int\fR
seconds and then repeats\&. The default value of
\fBconnect\-int\fR
is 10 seconds\&.
.RE
.PP
\fB\-\-cram\-hmac\-alg \fR\fB\fIhash\-algorithm\fR\fR
.RS 4
Configure the hash\-based message authentication code (HMAC) or secure hash algorithm to use for peer authentication\&. The kernel supports a number of different algorithms, some of which may be loadable as kernel modules\&. See the shash algorithms listed in /proc/crypto\&. By default,
\fBcram\-hmac\-alg\fR
is unset\&. Peer authentication also requires a
\fBshared\-secret\fR
to be configured\&.
.RE
.PP
\fB\-\-csums\-alg \fR\fB\fIhash\-algorithm\fR\fR
.RS 4
Normally, when two nodes resynchronize, the sync target requests a piece of out\-of\-sync data from the sync source, and the sync source sends the data\&. With many usage patterns, a significant number of those blocks will actually be identical\&.
.sp
When a
\fBcsums\-alg\fR
algorithm is specified, when requesting a piece of out\-of\-sync data, the sync target also sends along a hash of the data it currently has\&. The sync source compares this hash with its own version of the data\&. It sends the sync target the new data if the hashes differ, and tells it that the data are the same otherwise\&. This reduces the network bandwidth required, at the cost of higher cpu utilization and possibly increased I/O on the sync target\&.
.sp
The
\fBcsums\-alg\fR
can be set to one of the secure hash algorithms supported by the kernel; see the shash algorithms listed in /proc/crypto\&. By default,
\fBcsums\-alg\fR
is unset\&.
.RE
.PP
\fB\-\-csums\-after\-crash\-only\fR
.RS 4
Enabling this option (and csums\-alg, above) makes it possible to use the checksum based resync only for the first resync after primary crash, but not for later "network hickups"\&.
.sp
In most cases, block that are marked as need\-to\-be\-resynced are in fact changed, so calculating checksums, and both reading and writing the blocks on the resync target is all effective overhead\&.
.sp
The advantage of checksum based resync is mostly after primary crash recovery, where the recovery marked larger areas (those covered by the activity log) as need\-to\-be\-resynced, just in case\&. Introduced in 8\&.4\&.5\&.
.RE
.PP
\fB\-\-data\-integrity\-alg \fR \fIalg\fR
.RS 4
DRBD normally relies on the data integrity checks built into the TCP/IP protocol, but if a data integrity algorithm is configured, it will additionally use this algorithm to make sure that the data received over the network match what the sender has sent\&. If a data integrity error is detected, DRBD will close the network connection and reconnect, which will trigger a resync\&.
.sp
The
\fBdata\-integrity\-alg\fR
can be set to one of the secure hash algorithms supported by the kernel; see the shash algorithms listed in /proc/crypto\&. By default, this mechanism is turned off\&.
.sp
Because of the CPU overhead involved, we recommend not to use this option in production environments\&. Also see the notes on data integrity below\&.
.RE
.PP
\fB\-\-fencing \fR\fB\fIfencing_policy\fR\fR
.RS 4
\fBFencing\fR
is a preventive measure to avoid situations where both nodes are primary and disconnected\&. This is also known as a split\-brain situation\&. DRBD supports the following fencing policies:
.PP
\fBdont\-care\fR
.RS 4
No fencing actions are taken\&. This is the default policy\&.
.RE
.PP
\fBresource\-only\fR
.RS 4
If a node becomes a disconnected primary, it tries to fence the peer\&. This is done by calling the
\fBfence\-peer\fR
handler\&. The handler is supposed to reach the peer over an alternative communication path and call \'\fBdrbdadm outdate minor\fR\' there\&.
.RE
.PP
\fBresource\-and\-stonith\fR
.RS 4
If a node becomes a disconnected primary, it freezes all its IO operations and calls its fence\-peer handler\&. The fence\-peer handler is supposed to reach the peer over an alternative communication path and call \'\fBdrbdadm outdate minor\fR\' there\&. In case it cannot do that, it should stonith the peer\&. IO is resumed as soon as the situation is resolved\&. In case the fence\-peer handler fails, I/O can be resumed manually with \'\fBdrbdadm resume\-io\fR\'\&.
.RE
.RE
.PP
\fB\-\-ko\-count \fR\fB\fInumber\fR\fR
.RS 4
If a secondary node fails to complete a write request in
\fBko\-count\fR
times the
\fBtimeout\fR
parameter, it is excluded from the cluster\&. The primary node then sets the connection to this secondary node to Standalone\&. To disable this feature, you should explicitly set it to 0; defaults may change between versions\&.
.RE
.PP
\fB\-\-max\-buffers \fR\fB\fInumber\fR\fR
.RS 4
Limits the memory usage per DRBD minor device on the receiving side, or for internal buffers during resync or online\-verify\&. Unit is PAGE_SIZE, which is 4 KiB on most systems\&. The minimum possible setting is hard coded to 32 (=128 KiB)\&. These buffers are used to hold data blocks while they are written to/read from disk\&. To avoid possible distributed deadlocks on congestion, this setting is used as a throttle threshold rather than a hard limit\&. Once more than max\-buffers pages are in use, further allocation from this pool is throttled\&. You want to increase max\-buffers if you cannot saturate the IO backend on the receiving side\&.
.RE
.PP
\fB\-\-max\-epoch\-size \fR\fB\fInumber\fR\fR
.RS 4
Define the maximum number of write requests DRBD may issue before issuing a write barrier\&. The default value is 2048, with a minimum of 1 and a maximum of 20000\&. Setting this parameter to a value below 10 is likely to decrease performance\&.
.RE
.PP
\fB\-\-on\-congestion \fR\fB\fIpolicy\fR\fR,
.br
\fB\-\-congestion\-fill \fR\fB\fIthreshold\fR\fR,
.br
\fB\-\-congestion\-extents \fR\fB\fIthreshold\fR\fR
.RS 4
By default, DRBD blocks when the TCP send queue is full\&. This prevents applications from generating further write requests until more buffer space becomes available again\&.
.sp
When DRBD is used together with DRBD\-proxy, it can be better to use the
\fBpull\-ahead\fR
\fBon\-congestion\fR
policy, which can switch DRBD into ahead/behind mode before the send queue is full\&. DRBD then records the differences between itself and the peer in its bitmap, but it no longer replicates them to the peer\&. When enough buffer space becomes available again, the node resynchronizes with the peer and switches back to normal replication\&.
.sp
This has the advantage of not blocking application I/O even when the queues fill up, and the disadvantage that peer nodes can fall behind much further\&. Also, while resynchronizing, peer nodes will become inconsistent\&.
.sp
The available congestion policies are
\fBblock\fR
(the default) and
\fBpull\-ahead\fR\&. The
\fBcongestion\-fill\fR
parameter defines how much data is allowed to be "in flight" in this connection\&. The default value is 0, which disables this mechanism of congestion control, with a maximum of 10 GiBytes\&. The
\fBcongestion\-extents\fR
parameter defines how many bitmap extents may be active before switching into ahead/behind mode, with the same default and limits as the
\fBal\-extents\fR
parameter\&. The
\fBcongestion\-extents\fR
parameter is effective only when set to a value smaller than
\fBal\-extents\fR\&.
.sp
Ahead/behind mode is available since DRBD 8\&.3\&.10\&.
.RE
.PP
\fB\-\-ping\-int \fR\fB\fIinterval\fR\fR
.RS 4
When the TCP/IP connection to a peer is idle for more than
\fBping\-int\fR
seconds, DRBD will send a keep\-alive packet to make sure that a failed peer or network connection is detected reasonably soon\&. The default value is 10 seconds, with a minimum of 1 and a maximum of 120 seconds\&. The unit is seconds\&.
.RE
.PP
\fB\-\-ping\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
Define the timeout for replies to keep\-alive packets\&. If the peer does not reply within
\fBping\-timeout\fR, DRBD will close and try to reestablish the connection\&. The default value is 0\&.5 seconds, with a minimum of 0\&.1 seconds and a maximum of 3 seconds\&. The unit is tenths of a second\&.
.RE
.PP
\fB\-\-socket\-check\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
In setups involving a DRBD\-proxy and connections that experience a lot of buffer\-bloat it might be necessary to set
\fBping\-timeout\fR
to an unusual high value\&. By default DRBD uses the same value to wait if a newly established TCP\-connection is stable\&. Since the DRBD\-proxy is usually located in the same data center such a long wait time may hinder DRBD\'s connect process\&.
.sp
In such setups
\fBsocket\-check\-timeout\fR
should be set to at least to the round trip time between DRBD and DRBD\-proxy\&. I\&.e\&. in most cases to 1\&.
.sp
The default unit is tenths of a second, the default value is 0 (which causes DRBD to use the value of
\fBping\-timeout\fR
instead)\&. Introduced in 8\&.4\&.5\&.
.RE
.PP
\fB\-\-protocol \fR\fB\fIname\fR\fR
.RS 4
Use the specified protocol on this connection\&. The supported protocols are:
.PP
\fBA\fR
.RS 4
Writes to the DRBD device complete as soon as they have reached the local disk and the TCP/IP send buffer\&.
.RE
.PP
\fBB\fR
.RS 4
Writes to the DRBD device complete as soon as they have reached the local disk, and all peers have acknowledged the receipt of the write requests\&.
.RE
.PP
\fBC\fR
.RS 4
Writes to the DRBD device complete as soon as they have reached the local and all remote disks\&.
.RE
.sp
.RE
.PP
\fB\-\-rcvbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
Configure the size of the TCP/IP receive buffer\&. A value of 0 (the default) causes the buffer size to adjust dynamically\&. This parameter usually does not need to be set, but it can be set to a value up to 10 MiB\&. The default unit is bytes\&.
.RE
.PP
\fB\-\-rr\-conflict\fR \fIpolicy\fR
.RS 4
This option helps to solve the cases when the outcome of the resync decision is incompatible with the current role assignment in the cluster\&. The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\fR
.RS 4
Resync to the primary node is allowed, violating the assumption that data on a block device are stable for one of the nodes\&.
\fIDo not use this option, it is dangerous\&.\fR
.RE
.PP
\fBcall\-pri\-lost\fR
.RS 4
Call the
\fBpri\-lost\fR
handler on one of the machines\&. The handler is expected to reboot the machine, which puts it into secondary role\&.
.RE
.RE
.PP
\fB\-\-shared\-secret \fR\fB\fIsecret\fR\fR
.RS 4
Configure the shared secret used for peer authentication\&. The secret is a string of up to 64 characters\&. Peer authentication also requires the
\fBcram\-hmac\-alg\fR
parameter to be set\&.
.RE
.PP
\fB\-\-sndbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
Configure the size of the TCP/IP send buffer\&. Since DRBD 8\&.0\&.13 / 8\&.2\&.7, a value of 0 (the default) causes the buffer size to adjust dynamically\&. Values below 32 KiB are harmful to the throughput on this connection\&. Large buffer sizes can be useful especially when protocol A is used over high\-latency networks; the maximum value supported is 10 MiB\&.
.RE
.PP
\fB\-\-tcp\-cork\fR
.RS 4
By default, DRBD uses the TCP_CORK socket option to prevent the kernel from sending partial messages; this results in fewer and bigger packets on the network\&. Some network stacks can perform worse with this optimization\&. On these, the
\fBtcp\-cork\fR
parameter can be used to turn this optimization off\&.
.RE
.PP
\fB\-\-timeout \fR\fB\fItime\fR\fR
.RS 4
Define the timeout for replies over the network: if a peer node does not send an expected reply within the specified
\fBtimeout\fR, it is considered dead and the TCP/IP connection is closed\&. The timeout value must be lower than
\fBconnect\-int\fR
and lower than
\fBping\-int\fR\&. The default is 6 seconds; the value is specified in tenths of a second\&.
.RE
.PP
\fB\-\-unplug\-watermark \fR\fB\fInumber\fR\fR
.RS 4
Mainline kernels before version 2\&.6\&.39\-rc1 use an explicit plug / unplug mechanism to control when a block device starts processing queued requests\&. On those kernels, the
\fBunplug\-watermark\fR
parameter defines how many requests must be queued until a secondary node starts processing them\&. Some storage controllers perform best when
\fBunplug\-watermark\fR
is set to the same value as
\fBmax\-buffers\fR; others are more efficient with smaller values\&. The default value for
\fBunplug\-watermark\fR
is 128, with a minimum of 16 and a maximum of 131072\&.
.sp
More recent kernels handle plugging and unplugging implicitly; on those kernels, this parameter has no effect\&. Note that some distributions have backported this feature to older kernel versions\&.
.RE
.PP
\fB\-\-use\-rle\fR
.RS 4
Each replicated device on a cluster node has a separate bitmap for each of its peer devices\&. The bitmaps are used for tracking the differences between the local and peer device: depending on the cluster state, a disk range can be marked as different from the peer in the device\'s bitmap, in the peer device\'s bitmap, or in both bitmaps\&. When two cluster nodes connect, they exchange each other\'s bitmaps, and they each compute the union of the local and peer bitmap to determine the overall differences\&.
.sp
Bitmaps of very large devices are also relatively large, but they usually compress very well using run\-length encoding\&. This can save time and bandwidth for the bitmap transfers\&.
.sp
The
\fBuse\-rle\fR
parameter determines if run\-length encoding should be used\&. It is on by default since DRBD 8\&.4\&.0\&.
.RE
.PP
\fB\-\-verify\-alg \fR\fB\fIhash\-algorithm\fR\fR
.RS 4
Online verification (\fBdrbdadm verify\fR) computes and compares checksums of disk blocks (i\&.e\&., hash values) in order to detect if they differ\&. The
\fBverify\-alg\fR
parameter determines which algorithm to use for these checksums\&. It must be set to one of the secure hash algorithms supported by the kernel before online verify can be used; see the shash algorithms listed in /proc/crypto\&.
.sp
We recommend to schedule online verifications regularly during low\-load periods, for example once a month\&. Also see the notes on data integrity below\&.
.RE
.RE
.PP
\fBdrbdsetup\fR new\-path \fIresource\fR \fIpeer_node_id\fR \fIlocal\-addr\fR \fIremote\-addr\fR
.RS 4
.\" drbdsetup: net
The
\fBnew\-path\fR
command creates a path within a
\fIconnection\fR\&. The connection must have been created with
\fBdrbdsetup new\-peer\fR\&.
\fILocal_addr\fR
and
\fIremote_addr\fR
refer to the local and remote protocol, network address, and port in the format
[\fIaddress\-family\fR:]\fIaddress\fR[:\fIport\fR]\&. The address families
\fBipv4\fR,
\fBipv6\fR,
\fBssocks\fR
(Dolphin Interconnect Solutions\' "super sockets"),
\fBsdp\fR
(Infiniband Sockets Direct Protocol), and
\fBsci\fR
are supported (\fBsci\fR
is an alias for
\fBssocks\fR)\&. If no address family is specified,
\fBipv4\fR
is assumed\&. For all address families except
\fBipv6\fR, the
\fIaddress\fR
uses IPv4 address notation (for example, 1\&.2\&.3\&.4)\&. For
\fBipv6\fR, the address is enclosed in brackets and uses IPv6 address notation (for example, [fd01:2345:6789:abcd::1])\&. The
\fIport\fR
defaults to 7788\&.
.RE
.PP
\fBdrbdsetup\fR connect \fIresource\fR \fIpeer_node_id\fR
.RS 4
.\" drbdsetup: net
The
\fBconnect\fR
command activates a connection\&. That means that the DRBD driver will bind and listen on all local addresses of the connection\-\'s paths\&. It will begin to try to establish one or more paths of the connection\&. Available options:
.PP
\fB\-\-tentative\fR
.RS 4
Only determine if a connection to the peer can be established and if a resync is necessary (and in which direction) without actually establishing the connection or starting the resync\&. Check the system log to see what DRBD would do without the
\fB\-\-tentative\fR
option\&.
.RE
.PP
\fB\-\-discard\-my\-data\fR
.RS 4
Discard the local data and resynchronize with the peer that has the most up\-to\-data data\&. Use this option to manually recover from a split\-brain situation\&.
.RE
.RE
.PP
\fBdrbdsetup\fR del\-peer \fIresource\fR \fIpeer_node_id\fR
.RS 4
.\" drbdsetup: net
The
\fBdel\-peer\fR
command removes a connection from a
\fIresource\fR\&.
.RE
.PP
\fBdrbdsetup\fR del\-path \fIresource\fR \fIpeer_node_id\fR \fIlocal\-addr\fR \fIremote\-addr\fR
.RS 4
.\" drbdsetup: net
The
\fBdel\-path\fR
command removes a path from a
\fIconnection\fR\&. Please not that it fails if the path is necessary to keep a connected connection in tact\&. In order to remove all paths, disconnect the connection first\&.
.RE
.PP
\fBdrbdsetup\fR cstate \fIresource\fR \fIpeer_node_id\fR
.RS 4
.\" drbdsetup: cstate
Show the current state of a connection\&. The connection is identified by the node\-id of the peer; see the
\fBdrbdsetup connect\fR
command\&.
.RE
.PP
\fBdrbdsetup\fR del\-minor \fIminor\fR
.RS 4
Remove a replicated device\&. No lower\-level device may be attached; see
\fBdrbdsetup detach\fR\&.
.RE
.PP
\fBdrbdsetup\fR del\-resource \fIresource\fR
.RS 4
Remove a resource\&. All volumes and connections must be removed first (\fBdrbdsetup del\-minor\fR,
\fBdrbdsetup disconnect\fR)\&. Alternatively,
\fBdrbdsetup down\fR
can be used to remove a resource together with all its volumes and connections\&.
.RE
.PP
\fBdrbdsetup\fR detach \fIminor\fR
.RS 4
.\" drbdsetup: detach
Detach the lower\-level device of a replicated device\&. Available options:
.PP
\fB\-\-force\fR
.RS 4
Force the detach and return immediately\&. This puts the lower\-level device into failed state until all pending I/O has completed, and then detaches the device\&. Any I/O not yet submitted to the lower\-level device (for example, because I/O on the device was suspended) is assumed to have failed\&.
.RE
.sp
.RE
.PP
\fBdrbdsetup\fR disconnect \fIresource\fR \fIpeer_node_id\fR
.RS 4
.\" drbdsetup: disconnect
Remove a connection to a peer host\&. The connection is identified by the node\-id of the peer; see the
\fBdrbdsetup connect\fR
command\&.
.RE
.PP
\fBdrbdsetup\fR down {\fIresource\fR | \fIall\fR}
.RS 4
.\" drbdsetup: down
Take a resource down by removing all volumes, connections, and the resource itself\&.
.RE
.PP
\fBdrbdsetup\fR dstate \fIminor\fR
.RS 4
.\" drbdsetup: dstate
Show the current disk state of a lower\-level device\&.
.RE
.PP
\fBdrbdsetup\fR events2 {\fIresource\fR | \fIall\fR}
.RS 4
.\" drbdsetup: events2
Show the current state of all configured DRBD objects, followed by all changes to the state\&.
.sp
The output format is meant to be human as well as machine readable\&. The line starts with a word that indicates the kind of event:
\fBexists\fR
for an existing object;
\fBcreate\fR,
\fBdestroy\fR, and
\fBchange\fR
if an object is created, destroyed, or changed; or
\fBcall\fR
or
\fBresponse\fR
if an event handler is called or it returns\&. The second word indicates the object the event applies to:
\fBresource\fR,
\fBdevice\fR,
\fBconnection\fR,
\fBpeer\-device\fR,
\fBhelper\fR, or a dash (\fB\-\fR) to indicate that the current state has been dumped completely\&.
.sp
The remaining words identify the object and describe the state that he object is in\&. Available options:
.PP
\fB\-\-now\fR
.RS 4
Terminate after reporting the current state\&. The default is to continuously listen and report state changes\&.
.RE
.PP
\fB\-\-statistics\fR
.RS 4
Include statistics in the output\&.
.RE
.sp
.RE
.PP
\fBdrbdsetup\fR get\-gi \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR
.RS 4
.\" drbdsetup: get-gi
Show the data generation identifiers for a device on a particular connection\&. The device is identified by its volume number\&. The connection is identified by its endpoints; see the
\fBdrbdsetup connect\fR
command\&.
.sp
The output consists of the current UUID, bitmap UUID, and the first two history UUIDS, folowed by a set of flags\&. The current UUID and history UUIDs are device specific; the bitmap UUID and flags are peer device specific\&. This command only shows the first two history UUIDs\&. Internally, DRBD maintains one history UUID for each possible peer device\&.
.RE
.PP
\fBdrbdsetup\fR invalidate \fIminor\fR
.RS 4
.\" drbdsetup: invalidate
Replace the local data of a device with that of a peer\&. All the local data will be marked out\-of\-sync, and a resync with the specified peer device will be initialted\&.
.RE
.PP
\fBdrbdsetup\fR invalidate\-remote \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR
.RS 4
.\" drbdsetup: invalidate-remote
Replace a peer device\'s data of a resource with the local data\&. The peer device\'s data will be marked out\-of\-sync, and a resync from the local node to the specified peer will be initiated\&.
.RE
.PP
\fBdrbdsetup\fR new\-current\-uuid \fIminor\fR
.RS 4
.\" drbdsetup: new-current-uuid
Generate a new current UUID and rotates all other UUID values\&. This has at least two use cases, namely to skip the initial sync, and to reduce network bandwidth when starting in a single node configuration and then later (re\-)integrating a remote site\&.
.sp
Available option:
.PP
\fB\-\-clear\-bitmap\fR
.RS 4
Clears the sync bitmap in addition to generating a new current UUID\&.
.RE
.sp
This can be used to skip the initial sync, if you want to start from scratch\&. This use\-case does only work on "Just Created" meta data\&. Necessary steps:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
On
\fIboth\fR
nodes, initialize meta data and configure the device\&.
.sp
\fBdrbdadm create\-md \-\-force \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
They need to do the initial handshake, so they know their sizes\&.
.sp
\fBdrbdadm up \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
They are now Connected Secondary/Secondary Inconsistent/Inconsistent\&. Generate a new current\-uuid and clear the dirty bitmap\&.
.sp
\fBdrbdadm \-\-clear\-bitmap new\-current\-uuid \fR\fB\fIres\fR\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
They are now Connected Secondary/Secondary UpToDate/UpToDate\&. Make one side primary and create a file system\&.
.sp
\fBdrbdadm primary \fR\fB\fIres\fR\fR
.sp
\fBmkfs \-t \fR\fB\fIfs\-type\fR\fR\fB $(drbdadm sh\-dev \fR\fB\fIres\fR\fR\fB)\fR
.RE
.RS 4
.sp
One obvious side\-effect is that the replica is full of old garbage (unless you made them identical using other means), so any online\-verify is expected to find any number of out\-of\-sync blocks\&.
.sp
\fIYou must not use this on pre\-existing data!\fR
Even though it may appear to work at first glance, once you switch to the other node, your data is toast, as it never got replicated\&. So
\fIdo not leave out the mkfs\fR
(or equivalent)\&.
.sp
This can also be used to shorten the initial resync of a cluster where the second node is added after the first node is gone into production, by means of disk shipping\&. This use\-case works on disconnected devices only, the device may be in primary or secondary role\&.
.sp
The necessary steps on the current active server are:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
\fBdrbdsetup new\-current\-uuid \-\-clear\-bitmap \fR\fB\fIminor\fR\fR\fB \fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
Take the copy of the current active server\&. E\&.g\&. by pulling a disk out of the RAID1 controller, or by copying with dd\&. You need to copy the actual data, and the meta data\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
\fBdrbdsetup new\-current\-uuid \fR\fB\fIminor\fR\fR\fB \fR
.RE
.RS 4
Now add the disk to the new secondary node, and join it to the cluster\&. You will get a resync of that parts that were changed since the first call to
\fBdrbdsetup\fR
in step 1\&.
.RE
.PP
\fBdrbdsetup\fR new\-minor \fIresource\fR \fIminor\fR \fIvolume\fR
.RS 4
Create a new replicated device within a resource\&. The command creates a block device inode for the replicated device (by default, /dev/drbd\fIminor\fR)\&. The
\fIvolume\fR
number identifies the device within the
\fIresource\fR\&.
.RE
.PP
\fBdrbdsetup\fR new\-resource \fIresource\fR \fInode_id\fR,
.br
\fBdrbdsetup\fR resource\-options \fIresource\fR
.RS 4
The
\fBnew\-resource\fR
command creates a new resource\&. The
\fBresource\-options\fR
command changes the resource options of an existing resource\&. Available options:
.PP
\fB\-\-auto\-promote \fR\fB\fIbool\-value\fR\fR
.RS 4
A resource must be promoted to primary role before any of its devices can be mounted or opened for writing\&.
.sp
Before DRBD 9, this could only be done explicitly ("drbdadm primary")\&. Since DRBD 9, the
\fBauto\-promote\fR
parameter allows to automatically promote a resource to primary role when one of its devices is mounted or opened for writing\&. As soon as all devices are unmounted or closed with no more remaining users, the role of the resource changes back to secondary\&.
.sp
Automatic promotion only succeeds if the cluster state allows it (that is, if an explicit
\fBdrbdadm primary\fR
command would succeed)\&. Otherwise, mounting or opening the device fails as it already did before DRBD 9: the
\fBmount\fR(2)
system call fails with errno set to EROFS (Read\-only file system); the
\fBopen\fR(2)
system call fails with errno set to EMEDIUMTYPE (wrong medium type)\&.
.sp
Irrespective of the
\fBauto\-promote\fR
parameter, if a device is promoted explicitly (\fBdrbdadm primary\fR), it also needs to be demoted explicitly (\fBdrbdadm secondary\fR)\&.
.sp
The
\fBauto\-promote\fR
parameter is available since DRBD 9\&.0\&.0, and defaults to
\fByes\fR\&.
.RE
.PP
\fB\-\-cpu\-mask \fR\fB\fIcpu\-mask\fR\fR
.RS 4
Set the cpu affinity mask for DRBD kernel threads\&. The cpu mask is specified as a hexadecimal number\&. The default value is 0, which lets the scheduler decide which kernel threads run on which CPUs\&. CPU numbers in
\fBcpu\-mask\fR
which do not exist in the system are ignored\&.
.RE
.PP
\fB\-\-on\-no\-data\-accessible \fR\fB\fIpolicy\fR\fR
.RS 4
Determine how to deal with I/O requests when the requested data is not available locally or remotely (for example, when all disks have failed)\&. The defined policies are:
.PP
\fBio\-error\fR
.RS 4
System calls fail with errno set to EIO\&.
.RE
.PP
\fBsuspend\-io\fR
.RS 4
The resource suspends I/O\&. I/O can be resumed by (re)attaching the lower\-level device, by connecting to a peer which has access to the data, or by forcing DRBD to resume I/O with
\fBdrbdadm resume\-io \fR\fB\fIres\fR\fR\&. When no data is available, forcing I/O to resume will result in the same behavior as the
\fBio\-error\fR
policy\&.
.RE
.sp
This setting is available since DRBD 8\&.3\&.9; the default policy is
\fBio\-error\fR\&.
.RE
.PP
\fB\-\-peer\-ack\-window \fR\fB\fIvalue\fR\fR
.RS 4
On each node and for each device, DRBD maintains a bitmap of the differences between the local and remote data for each peer device\&. For example, in a three\-node setup (nodes A, B, C) each with a single device, every node maintains one bitmap for each of its peers\&.
.sp
When nodes receive write requests, they know how to update the bitmaps for the writing node, but not how to update the bitmaps between themselves\&. In this example, when a write request propagates from node A to B and C, nodes B and C know that they have the same data as node A, but not whether or not they both have the same data\&.
.sp
As a remedy, the writing node occasionally sends peer\-ack packets to its peers which tell them which state they are in relative to each other\&.
.sp
The
\fBpeer\-ack\-window\fR
parameter specifies how much data a primary node may send before sending a peer\-ack packet\&. A low value causes increased network traffic; a high value causes less network traffic but higher memory consumption on secondary nodes and higher resync times between the secondary nodes after primary node failures\&. (Note: peer\-ack packets may be sent due to other reasons as well, e\&.g\&. membership changes or expiry of the
\fBpeer\-ack\-delay\fR
timer\&.)
.sp
The default value for
\fBpeer\-ack\-window\fR
is 2 MiB, the default unit is sectors\&. This option is available since 9\&.0\&.0\&.
.RE
.PP
\fB\-\-peer\-ack\-delay \fR\fB\fIexpiry\-time\fR\fR
.RS 4
If after the last finished write request no new write request gets issued for
\fIexpiry\-time\fR, then a peer\-ack packet is sent\&. If a new write request is issued before the timer expires, the timer gets reset to
\fIexpiry\-time\fR\&. (Note: peer\-ack packets may be sent due to other reasons as well, e\&.g\&. membership changes or the
\fBpeer\-ack\-window\fR
option\&.)
.sp
This parameter may influence resync behavior on remote nodes\&. Peer nodes need to wait until they receive an peer\-ack for releasing a lock on an AL\-extent\&. Resync operations between peers may need to wait for for these locks\&.
.sp
The default value for
\fBpeer\-ack\-delay\fR
is 100 milliseconds, the default unit is milliseconds\&. This option is available since 9\&.0\&.0\&.
.RE
.sp
.RE
.PP
\fBdrbdsetup\fR outdate \fIminor\fR
.RS 4
.\" drbdsetup: outdate
Mark the data on a lower\-level device as outdated\&. This is used for fencing, and prevents the resource the device is part of from becoming primary in the future\&. See the
\fB\-\-fencing\fR
disk option\&.
.RE
.PP
\fBdrbdsetup\fR pause\-sync \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR
.RS 4
.\" drbdsetup: pause-sync
Stop resynchronizing between a local and a peer device by setting the local pause flag\&. The resync can only resume if the pause flags on both sides of a connection are cleared\&.
.RE
.PP
\fBdrbdsetup\fR primary \fIresource\fR
.RS 4
.\" drbdsetup: primary
Change the role of a node in a resource to primary\&. This allows the replicated devices in this resource to be mounted or opened for writing\&. Available options:
.PP
\fB\-\-overwrite\-data\-of\-peer\fR
.RS 4
This option is an alias for the
\fB\-\-force\fR
option\&.
.RE
.PP
\fB\-\-force\fR
.RS 4
Force the resource to become primary even if some devices are not guaranteed to have up\-to\-date data\&. This option is used to turn one of the nodes in a newly created cluster into the primary node, or when manually recovering from a disaster\&.
.sp
Note that this can lead to split\-brain scenarios\&. Also, when forcefully turning an inconsistent device into an up\-to\-date device, it is highly recommended to use any integrity checks available (such as a filesystem check) to make sure that the device can at least be used without crashing the system\&.
.RE
.sp
Note that DRBD usually only allows one node in a cluster to be in primary role at any time; this allows DRBD to coordinate access to the devices in a resource across nodes\&. The
\fB\-\-allow\-two\-primaries\fR
network option changes this; in that case, a mechanism outside of DRBD needs to coordinate device access\&.
.RE
.PP
\fBdrbdsetup\fR resize \fIminor\fR
.RS 4
.\" drbdsetup: resize
Reexamine the size of the lower\-level devices of a replicated device on all nodes\&. This command is called after the lower\-level devices on all nodes have been grown to adjust the size of the replicated device\&. Available options:
.PP
\fB\-\-assume\-peer\-has\-space\fR
.RS 4
Resize the device even if some of the peer devices are not connected at the moment\&. DRBD will try to resize the peer devices when they next connect\&. It will refuse to connect to a peer device which is too small\&.
.RE
.PP
\fB\-\-assume\-clean\fR
.RS 4
Do not resynchronize the added disk space; instead, assume that it is identical on all nodes\&. This option can be used when the disk space is uninitialized and differences do not matter, or when it is known to be identical on all nodes\&. See the
\fBdrbdsetup verify\fR
command\&.
.RE
.PP
\fB\-\-size \fR\fB\fIval\fR\fR
.RS 4
This option can be used to online shrink the usable size of a drbd device\&. It\'s the users responsibility to make sure that a file system on the device is not truncated by that operation\&.
.RE
.PP
\fB\-\-al\-stripes \fR\fB\fIval\fR\fR \fB\-\-al\-stripes \fR\fB\fIval\fR\fR
.RS 4
These options may be used to change the layout of the activity log online\&. In case of internal meta data this may invovle shrinking the user visible size at the same time (unsing the
\fB\-\-size\fR) or increasing the avalable space on the backing devices\&.
.RE
.sp
.RE
.PP
\fBdrbdsetup\fR resume\-io \fIminor\fR
.RS 4
.\" drbdsetup: resume-io
Resume I/O on a replicated device\&. See the
\fB\-\-fencing\fR
net option\&.
.RE
.PP
\fBdrbdsetup\fR resume\-sync \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR
.RS 4
.\" drbdsetup: resume-sync
Allow resynchronization to resume by clearing the local sync pause flag\&.
.RE
.PP
\fBdrbdsetup\fR role \fIresource\fR
.RS 4
.\" drbdsetup: role
Show the current role of a resource\&.
.RE
.PP
\fBdrbdsetup\fR secondary \fIresource\fR
.RS 4
.\" drbdsetup: secondary
Change the role of a node in a resource to secondary\&. This command fails if the replicated device is in use\&.
.RE
.PP
\fBdrbdsetup\fR show {\fIresource\fR | \fIall\fR}
.RS 4
.\" drbdsetup: show
Show the current configuration of a resource, or of all resources\&. Available options:
.PP
\fB\-\-show\-defaults\fR
.RS 4
Show all configuration parameters, even the ones with default values\&. Normally, parameters with default values are not shown\&.
.RE
.sp
.RE
.PP
\fBdrbdsetup\fR show\-gi \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR
.RS 4
.\" drbdsetup: show-gi
Show the data generation identifiers for a device on a particular connection\&. In addition, explain the output\&. The output otherwise is the same as in the
\fBdrbdsetup get\-gi\fR
command\&.
.RE
.PP
\fBdrbdsetup\fR state
.RS 4
.\" drbdsetup: state
This is an alias for
\fBdrbdsetup role\fR\&. Deprecated\&.
.RE
.PP
\fBdrbdsetup\fR status {\fIresource\fR | \fIall\fR}
.RS 4
.\" drbdsetup: status
Show the status of a resource, or of all resources\&. The output consists of one paragraph for each configured resource\&. Each paragraph contains one line for each resource, followed by one line for each device, and one line for each connection\&. The device and connection lines are indented\&. The connection lines are followed by one line for each peer device; these lines are indented against the connection line\&.
.sp
Long lines are wrapped around at terminal width, and indented to indicate how the lines belongs together\&. Available options:
.PP
\fB\-\-verbose\fR
.RS 4
Include more information in the output even when it is likely redundant or irrelevant\&.
.RE
.PP
\fB\-\-statistics\fR
.RS 4
Include data transfer statistics in the output\&.
.RE
.PP
\fB\-\-color=\fR\fB{always | auto | never}\fR\fB \fR
.RS 4
Colorize the output\&. With
\fB\-\-color=auto\fR,
\fBdrbdsetup\fR
emits color codes only when standard output is connected to a terminal\&.
.RE
.sp
For example, the non\-verbose output for a resource with only one connection and only one volume could look like this:
.sp
.if n \{\
.RS 4
.\}
.nf
drbd0 role:Primary
disk:UpToDate
host2\&.example\&.com role:Secondary
disk:UpToDate
.fi
.if n \{\
.RE
.\}
.sp
With the
\fB\-\-verbose\fR
option, the same resource could be reported as:
.sp
.if n \{\
.RS 4
.\}
.nf
drbd0 node\-id:1 role:Primary suspended:no
volume:0 minor:1 disk:UpToDate blocked:no
host2\&.example\&.com local:ipv4:192\&.168\&.123\&.4:7788
peer:ipv4:192\&.168\&.123\&.2:7788 node\-id:0 connection:WFReportParams
role:Secondary congested:no
volume:0 replication:Connected disk:UpToDate resync\-suspended:no
.fi
.if n \{\
.RE
.\}
.sp
.RE
.PP
\fBdrbdsetup\fR suspend\-io \fIminor\fR
.RS 4
.\" drbdsetup: suspend-io
Suspend I/O on a replicated device\&. It is not usually necessary to use this command\&.
.RE
.PP
\fBdrbdsetup\fR verify \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR
.RS 4
.\" drbdsetup: verify
Start online verification, change which part of the device will be verified, or stop online verification\&. The command requires the specified peer to be connected\&.
.sp
Online verification compares each disk block on the local and peer node\&. Blocks which differ between the nodes are marked as out\-of\-sync, but they are
\fInot\fR
automatically brought back into sync\&. To bring them into sync, the resource must be disconnected and reconnected\&. Progress can be monitored in the output of
\fBdrbdsetup status \-\-statistics\fR\&. Available options:
.PP
\fB\-\-start \fR\fB\fIposition\fR\fR
.RS 4
Define where online verification should start\&. This parameter is ignored if online verification is already in progress\&. If the start parameter is not specified, online verification will continue where it was interrupted (if the connection to the peer was lost while verifying), after the previous stop sector (if the previous online verification has finished), or at the beginning of the device (if the end of the device was reached, or online verify has not run before)\&.
.sp
The position on disk is specified in disk sectors (512 bytes) by default\&.
.RE
.PP
\fB\-\-stop \fR\fB\fIposition\fR\fR
.RS 4
Define where online verification should stop\&. If online verification is already in progress, the stop position of the active online verification process is changed\&. Use this to stop online verification\&.
.sp
The position on disk is specified in disk sectors (512 bytes) by default\&.
.RE
.sp
Also see the notes on data integrity in the
\fBdrbd.conf\fR(5)
manual page\&.
.RE
.PP
\fBdrbdsetup\fR wait\-connect\-volume \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR,
.br
\fBdrbdsetup\fR wait\-connect\-connection \fIresource\fR \fIpeer_node_id\fR,
.br
\fBdrbdsetup\fR wait\-connect\-resource \fIresource\fR,
.br
\fBdrbdsetup\fR wait\-sync\-volume \fIresource\fR \fIpeer_node_id\fR \fIvolume\fR,
.br
\fBdrbdsetup\fR wait\-sync\-connection \fIresource\fR \fIpeer_node_id\fR,
.br
\fBdrbdsetup\fR wait\-sync\-resource \fIresource\fR
.RS 4
.\" drbdsetup: wait-connect-volume: wait-connect-connection: wait-connect-resource
.\" drbdsetup: wait-sync-volume: wait-sync-connection: wait-sync-resource
The
\fBwait\-connect\-*\fR
commands waits until a device on a peer is visible\&. The
\fBwait\-sync\-*\fR
commands waits until a device on a peer is up to date\&. Available options for both commands:
.PP
\fB\-\-degr\-wfc\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
Define how long to wait until all peers are connected in case the cluster consisted of a single node only when the system went down\&. This parameter is usually set to a value smaller than
\fBwfc\-timeout\fR\&. The assumption here is that peers which were unreachable before a reboot are less likely to be be reachable after the reboot, so waiting is less likely to help\&.
.sp
The timeout is specified in seconds\&. The default value is 0, which stands for an infinite timeout\&. Also see the
\fBwfc\-timeout\fR
parameter\&.
.RE
.PP
\fB\-\-outdated\-wfc\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
Define how long to wait until all peers are connected if all peers were outdated when the system went down\&. This parameter is usually set to a value smaller than
\fBwfc\-timeout\fR\&. The assumption here is that an outdated peer cannot have become primary in the meantime, so we don\'t need to wait for it as long as for a node which was alive before\&.
.sp
The timeout is specified in seconds\&. The default value is 0, which stands for an infinite timeout\&. Also see the
\fBwfc\-timeout\fR
parameter\&.
.RE
.PP
\fB\-\-wait\-after\-sb\fR
.RS 4
This parameter causes DRBD to continue waiting in the init script even when a split\-brain situation has been detected, and the nodes therefore refuse to connect to each other\&.
.RE
.PP
\fB\-\-wfc\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
Define how long the init script waits until all peers are connected\&. This can be useful in combination with a cluster manager which cannot manage DRBD resources: when the cluster manager starts, the DRBD resources will already be up and running\&. With a more capable cluster manager such as Pacemaker, it makes more sense to let the cluster manager control DRBD resources\&. The timeout is specified in seconds\&. The default value is 0, which stands for an infinite timeout\&. Also see the
\fBdegr\-wfc\-timeout\fR
parameter\&.
.RE
.sp
.RE
.PP
\fBdrbdsetup\fR forget\-peer \fIresource\fR \fIpeer_node_id\fR
.RS 4
.\" drbdsetup: forget-peer
The
\fBforget\-peer\fR
command removes all traces of a peer node from the meta\-data\&. It frees a bitmap slot in the meta\-data and make it avalable for futher bitmap slot allocation in case a so\-far never seen node connects\&.
.sp
The connection must be taken down before this command may be used\&. In case the peer re\-connects at a later point a bit\-map based resync will be turned into a full\-sync\&.
.RE
.SH "EXAMPLES"
.PP
Please see the
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2
for examples\&.
.SH "VERSION"
.sp
This document was revised for version 9\&.0\&.0 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
Copyright 2001\-2012 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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fBDRBD Web Site\fR\m[]\&\s-2\u[2]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD User's Guide
.RS 4
\%http://www.drbd.org/users-guide/
.RE
.IP " 2." 4
DRBD Web Site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v9/drbdadm.xml 0000644 0001750 0001750 00000071514 12615625470 021051 0 ustar apoikos apoikos
6 December 2012DRBD9.0.0drbdadm8System AdministrationdrbdadmUtility for DRBD administrationdrbdadmdrbdadmoptions--backend-optionscommandcontextDescriptionThe utility is used for managing DRBD based
on its configuration files, see drbd.conf5. It translates high-level commands into one or more
lower-level commands for the and
utilities, which control the kernel module
and manipulate the on-disk metadata.Depending on the command, the utility
operates on one or more resources, devices, connections, or peer devices.
The following command contexts are defined:resourceA resource specified by name, or the keyword
for all defined resources.deviceA device, specified by minor number
(minornumber, e.g. 0) or by resource and
volume number
(resource/volume).
If only a resource is
specified, the command iterates over all devices of that resource.connectionA connection, specified by resource and connection name
(resource:connection-name).
If only a resource is specified, the
command iterates over all connections of that resource.
peer_deviceA peer device, specified by resource, connection name, and
volume number
(resource:connection-name/volume).
If only a resource,
device, or
connection is specified, the command
iterates over all peer devices of that resource, device, or
connection.All options following a double-dash are passed through to the
lower-level utilities as specified. In addition,
understands most of the options of
, and will pass them through even without the
double-dash.
Options, Show which commands would execute
instead of actually executing them (for example, drbdadm -d up resource).
This can be a useful way to learn how drbdsetup and drbdmeta are used.,
fileUse an alternative configuration file. By default,
will use the the first of the following
files that exists: ,
,
,
,
,
.,
fileCheck an additional configuration file. This option is only
allowed with the dump and the sh-nop commands.,
fileSpecifies the full path to the program. If this option
is omitted, drbdadm will look for it beneath itself first, and then in the PATH.,
fileSpecifies the full path to the program. If this option
is omitted, drbdadm will look for it beneath itself first, and then in the PATH., Perform the command on a stacked resource.Commandsadjust
resourcedrbdadmadjust Adjust the configuration of the kernel module so that
it matches the configuration files. The result should be the same
as when stopping and restarting all resources (drbdadm down all followed by drbdadm up all), but without the
interruptions.Note that the adjust command can misinterpret the configuration
change in some cases. To be safe, check what the command would do
(with the option) before running the
actual command.adjust-with-progress
resourcedrbdadmadjust-with-progress The same as , but with some
more information about the command's progress.
apply-al
devicedrbdadmapply-al Apply the activity log of the specified device. See
drbdmeta8 for details.
attach
deviceAttach a lower-level device to an existing replicated device.
See drbdsetup8 for details.check-resize
devicedrbdadmcheck-resize Call drbdmeta to eventually move internal meta data. If the backing
device was resized, while DRBD was not running, meta data has to be moved to the end of
the device, so that the next command can succeed.connect
connectiondrbdadmconnect Activate an exisiting
connection to a peer. The connection needs to be created first
with the command, and have at least
one path created with the command.
See drbdsetup8 for details.
create-md
devicedrbdadmcreate-md Initialize the metadata of a device. This is necessary
before a device can be attached; see drbdmeta8 for details.cstate
connectiondrbdadmcstate Show the current state of a connection. See
drbdsetup8 for details.detach
devicedrbdadmdetach Detach the lower-level
device of a replicated device. See drbdsetup8 for details.disconnect
connectiondrbdadmdisconnect Remove a
connection to a peer host. See drbdsetup8 for details.disk-options
devicedrbdadmdisk-options Cange the disk options of an attached lower-level
device. See drbdsetup8 for details.
down
resourcedrbdadmdown Take a resource down by
removing all volumes, connections, and the resource itself.
See drbdsetup8 for details.
dstate
devicedrbdadmdstate Show the current disk
state of a lower-level device. See drbdsetup8 for details.
dump
resourcedrbdadmdump Parse the configuration file and dump it to stdout.
This will fail if the configuration file is syntactically
incorrect.dump-md
devicedrbdadmdump-md Dump the metadata of a device in text form, including
the bitmap and activity log. See drbdmeta8 for details.get-gi
peer_devicedrbdadmget-gi Show the data generation identifiers for a device on a
particular connection. Uses for
attached devices and for unattached
devices. See drbdsetup8 for details.
hidden-commands
Shows all commands which are not explicitly documented.invalidate
peer_devicedrbdadminvalidate Replace the local
data of a device with that of a peer. See drbdsetup8 for details.
invalidate-remote
peer_devicedrbdadminvalidate-remote Replace a
peer device's data of a resource with the local data. See
drbdsetup8 for details.
net-options
connectiondrbdadmnet-options Change the network options of an existing connection.
See drbdsetup8 for details.
new-current-uuid
devicedrbdadmnew-current-uuid Generate a
new currend UUID. See drbdsetup8 for details.
outdate
devicedrbdadmoutdate Mark the data on a
lower-level device as outdated. See drbdsetup8 for details.
pause-sync
peer_devicedrbdadmpause-sync Stop resynchronizing between a local and a peer device
by setting the local pause flag. See drbdsetup8 for details.
primary
resourcedrbdadmprimary Change the role of a
node in a resource to primary. See drbdsetup8 for details.
resize
devicedrbdadmresize Resize the lower-level
devices of a replicated device on all nodes. This combines the
and
lower-level commands; see drbdsetup8 for details.
resource-options
resourcedrbdadmresource-options Change the resource options of an existing
resource. See drbdsetup8 for details.
resume-sync
peer_devicedrbdadmresume-sync Allow
resynchronization to resume by clearing the local sync pause flag.
See drbdsetup8 for details.
role
resourcedrbdadmrole Show the current role of a resource.
secondary
resourcedrbdadmsecondary Change the role of a node in a resource to secondary.
This command fails if the replicated device is in use.
show-gi
peer_devicedrbdadmshow-gi Show the data generation identifiers for a device on a
particular connection. In addition, explain the output. See
drbdsetup8 for details.
state
resourcedrbdadmstate This is an alias for drbdsetup role. Deprecated.
up
resourcedrbdadmup Bring up a resource by applying the activity log of
all volumes, creating the resource, creating the replicated
devices, attaching the lower-level devices, and connecting to all
peers. See the drbdmeta command and the
, ,
, , and
drbdsetup commands.verify
peer_devicedrbdadmverify Start online verification, change which part of the
device will be verified, or stop online verification. See
drbdsetup8 for details.
wait-connect
deviceconnectionresourcedrbdadmwait-connect Wait until a
device on a peer, all devices over a connection, or all devices on
all peers are visible. See drbdsetup8 for details.
wait-sync
deviceconnectionresourcedrbdadmwait-sync Wait until a
device is connected and has finished eventual resync operation. Also
available on connection and resource level. See drbdsetup8 for details.
wipe-md
devicedrbdadmwipe-md Wipe out the DRBD
metadata of a device. See drbdmeta8 for details.
forget-peer
connectiondrbdadmforget-peer Completely remove any
reference to a unconnected peer from meta-data.
See drbdmeta8 for details.
VersionThis document was revised for version 9.0.0 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com and Lars
Ellenberg lars.ellenberg@linbit.comReporting BugsReport bugs to drbd-user@lists.linbit.com.CopyrightCopyright 2001-2012 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.See Alsodrbd.conf5, drbd8, drbddisk8, drbdsetup8, drbdmeta8 and the
DRBD project web site
drbd-utils-8.9.6/documentation/v9/drbd.conf.xml.in 0000644 0001750 0001750 00000124334 12647177715 021730 0 ustar apoikos apoikos
]>
&drbdsetup_options;
3 December 2012DRBD9.0.0drbd.conf5Configuration Filesdrbd.confDRBD Configuration Filesdrbd.confIntroductionDRBD implements block devices which replicate their data to all nodes
of a cluster. The actual data and associated metadata are usually stored
redundantly on "ordinary" block devices on each cluster node.Replicated block devices are called
by default. They
are grouped into resources, with one or more devices per resource.
Replication among the devices in a resource takes place in chronological order. With DRBD,
we refer to the devices inside a resource as volumes.In DRBD 9, a resource can be replicated between two or more cluster
nodes. The connections between cluster nodes are point-to-point links, and
use TCP or a TCP-like protocol. All nodes must be directly
connected.DRBD consists of low-level user-space components
which interact with the kernel and perform basic operations
(, ), a high-level
user-space component which understands and processes the DRBD configuration
and translates it into basic operations of the low-level components
(), and a kernel component.The default DRBD configuration consists of
and of additional files included from
there, usually and all
files inside
. It has turned out to be useful to define
each resource in a separate
file.The configuration files are designed so that each cluster node can
contain an identical copy of the entire cluster configuration. The host
name of each node determines which parts of the configuration apply
().
It is highly recommended to keep the cluster configuration on all
nodes in sync by manually copying it to all nodes, or by automating the
process with or a similar tool.Example Configuration Fileresource r0 {
net {
cram-hmac-alg sha1;
shared-secret "FooFunFactory";
}
volume 0 {
device /dev/drbd1;
disk /dev/sda7;
meta-disk internal;
}
on alice {
node-id 0;
address 10.1.1.31:7000;
}
on bob {
node-id 1;
address 10.1.1.32:7000;
}
connection {
host alice port 7000;
host bob port 7000;
net {
protocol C;
}
}
}
This example defines a resource which contains a single replicated
device with volume number 0. The resource is replicated among hosts
and , which have the IPv4 addresses and and the
node identifiers 0 and 1, respectively. On both hosts, the replicated
device is called , and the actual data and metadata are stored on
the lower-level device . The connection between the hosts uses
protocol C.Please refer to the DRBD User's Guide
for more examples.File FormatDRBD configuration files consist of sections, which contain other
sections and parameters depending on the section types. Each section
consists of one or more keywords, sometimes a section name, an opening
brace ({), the section's contents, and a closing brace
(}). Parameters inside a section consist of a keyword,
followed by one or more keywords or values, and a semicolon
(;).Some parameter values have a default scale which applies when a plain
number is specified (for example Kilo, or 1024 times the numeric value).
Such default scales can be overridden by using a suffix (for example,
for Mega). The common suffixes =
2^10 = 1024, = 1024 K, and = 1024 M
are supported.Comments start with a hash sign (#) and extend to the
end of the line. In addition, any section can be prefixed with the keyword
, which causes the section and any sub-sections to be
ignored.Additional files can be included with the statement (see
glob7
for the expressions supported in file-pattern).
Include statements are only allowed outside of sections.The following sections are defined (indentation indicates in
which context):
common
[disk]
[handlers]
[net]
[options]
[startup]
global
resource
connection
path
net
connection-mesh
net
[disk]
floating
handlers
[net]
on
volume
disk
[disk]
options
stacked-on-top-of
startup
Sections in brackets affect other parts of the configuration: inside the
section, they apply to all resources. A
section inside a or
section applies to all volumes of that resource, and a
section inside a section
applies to all connections of that resource. This allows to avoid repeating
identical options for each resource, connection, or volume. Options can
be overridden in a more specific ,
, , or
section.Sectionsdrbd.confcommon This section can contain each a
, ,
, , and
section. All resources inherit the
parameters in these sections as their default values.drbd.confconnection Define a connection between two hosts. This section
must contain two parameters or multiple
.
The optional name is
used to refer to the connection in the system log and in other
messages. If no name is specified, the peer's host name
is used instead.drbd.confpath Define a path between two hosts. This section
must contain two parameters.drbd.confconnection-mesh Define a connection mesh between multiple hosts. This section
must contain a parameter, which has the
host names as arguments. This section is a shortcut to define many
connections which share the same network options.drbd.confdisk Define parameters for a volume. All parameters in
this section are optional.
drbd.conffloating Like the section, except that
instead of the host name a network address is used to
determine if it matches a
section.The parameter in this section is
required. If the parameter is not
provided, no connections to peers will be created by default.
The , , and
parameters must be defined in, or
inherited by, this section.drbd.confglobal Define some global parameters. All parameters in
this section are optional. Only one
section is allowed in the configuration.drbd.confhandlers Define handlers to be invoked when certain events
occur. The kernel passes the resource name in the first
command-line argument and sets the following environment
variables depending on the event's context:
For events related to a particular device:
the device's minor number in
, the device's volume number
in .
For events related to a particular device on a
particular peer: the connection endpoints in
,
,
, and
; the device's local minor
number in , and the device's volume
number in .
For events related to a particular connection: the
connection endpoints in ,
,
, and
; and, for each device defined for
that connection: the device's minor number in
.
For events that identify a device, if a lower-level
device is attached, the lower-level device's device name is
passed in (or
).
All parameters in this section are optional. Only a single
handler can be defined for each event; if no handler is defined,
nothing will happen.drbd.confnet Define parameters for a connection. All parameters
in this section are optional.
...drbd.confon Define the properties of a resource on a particular
host or set of hosts. Specifying more than one host name can
make sense in a setup with IP address failover, for
example. The host-name argument must
match the Linux host name ().Usually contains or inherits at least one
section. The and
parameters must be defined in this
section. The , , and
parameters must be defined in, or
inherited by, this section.A normal configuration file contains two or more
sections for each resource. Also see the
section.drbd.confoptions Define parameters for a resource. All parameters
in this section are optional.drbd.confresource Define a resource. Usually contains at least two
sections and at least one
section. drbd.confstacked-on-top-of Used instead of an section for
configuring a stacked resource with three to four nodes.Starting with DRBD 9, stacking is deprecated. It is advised
to use resources which are replicated among more than two nodes
instead.drbd.confstartup The parameters in this section determine the
behavior of a resource at startup time.drbd.confvolume Define a volume within a resource. The volume
numbers in the various sections of a
resource define which devices on which hosts form a replicated
device.Section Parametersdrbd.confhost
Defines an endpoint for a connection. Each
statement refers to an section in a resource.
If a port number is defined, this endpoint will use the specified
port instead of the port defined in the
section. Each section must contain
exactly two parameters. Instead of two
parameters the connection may contain
multiple sections.Section Parametersdrbd.confhost
Defines an endpoint for a connection. Each
statement refers to an section in a resource.
If a port number is defined, this endpoint will use the specified
port instead of the port defined in the
section. Each section must contain
exactly two parameters.Section Parametersdrbd.confhost
Defines all nodes of a mesh. Each
refers to an
section in a resource. The port
that is defined in the section will
be used.Section ParametersSection ParametersSection Parametersdrbd.confafter-resync-target Called on a resync target when a node state
changes from to when a resync finishes.
This handler can be used for removing the snapshot created in the
handler.drbd.confbefore-resync-target Called on a resync target before a resync begins.
This handler can be used for creating a snapshot of the
lower-level device for the duration of the resync: if the resync
source becomes unavailable during a resync, reverting to the
snapshot can restore a consistent state.drbd.conffence-peer Called when a node should fence a resource on a
particular peer. The handler should not use the same
communication path that DRBD uses for talking to the peer.drbd.confunfence-peer Called when a node should remove fencing constraints
from other nodes.drbd.confinitial-split-brain Called when DRBD connects to a peer and detects that
the peer is in a split-brain state with the local node. This
handler is also called for split-brain scenarios which will be
resolved automatically.drbd.conflocal-io-error Called when an I/O error occurs on a lower-level device.
drbd.confpri-lost
The local node is currently primary, but DRBD believes that it
should become a sync target. The node should give up its primary
role.drbd.confpri-lost-after-sb The local node is currently primary, but it has lost
the after-split-brain auto recovery procedure. The node should be
abandoned. drbd.confpri-on-incon-degr The local node is primary, and neither the local
lower-level device nor a lower-level device on a peer is up to
date. (The primary has no device to read from or to write
to.)drbd.confsplit-brain DRBD has detected a split-brain situation which
could not be resolved automatically. Manual recovery is
necessary. This handler can be used to call for administrator
attention.Section ParametersSection Parametersdrbd.confaddress Defines the address family, address, and port of a
connection endpoint.The address families ,
, (Dolphin
Interconnect Solutions' "super sockets"),
(Infiniband Sockets Direct Protocol), and
are supported ( is an alias for
). If no address family is specified,
is assumed. For all address families
except , the address is specified in IPV4
address notation (for example, 1.2.3.4). For
, the address is enclosed in brackets and
uses IPv6 address notation (for example, [fd01:2345:6789:abcd::1]). The port
is always specified as a decimal number from 1 to 65535.On each host, the port numbers must be unique for each
address; ports cannot be shared.drbd.confnode-id
Defines the unique node identifier for a node in the cluster.
Node identifiers are used to identify individual nodes in the
network protocol, and to assign bitmap slots to nodes in the
metadata.Node identifiers can only be reasssigned in a cluster when
the cluster is down. It is essential that the node identifiers
in the configuration and in the device metadata are changed
consistently on all hosts. To change the metadata, dump the
current state with drbdmeta dump-md, adjust the bitmap slot
assignment, and update the metadata with
drbdmeta restore-md.The parameter exists since DRBD 9.
Its value ranges from 0 to 16; there is no default.Section Parameters (Resource Options)Section ParametersThe parameters in this section define the behavior of DRBD at
system startup time, in the DRBD init script. They have no effect once
the system is up and running.On stacked devices, the and
parameters in the configuration
are usually ignored, and both timeouts are set to twice the
timeout. The
parameter tells DRBD to use the
and
parameters as defined in the
configuration, even on stacked devices. Only use this parameter
if the peer of the stacked resource is usually not available, or
will not become primary. Incorrect use of this parameter can
lead to unexpected split-brain scenarios.Section Parametersdrbd.confdevice Define the device name and minor number of a
replicated block device. This is the device that applications
are supposed to access; in most cases, the device is not used
directly, but as a file system. This parameter is required and
the standard device naming convention is assumed.In addition to this device, udev will create
and
symlinks to the device.diskdrbd.confdisk Define the lower-level block device that DRBD will
use for storing the actual data. While the replicated drbd
device is configured, the lower-level device must not be used directly.
Even read-only access with tools like dumpe2fs8 and similar is not
allowed. The keyword specifies that no
lower-level block device is configured; this also overrides
inheritance of the lower-level device.drbd.confmeta-disk Define where the metadata of a replicated block
device resides: it can be , meaning that the lower-level
device contains both the data and the metadata, or on a separate
device.When the index form of this
parameter is used, multiple replicated devices can share the same
metadata device, each using a separate index. Each index
occupies 128 MiB of data, which corresponds to a replicated
device size of at most 4 TiB with two cluster nodes. We
recommend not to share metadata devices anymore, and to instead
use the lvm volume manager for creating metadata devices as
needed.When the index form of this
parameter is not used, the size of the lower-level device
determines the size of the metadata. The size needed is 36 KiB +
(size of lower-level device) / 32K * (number of nodes - 1). If
the metadata device is bigger than that, the extra space is not
used.This parameter is required if a other
than is specified, and ignored if
is set to . A
parameter without a
parameter is not allowed.Notes on data integrityDRBD supports two different mechanisms for data integrity checking:
first, the network parameter allows
to add a checksum to the data sent over the network. Second, the online
verification mechanism (drbdadm verify
and the parameter) allows to check for
differences in the on-disk data.Both mechanisms can produce false positives if the data is modified
during I/O (i.e., while it is being sent over the network or written to
disk). This does not always indicate a problem: for example, some
file systems and applications do modify data under I/O for certain
operations. Swap space can also undergo changes while under I/O.Network data integrity checking tries to identify data modification
during I/O by verifying the checksums on the sender side after sending the
data. If it detects a mismatch, it logs an error. The receiver also
logs an error when it detects a mismatch. Thus, an error logged only on
the receiver side indicates an error on the network, and an error logged
on both sides indicates data modification under I/O.The most recent example of systematic data corruption was identified
as a bug in the TCP offloading engine and driver of a certain type of
GBit NIC in 2007: the data corruption happened on the DMA transfer from
core memory to the card. Because the TCP checksum were calculated on the
card, the TCP/IP protocol checksums did not reveal this problem.VersionThis document was revised for version 9.0.0 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com and Lars
Ellenberg lars.ellenberg@linbit.com.Reporting BugsReport bugs to drbd-user@lists.linbit.com.CopyrightCopyright 2001-2012 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.See Alsodrbd8, drbddisk8, drbdsetup8, drbdadm8,
DRBD User's Guide,
DRBD Web Site
drbd-utils-8.9.6/documentation/v9/drbdmeta.xml 0000644 0001750 0001750 00000032373 12466702073 021235 0 ustar apoikos apoikos
6 December 2012DRBD9.0.0drbdmeta8System AdministrationdrbdmetaManipulate the DRBD on-disk metadatadrbdmetadrbdmeta--force--ignore-sanity-checksdevicev06 minorv07 meta_dev indexv08 meta_dev indexv09 meta_dev indexcommandcmd argsDescriptionThe utility is used for creating,
displaying, and modifying DRBD's on-disk metadata. Users usually
interact with the utility, which provides a more
high-level interface to DRBD than . (See
's option to see how
uses .)This utility can only be used on devices which are not currently in
use by the kernel.The first argument (device) specifies the
drbd device associated with a volume, or - if no device is
associated with that volume. If the drbd device is specified, the
utility makes sure that the drbd device does
not currently have a volume attached to prevent meta-data of an active
volume from being destroyed.The second argument specifies the
metadata version to use (v06, v07, v08, v09). In most metadata versions,
the third argument (meta_dev) specifies the
device which contains the metadata; this argument can be the same as
device. The fourth argument
(index) can be one of the keywords
(for internal metadata),
(in v07 for variable-sized metadata; v07
otherwise defaults to fixed-size internal metadata),
(for variable-sized external metadata), or
a numeric matadata index (for fixed-size external metadata). See the
parameter in drbd.conf5.Options--forcedrbdmeta--force
Assume yes as the answer to all questions drbdmeta would ask.--ignore-sanity-checksdrbdmeta--ignore-sanity-checks
Normally, performs some sanity checks
before writing to the metadata device: for example, if the device
appears to contain a file system, it refuses to destroy the file
system by writing into it. Use this option to ignore these
checks.Commandsval (metadata versions v06, v07, and v08)number-of-bitmap-slotsvalvalval (metadata version v09)drbdmetacreate-md
Initialize the metadata. This is necessary before a DRBD resource
can be attached. If finds an older
version of DRBD metadata on the device, it asks if the format
should be converted.When calls 's
command for a device, it sets the
number-of-bitmap-slots argument to the
number of peers in the resource. To reserve additional bitmap
slots (which allows to add more peers in the future), call
directly instead.When a device is used before being connected to its peers the
first time, DRBD assumes that peers can only handle 4 KiB requests
by default. The option allows
to set more optimistic values; use this if the versions of DRBD
that this device will connect to are known. DRBD supports a
maximum bio size of 32 KiB since version 8.3.8, of 128 KiB since
version 8.3.9, and of 1 MiB since version 8.4.0.
If you want to use more than 6433 activity log extents, or live on
top of a spriped RAID, you may specify the number of stripes
(, default 1), and the stripe size
(, default 32).
To just use a larger linear on-disk ring-buffer, leave
the number of stripes at 1, and increase the size only:
drbdmeta 0 v08 /dev/vg23/lv42 internal create-md --al-stripe-size 1M
To avoid a single "spindle" from becoming a bottleneck,
increase the number of stripes, to achieve an interleaved layout
of the on-disk activity-log transactions.
What you give as "stripe-size" should be what is a.k.a. "chunk size"
or "granularity" or "strip unit": the minimum skip to the next
"spindle".
drbdmeta 0 v08 /dev/vg23/lv42 internal create-md --al-stripes 7 --al-stripe-size 64iddrbdmetaget-gi
Show the data generation identifiers for a device on a particular
connection. DRBD version 9.0.0 and beyond support multiple peers;
use the node-id option to define which
peer's data generation identifiers to show.
iddrbdmetashow-gi
Similar to , but with explanatory information.
drbdmetadump-md
Dump the metadata of a device in text form, including the bitmap
and activity log.
Mark the data on a lower-level device as outdated. See
drbdsetup8 for details.
Show the current disk state of a lower-level device.
drbdmetacheck-resize
Examine the device size of a lower-level device and its last known device size
(saved in
by ). For internal metadata,
if the size of the lower-level device has changed and the metadata
can be found at the previous position, move the metadata to the new
position at the end of the block device.
drbdmetaapply-al
Apply the activity log of the specified device. This is necessary
before the device can be attached by the kernel again.
Expert commandsThe utility can be used to fine tune
metdata. Please note that this can lead to destroyed metadata or even
silent data corruption; use with great care only.
giiddrbdmetaset-gi
Set the generation identifiers. The gi
argument is a generation counter for the v06 and v07 formats, and a
set of UUIDs for v08 and beyond. Accepts the same syntax as in the
output. DRBD version 9.0.0 and beyond
support multiple peers; use the --node-id
option to define which peer's data generation identifiers to set.
dump_filedrbdmetarestore-md
Replace the metadata on the device with the contents of
dump_file. The dump file format is
defined by the output of the command.
VersionThis document was revised for version 9.0.0 of the DRBD distribution.AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting BugsReport bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 2001-2008,2012 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.
See Alsodrbdadm8drbd.conf5
drbd-utils-8.9.6/documentation/v9/Makefile.in 0000644 0001750 0001750 00000013705 12634271674 021001 0 ustar apoikos apoikos # Makefile in documentation directory
#
# This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
#
# drbd is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# drbd is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with drbd; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# variables set by configure
DISTRO = @DISTRO@
prefix = @prefix@
exec_prefix = @exec_prefix@
localstatedir = @localstatedir@
datarootdir = @datarootdir@
datadir = @datadir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
mandir = @mandir@
BASH_COMPLETION_SUFFIX = @BASH_COMPLETION_SUFFIX@
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
INITDIR = @INITDIR@
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
CC = @CC@
CFLAGS = @CFLAGS@
XSLTPROC = @XSLTPROC@
# features enabled or disabled by configure
WITH_83_SUPPORT = @WITH_83_SUPPORT@
WITH_84_SUPPORT = @WITH_84_SUPPORT@
WITH_UDEV = @WITH_UDEV@
WITH_XEN = @WITH_XEN@
WITH_PACEMAKER = @WITH_PACEMAKER@
WITH_RGMANAGER = @WITH_RGMANAGER@
WITH_BASHCOMPLETION = @WITH_BASHCOMPLETION@
# variables meant to be overridden from the make command line
DESTDIR ?= /
CREATE_MAN_LINK ?= yes
MANPAGES := drbdsetup.8 drbd.conf.5 drbd.8 drbdadm.8 drbdmeta.8
MANPAGES += drbd-overview.8
STYLESHEET_PREFIX ?= http://docbook.sourceforge.net/release/xsl/current
MANPAGES_STYLESHEET ?= $(STYLESHEET_PREFIX)/manpages/docbook.xsl
HTML_STYLESHEET ?= $(STYLESHEET_PREFIX)/xhtml/docbook.xsl
FO_STYLESHEET ?= $(STYLESHEET_PREFIX)/fo/docbook.xsl
XSLTPROC_OPTIONS ?= --xinclude
XSLTPROC_OPTIONS += --stringparam variablelist.term.break.after 1
#XSLTPROC_OPTIONS += --stringparam variablelist.term.separator ""
XSLTPROC_MANPAGES_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_HTML_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_FO_OPTIONS ?= $(XSLTPROC_OPTIONS)
DRBDSETUP_CMDS = new-resource new-minor del-resource del-minor
DRBDSETUP_CMDS += new-peer new-path del-peer del-path
DRBDSETUP_CMDS += attach connect disk-options net-options resource-options peer-device-options
DRBDSETUP_CMDS += disconnect detach primary secondary verify invalidate invalidate-remote
DRBDSETUP_CMDS += down role cstate dstate
DRBDSETUP_CMDS += resize check-resize pause-sync resume-sync
DRBDSETUP_CMDS += outdate show-gi get-gi show events2
DRBDSETUP_CMDS += status suspend-io resume-io new-current-uuid
DRBDSETUP_CMDS += wait-connect-volume wait-connect-connection wait-connect-resource
DRBDSETUP_CMDS += wait-sync-volume wait-sync-connection wait-sync-resource
DRBDSETUP_CMDS += forget-peer
make_doc := $(shell $(XSLTPROC) \
$(XSLTPROC_MANPAGES_OPTIONS) \
$(MANPAGES_STYLESHEET) < /dev/null > /dev/null 2>&1 && echo doc )
ifeq ($(make_doc),doc)
all: doc
else
all:
@echo "To (re)make the documentation: make doc"
endif
clean:
@echo "To clean the documentation: make doc-clean"
.PHONY: all clean doc man doc-clean distclean
.PHONY: install uninstall html pdf ps
doc: man
ifeq ($(WITH_84_SUPPORT),yes)
MAN_LINK=8.4
else
MAN_LINK=9.0
endif
doc-clean: distclean
####### Implicit rules
.SUFFIXES: .sgml .5 .8 .html .pdf .ps
%.5 %.8: %.xml
$(XSLTPROC) \
$(XSLTPROC_MANPAGES_OPTIONS) \
$(MANPAGES_STYLESHEET) $<
%.html: %.xml
$(XSLTPROC) -o $@ \
$(XSLTPROC_HTML_OPTIONS) \
$(HTML_STYLESHEET) $<
%.fo: %.xml
$(XSLTPROC) -o $@ \
$(XSLTPROC_FO_OPTIONS) \
$(FO_STYLESHEET) $<
../../user/v9/drbdsetup.o: FORCE
$(MAKE) -C $(@D) drbdsetup
.PHONY: FORCE
FORCE:
# Don't try to re-make files tracked in git
FILES_IN_GIT := # $(shell git ls-files)
FILES_IN_GIT += Makefile.in drbd-overview.xml drbd.conf.xml.in drbd.conf.xsl
FILES_IN_GIT += drbd.xml drbdadm.xml drbdmeta.xml drbdsetup-options.xml
FILES_IN_GIT += drbdsetup.xml.in drbdsetup.xsl xml-usage-to-docbook.xsl
$(FILES_IN_GIT): ;
drbdsetup_X.xml := $(patsubst %,drbdsetup_%.xml,$(DRBDSETUP_CMDS))
drbdsetup_xml-help_X.xml := $(patsubst %,drbdsetup_xml-help_%.xml,$(DRBDSETUP_CMDS))
$(drbdsetup_xml-help_X.xml): ../../user/v9/drbdsetup.o
$(drbdsetup_X.xml): xml-usage-to-docbook.xsl
drbdsetup_xml-help_%.xml:
../../user/v9/drbdsetup xml-help $* > $@
drbdsetup_%.xml: drbdsetup_xml-help_%.xml
$(XSLTPROC) -o $@ xml-usage-to-docbook.xsl $<
drbd.conf.xml: drbd.conf.xml.in drbd.conf.xsl drbdsetup-options.xml
$(XSLTPROC) -o $@ drbd.conf.xsl $<
drbdsetup.xml: drbdsetup.xml.in drbdsetup.xsl drbdsetup-options.xml
$(XSLTPROC) -o $@ drbdsetup.xsl $<
distclean:
ifeq ($(make_doc),doc)
rm -f *.[58] manpage.links manpage.refs *~ manpage.log
endif
rm -f *.ps.gz *.pdf *.ps *.html pod2htm*
rm -f drbdsetup_*.xml
rm -f drbd.conf.xml drbdsetup.xml
.PRECIOUS: drbd.conf.xml drbdsetup.xml
#######
man: $(MANPAGES)
install:
@ok=true; for f in $(MANPAGES) ; \
do [ -e $$f ] || { echo $$f missing ; ok=false; } ; \
done ; $$ok
set -e; for f in $(MANPAGES) ; do \
s=$${f##*.}; \
b=$${f%.[0-9]}; \
install -v -D -m 644 $$f $(DESTDIR)$(mandir)/man$$s/$$b-9.0.$$s ; \
if [ "$(CREATE_MAN_LINK)" = "yes" ]; then \
ln -sf $$b-$(MAN_LINK).$$s $(DESTDIR)$(mandir)/man$$s/$$f ; \
fi \
done
uninstall:
@ set -e; for f in $(MANPAGES) ; do \
s=$${f##*.}; \
b=$${f%.[0-9]}; \
rm -vf $(DESTDIR)$(mandir)/man$$s/$$b-9.0.$$s ; \
rm -vf $(DESTDIR)$(mandir)/man$$s/$$f ; \
done
html: $(MANPAGES:.8=.html)
pdf: $(MANPAGES:.8=.pdf)
ps: $(MANPAGES:.8=.ps)
drbdsetup.8: drbdsetup.xml $(drbdsetup_X.xml)
.PHONY: install uninstall clean distclean
../../configure:
@echo "please (re-)run ./autogen.sh with appropriate arguments"; exit 1
../../config.status: ../../configure
@echo "please (re-)run ./configure with appropriate arguments"; exit 1
Makefile: Makefile.in ../../config.status
cd ../.. && ./config.status documentation/v9/Makefile
drbd-utils-8.9.6/documentation/v9/drbd.xml 0000644 0001750 0001750 00000006173 12466702073 020365 0 ustar apoikos apoikos
drbdThe start and stop script for DRBDDRBD9.0.024 June 2014drbd8System Administration/etc/init.d/drbdstartstopstatusreloadrestartforce-reloadIntroductionThe /etc/init.d/drbd script is used
to start and stop drbd on a system V style init system.When using a cluster resource manger such as Pacemaker,
DRBD should usually not be started by the init system,
but should typically be exclusively controlled by the cluster manager.
You should not use, and disable, the init script in this case.
chmod -x /etc/init.d/drbd has proven most effective for this.
In order to use /etc/init.d/drbd, define a drbd
configuration. See
drbd.conf5
for details.
VersionThis document was revised for version 9.0.0 of the DRBD distribution.
AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Reporting BugsReport bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 2001-2014 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.
See Alsodrbd.conf5,
drbdsetup8,
drbdadm8,
DRBD Homepage
drbd-utils-8.9.6/documentation/v9/drbdadm.8 0000644 0001750 0001750 00000027450 12654452461 020421 0 ustar apoikos apoikos '\" t
.\" Title: drbdadm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 6 December 2012
.\" Manual: System Administration
.\" Source: DRBD 9.0.0
.\" Language: English
.\"
.TH "DRBDADM" "8" "6 December 2012" "DRBD 9.0.0" "System Administration"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbdadm \- Utility for DRBD administration.\" drbdadm
.SH "SYNOPSIS"
.HP \w'\fBdrbdadm\fR\ 'u
\fBdrbdadm\fR [options...] [\-\-\ [\fIbackend\-options\fR...]] {\fIcommand\fR} {\fIcontext\fR...}
.SH "DESCRIPTION"
.PP
The
\fBdrbdadm\fR
utility is used for managing DRBD based on its configuration files, see
\fBdrbd.conf\fR(5)\&. It translates high\-level commands into one or more lower\-level commands for the
\fBdrbdsetup\fR
and
\fBdrbdmeta\fR
utilities, which control the kernel module and manipulate the on\-disk metadata\&.
.PP
Depending on the command, the
\fBdrbdadm\fR
utility operates on one or more resources, devices, connections, or peer devices\&. The following command contexts are defined:
.PP
.PP
\fIresource\fR
.RS 4
A resource specified by name, or the keyword
\fBall\fR
for all defined resources\&.
.RE
.PP
\fIdevice\fR
.RS 4
A device, specified by minor number (\fBminor\-\fR\fIminornumber\fR, e\&.g\&.
\fBminor\-\fR\fI0\fR) or by resource and volume number (\fIresource\fR/\fIvolume\fR)\&. If only a
\fIresource\fR
is specified, the command iterates over all devices of that resource\&.
.RE
.PP
\fIconnection\fR
.RS 4
A connection, specified by resource and connection name (\fIresource\fR:\fIconnection\-name\fR)\&. If only a
\fIresource\fR
is specified, the command iterates over all connections of that resource\&.
.RE
.PP
\fIpeer_device\fR
.RS 4
A peer device, specified by resource, connection name, and volume number (\fIresource\fR:\fIconnection\-name\fR/\fIvolume\fR)\&. If only a
\fIresource\fR,
\fIdevice\fR, or
\fIconnection\fR
is specified, the command iterates over all peer devices of that resource, device, or connection\&.
.RE
.PP
All options following a double\-dash are passed through to the lower\-level utilities as specified\&. In addition,
\fBdrbdadm\fR
understands most of the options of
\fBdrbdsetup\fR, and will pass them through even without the double\-dash\&.
.SH "OPTIONS"
.PP
\fB\-d\fR, \fB\-\-dry\-run\fR
.RS 4
Show which commands
\fBdrbdadm\fR
would execute instead of actually executing them (for example,
\fBdrbdadm \-d up \fR\fB\fIresource\fR\fR)\&. This can be a useful way to learn how
\fBdrbdsetup\fR
and
\fBdrbdmeta\fR
are used\&.
.RE
.PP
\fB\-c\fR, \fB\-\-config\-file\fR \fIfile\fR
.RS 4
Use an alternative configuration file\&. By default,
\fBdrbdadm\fR
will use the the first of the following files that exists:
\fB/etc/drbd\-90\&.conf\fR,
\fB/etc/drbd\-84\&.conf\fR,
\fB/etc/drbd\-83\&.conf\fR,
\fB/etc/drbd\-82\&.conf\fR,
\fB/etc/drbd\-08\&.conf\fR,
\fB/etc/drbd\&.conf\fR\&.
.RE
.PP
\fB\-t\fR, \fB\-\-config\-to\-test\fR \fIfile\fR
.RS 4
Check an additional configuration file\&. This option is only allowed with the dump and the sh\-nop commands\&.
.RE
.PP
\fB\-s\fR, \fB\-\-drbdsetup\fR \fIfile\fR
.RS 4
Specifies the full path to the
\fBdrbdsetup\fR
program\&. If this option is omitted, drbdadm will look for it beneath itself first, and then in the PATH\&.
.RE
.PP
\fB\-m\fR, \fB\-\-drbdmeta\fR \fIfile\fR
.RS 4
Specifies the full path to the
\fBdrbdmeta\fR
program\&. If this option is omitted, drbdadm will look for it beneath itself first, and then in the PATH\&.
.RE
.PP
\fB\-S\fR, \fB\-\-stacked\fR
.RS 4
Perform the command on a stacked resource\&.
.RE
.SH "COMMANDS"
.PP
adjust {\fIresource\fR}
.RS 4
.\" drbdadm: adjust
Adjust the configuration of the kernel module so that it matches the configuration files\&. The result should be the same as when stopping and restarting all resources (\fBdrbdadm down all\fR
followed by
\fBdrbdadm up all\fR), but without the interruptions\&.
.sp
Note that the adjust command can misinterpret the configuration change in some cases\&. To be safe, check what the command would do (with the
\fB\-\-dry\-run\fR
option) before running the actual command\&.
.RE
.PP
adjust\-with\-progress {\fIresource\fR}
.RS 4
.\" drbdadm: adjust-with-progress
The same as
\fBadjust\fR, but with some more information about the command\'s progress\&.
.RE
.PP
apply\-al {\fIdevice\fR}
.RS 4
.\" drbdadm: apply-al
Apply the activity log of the specified device\&. See
\fBdrbdmeta\fR(8)
for details\&.
.RE
.PP
attach {\fIdevice\fR}
.RS 4
Attach a lower\-level device to an existing replicated device\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
check\-resize {\fIdevice\fR}
.RS 4
.\" drbdadm: check-resize
Call drbdmeta to eventually move internal meta data\&. If the backing device was resized, while DRBD was not running, meta data has to be moved to the end of the device, so that the next
\fBattach\fR
command can succeed\&.
.RE
.PP
connect {\fIconnection\fR}
.RS 4
.\" drbdadm: connect
Activate an exisiting connection to a peer\&. The connection needs to be created first with the
\fBnew\-peer\fR
command, and have at least one path created with the
\fBnew\-path\fR
command\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
create\-md {\fIdevice\fR}
.RS 4
.\" drbdadm: create-md
Initialize the metadata of a device\&. This is necessary before a device can be attached; see
\fBdrbdmeta\fR(8)
for details\&.
.RE
.PP
cstate {\fIconnection\fR}
.RS 4
.\" drbdadm: cstate
Show the current state of a connection\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
detach {\fIdevice\fR}
.RS 4
.\" drbdadm: detach
Detach the lower\-level device of a replicated device\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
disconnect {\fIconnection\fR}
.RS 4
.\" drbdadm: disconnect
Remove a connection to a peer host\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
disk\-options {\fIdevice\fR}
.RS 4
.\" drbdadm: disk-options
Cange the disk options of an attached lower\-level device\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
down {\fIresource\fR}
.RS 4
.\" drbdadm: down
Take a resource down by removing all volumes, connections, and the resource itself\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
dstate {\fIdevice\fR}
.RS 4
.\" drbdadm: dstate
Show the current disk state of a lower\-level device\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
dump {\fIresource\fR}
.RS 4
.\" drbdadm: dump
Parse the configuration file and dump it to stdout\&. This will fail if the configuration file is syntactically incorrect\&.
.RE
.PP
dump\-md {\fIdevice\fR}
.RS 4
.\" drbdadm: dump-md
Dump the metadata of a device in text form, including the bitmap and activity log\&. See
\fBdrbdmeta\fR(8)
for details\&.
.RE
.PP
get\-gi {\fIpeer_device\fR}
.RS 4
.\" drbdadm: get-gi
Show the data generation identifiers for a device on a particular connection\&. Uses
\fBdrbdsetup\fR
for attached devices and
\fBdrbdmeta\fR
for unattached devices\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
hidden\-commands
.RS 4
Shows all commands which are not explicitly documented\&.
.RE
.PP
invalidate {\fIpeer_device\fR}
.RS 4
.\" drbdadm: invalidate
Replace the local data of a device with that of a peer\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
invalidate\-remote {\fIpeer_device\fR}
.RS 4
.\" drbdadm: invalidate-remote
Replace a peer device\'s data of a resource with the local data\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
net\-options {\fIconnection\fR}
.RS 4
.\" drbdadm: net-options
Change the network options of an existing connection\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
new\-current\-uuid {\fIdevice\fR}
.RS 4
.\" drbdadm: new-current-uuid
Generate a new currend UUID\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
outdate {\fIdevice\fR}
.RS 4
.\" drbdadm: outdate
Mark the data on a lower\-level device as outdated\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
pause\-sync {\fIpeer_device\fR}
.RS 4
.\" drbdadm: pause-sync
Stop resynchronizing between a local and a peer device by setting the local pause flag\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
primary {\fIresource\fR}
.RS 4
.\" drbdadm: primary
Change the role of a node in a resource to primary\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
resize {\fIdevice\fR}
.RS 4
.\" drbdadm: resize
Resize the lower\-level devices of a replicated device on all nodes\&. This combines the
\fBcheck\-resize\fR
and
\fBresize\fR
lower\-level commands; see
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
resource\-options {\fIresource\fR}
.RS 4
.\" drbdadm: resource-options
Change the resource options of an existing resource\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
resume\-sync {\fIpeer_device\fR}
.RS 4
.\" drbdadm: resume-sync
Allow resynchronization to resume by clearing the local sync pause flag\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
role {\fIresource\fR}
.RS 4
.\" drbdadm: role
Show the current role of a resource\&.
.RE
.PP
secondary {\fIresource\fR}
.RS 4
.\" drbdadm: secondary
Change the role of a node in a resource to secondary\&. This command fails if the replicated device is in use\&.
.RE
.PP
show\-gi {\fIpeer_device\fR}
.RS 4
.\" drbdadm: show-gi
Show the data generation identifiers for a device on a particular connection\&. In addition, explain the output\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
state {\fIresource\fR}
.RS 4
.\" drbdadm: state
This is an alias for
\fBdrbdsetup role\fR\&. Deprecated\&.
.RE
.PP
up {\fIresource\fR}
.RS 4
.\" drbdadm: up
Bring up a resource by applying the activity log of all volumes, creating the resource, creating the replicated devices, attaching the lower\-level devices, and connecting to all peers\&. See the
\fBapply\-al\fR
drbdmeta command and the
\fBnew\-resource\fR,
\fBnew\-device\fR,
\fBnew\-minor\fR,
\fBattach\fR, and
\fBconnect\fR
drbdsetup commands\&.
.RE
.PP
verify {\fIpeer_device\fR}
.RS 4
.\" drbdadm: verify
Start online verification, change which part of the device will be verified, or stop online verification\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
wait\-connect {[\fIdevice\fR] | [\fIconnection\fR] | [\fIresource\fR]}
.RS 4
.\" drbdadm: wait-connect
Wait until a device on a peer, all devices over a connection, or all devices on all peers are visible\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
wait\-sync {[\fIdevice\fR] | [\fIconnection\fR] | [\fIresource\fR]}
.RS 4
.\" drbdadm: wait-sync
Wait until a device is connected and has finished eventual resync operation\&. Also available on connection and resource level\&. See
\fBdrbdsetup\fR(8)
for details\&.
.RE
.PP
wipe\-md {\fIdevice\fR}
.RS 4
.\" drbdadm: wipe-md
Wipe out the DRBD metadata of a device\&. See
\fBdrbdmeta\fR(8)
for details\&.
.RE
.PP
forget\-peer {\fIconnection\fR}
.RS 4
.\" drbdadm: forget-peer
Completely remove any reference to a unconnected peer from meta\-data\&. See
\fBdrbdmeta\fR(8)
for details\&.
.RE
.SH "VERSION"
.sp
This document was revised for version 9\&.0\&.0 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
Copyright 2001\-2012 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\&.
.SH "SEE ALSO"
.PP
\fBdrbd.conf\fR(5),
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8),
\fBdrbdmeta\fR(8)
and the
\m[blue]\fBDRBD project web site\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD project web site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v9/drbd.conf.5 0000644 0001750 0001750 00000176142 12654452460 020662 0 ustar apoikos apoikos '\" t
.\" Title: drbd.conf
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 3 December 2012
.\" Manual: Configuration Files
.\" Source: DRBD 9.0.0
.\" Language: English
.\"
.TH "DRBD\&.CONF" "5" "3 December 2012" "DRBD 9.0.0" "Configuration Files"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
drbd.conf \- DRBD Configuration Files.\" drbd.conf
.SH "INTRODUCTION"
.PP
DRBD implements block devices which replicate their data to all nodes of a cluster\&. The actual data and associated metadata are usually stored redundantly on "ordinary" block devices on each cluster node\&.
.PP
Replicated block devices are called
\fB/dev/drbd\fR\fB\fIminor\fR\fR
by default\&. They are grouped into resources, with one or more devices per resource\&. Replication among the devices in a resource takes place in chronological order\&. With DRBD, we refer to the devices inside a resource as
\fIvolumes\fR\&.
.PP
In DRBD 9, a resource can be replicated between two or more cluster nodes\&. The connections between cluster nodes are point\-to\-point links, and use TCP or a TCP\-like protocol\&. All nodes must be directly connected\&.
.PP
DRBD consists of low\-level user\-space components which interact with the kernel and perform basic operations (\fBdrbdsetup\fR,
\fBdrbdmeta\fR), a high\-level user\-space component which understands and processes the DRBD configuration and translates it into basic operations of the low\-level components (\fBdrbdadm\fR), and a kernel component\&.
.PP
The default DRBD configuration consists of
\fB/etc/drbd\&.conf\fR
and of additional files included from there, usually
\fBglobal_common\&.conf\fR
and all
\fB\fI*\fR\fR\fB\&.res\fR
files inside
\fB/etc/drbd\&.d/\fR\&. It has turned out to be useful to define each resource in a separate
\fB\fI*\fR\fR\fB\&.res\fR
file\&.
.PP
The configuration files are designed so that each cluster node can contain an identical copy of the entire cluster configuration\&. The host name of each node determines which parts of the configuration apply (\fBuname \-n\fR)\&. It is highly recommended to keep the cluster configuration on all nodes in sync by manually copying it to all nodes, or by automating the process with
\fBcsync2\fR
or a similar tool\&.
.SH "EXAMPLE CONFIGURATION FILE"
.PP
.sp
.if n \{\
.RS 4
.\}
.nf
resource r0 {
net {
cram\-hmac\-alg sha1;
shared\-secret "FooFunFactory";
}
volume 0 {
device /dev/drbd1;
disk /dev/sda7;
meta\-disk internal;
}
on alice {
node\-id 0;
address 10\&.1\&.1\&.31:7000;
}
on bob {
node\-id 1;
address 10\&.1\&.1\&.32:7000;
}
connection {
host alice port 7000;
host bob port 7000;
net {
protocol C;
}
}
}
.fi
.if n \{\
.RE
.\}
.sp
This example defines a resource
\fBr0\fR
which contains a single replicated device with volume number 0\&. The resource is replicated among hosts
\fBalice\fR
and
\fBbob\fR, which have the IPv4 addresses
\fB10\&.1\&.1\&.31\fR
and
\fB10\&.1\&.1\&.32\fR
and the node identifiers 0 and 1, respectively\&. On both hosts, the replicated device is called
\fB/dev/drbd1\fR, and the actual data and metadata are stored on the lower\-level device
\fB/dev/sda7\fR\&. The connection between the hosts uses protocol C\&.
.PP
Please refer to the
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2
for more examples\&.
.SH "FILE FORMAT"
.PP
DRBD configuration files consist of sections, which contain other sections and parameters depending on the section types\&. Each section consists of one or more keywords, sometimes a section name, an opening brace (\(lq{\(rq), the section\'s contents, and a closing brace (\(lq}\(rq)\&. Parameters inside a section consist of a keyword, followed by one or more keywords or values, and a semicolon (\(lq;\(rq)\&.
.PP
Some parameter values have a default scale which applies when a plain number is specified (for example Kilo, or 1024 times the numeric value)\&. Such default scales can be overridden by using a suffix (for example,
\fBM\fR
for Mega)\&. The common suffixes
\fBK\fR
= 2^10 = 1024,
\fBM\fR
= 1024 K, and
\fBG\fR
= 1024 M are supported\&.
.PP
Comments start with a hash sign (\(lq#\(rq) and extend to the end of the line\&. In addition, any section can be prefixed with the keyword
\fBskip\fR, which causes the section and any sub\-sections to be ignored\&.
.PP
Additional files can be included with the
\fBinclude \fR\fB\fIfile\-pattern\fR\fR
statement (see
\fBglob\fR(7)
for the expressions supported in
\fIfile\-pattern\fR)\&. Include statements are only allowed outside of sections\&.
.PP
The following sections are defined (indentation indicates in which context):
.sp
.if n \{\
.RS 4
.\}
.nf
common
[disk]
[handlers]
[net]
[options]
[startup]
global
resource
connection
path
net
connection\-mesh
net
[disk]
floating
handlers
[net]
on
volume
disk
[disk]
options
stacked\-on\-top\-of
startup
.fi
.if n \{\
.RE
.\}
.sp
Sections in brackets affect other parts of the configuration: inside the
\fBcommon\fR
section, they apply to all resources\&. A
\fBdisk\fR
section inside a
\fBresource\fR
or
\fBon\fR
section applies to all volumes of that resource, and a
\fBnet\fR
section inside a
\fBresource\fR
section applies to all connections of that resource\&. This allows to avoid repeating identical options for each resource, connection, or volume\&. Options can be overridden in a more specific
\fBresource\fR,
\fBconnection\fR,
\fBon\fR, or
\fBvolume\fR
section\&.
.SS "Sections"
.PP
\fBcommon\fR
.RS 4
.\" drbd.conf: common
This section can contain each a
\fBdisk\fR,
\fBhandlers\fR,
\fBnet\fR,
\fBoptions\fR, and
\fBstartup\fR
section\&. All resources inherit the parameters in these sections as their default values\&.
.RE
.PP
\fBconnection \fR\fB\fI[name]\fR\fR
.RS 4
.\" drbd.conf: connection
Define a connection between two hosts\&. This section must contain two
\fBhost\fR
parameters or multiple
\fBpath sections\fR\&. The optional
\fIname\fR
is used to refer to the connection in the system log and in other messages\&. If no name is specified, the peer\'s host name is used instead\&.
.RE
.PP
\fBpath\fR
.RS 4
.\" drbd.conf: path
Define a path between two hosts\&. This section must contain two
\fBhost\fR
parameters\&.
.RE
.PP
\fBconnection\-mesh\fR
.RS 4
.\" drbd.conf: connection-mesh
Define a connection mesh between multiple hosts\&. This section must contain a
\fBhosts\fR
parameter, which has the host names as arguments\&. This section is a shortcut to define many connections which share the same network options\&.
.RE
.PP
\fBdisk\fR
.RS 4
.\" drbd.conf: disk
Define parameters for a volume\&. All parameters in this section are optional\&.
.RE
.PP
\fBfloating \fR\fB\fI[address\-family]\fR\fR\fB \fR\fB\fIaddr\fR\fR\fB:\fR\fB\fIport\fR\fR
.RS 4
.\" drbd.conf: floating
Like the
\fBon\fR
section, except that instead of the host name a network address is used to determine if it matches a
\fBfloating\fR
section\&.
.sp
The
\fBnode\-id\fR
parameter in this section is required\&. If the
\fBaddress\fR
parameter is not provided, no connections to peers will be created by default\&. The
\fBdevice\fR,
\fBdisk\fR, and
\fBmeta\-disk\fR
parameters must be defined in, or inherited by, this section\&.
.RE
.PP
\fBglobal\fR
.RS 4
.\" drbd.conf: global
Define some global parameters\&. All parameters in this section are optional\&. Only one
\fBglobal\fR
section is allowed in the configuration\&.
.RE
.PP
\fBhandlers\fR
.RS 4
.\" drbd.conf: handlers
Define handlers to be invoked when certain events occur\&. The kernel passes the resource name in the first command\-line argument and sets the following environment variables depending on the event\'s context:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
For events related to a particular device: the device\'s minor number in
\fBDRBD_MINOR\fR, the device\'s volume number in
\fBDRBD_VOLUME\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
For events related to a particular device on a particular peer: the connection endpoints in
\fBDRBD_MY_ADDRESS\fR,
\fBDRBD_MY_AF\fR,
\fBDRBD_PEER_ADDRESS\fR, and
\fBDRBD_PEER_AF\fR; the device\'s local minor number in
\fBDRBD_MINOR\fR, and the device\'s volume number in
\fBDRBD_VOLUME\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
For events related to a particular connection: the connection endpoints in
\fBDRBD_MY_ADDRESS\fR,
\fBDRBD_MY_AF\fR,
\fBDRBD_PEER_ADDRESS\fR, and
\fBDRBD_PEER_AF\fR; and, for each device defined for that connection: the device\'s minor number in
\fBDRBD_MINOR_\fR\fB\fIvolume\-number\fR\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
For events that identify a device, if a lower\-level device is attached, the lower\-level device\'s device name is passed in
\fBDRBD_BACKING_DEV\fR
(or
\fBDRBD_BACKING_DEV_\fR\fB\fIvolume\-number\fR\fR)\&.
.RE
.RS 4
.sp
All parameters in this section are optional\&. Only a single handler can be defined for each event; if no handler is defined, nothing will happen\&.
.RE
.PP
\fBnet\fR
.RS 4
.\" drbd.conf: net
Define parameters for a connection\&. All parameters in this section are optional\&.
.RE
.PP
\fBon\fR \fB\fIhost\-name\fR\fR \fI[\&.\&.\&.]\fR
.RS 4
.\" drbd.conf: on
Define the properties of a resource on a particular host or set of hosts\&. Specifying more than one host name can make sense in a setup with IP address failover, for example\&. The
\fIhost\-name\fR
argument must match the Linux host name (\fBuname \-n\fR)\&.
.sp
Usually contains or inherits at least one
\fBvolume\fR
section\&. The
\fBnode\-id\fR
and
\fBaddress\fR
parameters must be defined in this section\&. The
\fBdevice\fR,
\fBdisk\fR, and
\fBmeta\-disk\fR
parameters must be defined in, or inherited by, this section\&.
.sp
A normal configuration file contains two or more
\fBon\fR
sections for each resource\&. Also see the
\fBfloating\fR
section\&.
.RE
.PP
\fBoptions\fR
.RS 4
.\" drbd.conf: options
Define parameters for a resource\&. All parameters in this section are optional\&.
.RE
.PP
\fBresource\fR \fB\fIname\fR\fR
.RS 4
.\" drbd.conf: resource
Define a resource\&. Usually contains at least two
\fBon\fR
sections and at least one
\fBconnection\fR
section\&.
.RE
.PP
\fBstacked\-on\-top\-of \fR\fB\fIresource\fR\fR
.RS 4
.\" drbd.conf: stacked-on-top-of
Used instead of an
\fBon\fR
section for configuring a stacked resource with three to four nodes\&.
.sp
Starting with DRBD 9, stacking is deprecated\&. It is advised to use resources which are replicated among more than two nodes instead\&.
.RE
.PP
\fBstartup\fR
.RS 4
.\" drbd.conf: startup
The parameters in this section determine the behavior of a resource at startup time\&.
.RE
.PP
\fBvolume\fR \fB\fIvolume\-number\fR\fR
.RS 4
.\" drbd.conf: volume
Define a volume within a resource\&. The volume numbers in the various
\fBvolume\fR
sections of a resource define which devices on which hosts form a replicated device\&.
.RE
.SS "Section connection Parameters"
.PP
\fBhost \fR\fB\fIname\fR\fR [\fBaddress \fR\fB[address\-family]\fR\fB \fR\fB\fIaddress\fR\fR] [\fBport \fR\fB\fIport\-number\fR\fR]
.RS 4
.\" drbd.conf: host
Defines an endpoint for a connection\&. Each
\fBhost\fR
statement refers to an
\fBon\fR
section in a resource\&. If a port number is defined, this endpoint will use the specified port instead of the port defined in the
\fBon\fR
section\&. Each
\fBconnection\fR
section must contain exactly two
\fBhost\fR
parameters\&. Instead of two
\fBhost\fR
parameters the connection may contain multiple
\fBpath\fR
sections\&.
.RE
.SS "Section path Parameters"
.PP
\fBhost \fR\fB\fIname\fR\fR [\fBaddress \fR\fB[address\-family]\fR\fB \fR\fB\fIaddress\fR\fR] [\fBport \fR\fB\fIport\-number\fR\fR]
.RS 4
.\" drbd.conf: host
Defines an endpoint for a connection\&. Each
\fBhost\fR
statement refers to an
\fBon\fR
section in a resource\&. If a port number is defined, this endpoint will use the specified port instead of the port defined in the
\fBon\fR
section\&. Each
\fBpath\fR
section must contain exactly two
\fBhost\fR
parameters\&.
.RE
.SS "Section connection\-mesh Parameters"
.PP
\fBhosts \fR\fB\fIname\fR...\fR
.RS 4
.\" drbd.conf: host
Defines all nodes of a mesh\&. Each
\fB\fIname\fR\fR
refers to an
\fBon\fR
section in a resource\&. The port that is defined in the
\fBon\fR
section will be used\&.
.RE
.SS "Section disk Parameters"
.PP
\fBal\-extents \fR\fB\fIextents\fR\fR
.RS 4
.\" drbd.conf: al-extents
DRBD automatically maintains a "hot" or "active" disk area likely to be written to again soon based on the recent write activity\&. The "active" disk area can be written to immediately, while "inactive" disk areas must be "activated" first, which requires a meta\-data write\&. We also refer to this active disk area as the "activity log"\&.
.sp
The activity log saves meta\-data writes, but the whole log must be resynced upon recovery of a failed node\&. The size of the activity log is a major factor of how long a resync will take and how fast a replicated disk will become consistent after a crash\&.
.sp
The activity log consists of a number of 4\-Megabyte segments; the
\fIal\-extents\fR
parameter determines how many of those segments can be active at the same time\&. The default value for
\fIal\-extents\fR
is 1237, with a minimum of 7 and a maximum of 65536\&.
.sp
Note that the effective maximum may be smaller, depending on how you created the device meta data, see also
\fBdrbdmeta\fR(8)
The effective maximum is 919 * (available on\-disk activity\-log ring\-buffer area/4kB \-1), the default 32kB ring\-buffer effects a maximum of 6433 (covers more than 25 GiB of data) We recommend to keep this well within the amount your backend storage and replication link are able to resync inside of about 5 minutes\&.
.RE
.PP
\fBal\-updates \fR\fB{yes | no}\fR\fB \fR
.RS 4
.\" drbd.conf: al-updates
With this parameter, the activity log can be turned off entirely (see the
\fBal\-extents\fR
parameter)\&. This will speed up writes because fewer meta\-data writes will be necessary, but the entire device needs to be resynchronized opon recovery of a failed primary node\&. The default value for
\fBal\-updates\fR
is
\fByes\fR\&.
.RE
.PP
\fBc\-delay\-target \fR\fB\fIdelay_target\fR\fR,
.br
\fBc\-fill\-target \fR\fB\fIfill_target\fR\fR,
.br
\fBc\-max\-rate \fR\fB\fImax_rate\fR\fR,
.br
\fBc\-plan\-ahead \fR\fB\fIplan_time\fR\fR
.RS 4
Dynamically control the resync speed\&. This mechanism is enabled by setting the
\fBc\-plan\-ahead\fR
parameter to a positive value\&. The goal is to either fill the buffers along the data path with a defined amount of data if
\fBc\-fill\-target\fR
is defined, or to have a defined delay along the path if
\fBc\-delay\-target\fR
is defined\&. The maximum bandwidth is limited by the
\fBc\-max\-rate\fR
parameter\&.
.sp
The
\fBc\-plan\-ahead\fR
parameter defines how fast drbd adapts to changes in the resync speed\&. It should be set to five times the network round\-trip time or more\&. Common values for
\fBc\-fill\-target\fR
for "normal" data paths range from 4K to 100K\&. If drbd\-proxy is used, it is advised to use
\fBc\-delay\-target\fR
instead of
\fBc\-fill\-target\fR\&. The
\fBc\-delay\-target\fR
parameter is used if the
\fBc\-fill\-target\fR
parameter is undefined or set to 0\&. The
\fBc\-delay\-target\fR
parameter should be set to five times the network round\-trip time or more\&. The
\fBc\-max\-rate\fR
option should be set to either the bandwidth available between the DRBD\-hosts and the machines hosting DRBD\-proxy, or to the available disk bandwidth\&.
.sp
The default values of these parameters are:
\fBc\-plan\-ahead\fR
= 20 (in units of 0\&.1 seconds),
\fBc\-fill\-target\fR
= 0 (in units of sectors),
\fBc\-delay\-target\fR
= 1 (in units of 0\&.1 seconds), and
\fBc\-max\-rate\fR
= 102400 (in units of KiB/s)\&.
.sp
Dynamic resync speed control is available since DRBD 8\&.3\&.9\&.
.RE
.PP
\fBc\-min\-rate \fR\fB\fImin_rate\fR\fR
.RS 4
A node which is primary and sync\-source has to schedule application I/O requests and resync I/O requests\&. The
\fBc\-min\-rate\fR
parameter limits how much bandwidth is available for resync I/O; the remaining bandwidth is used for application I/O\&.
.sp
A
\fBc\-min\-rate\fR
value of 0 means that there is no limit on the resync I/O bandwidth\&. This can slow down application I/O significantly\&. Use a value of 1 (1 KiB/s) for the lowest possible resync rate\&.
.sp
The default value of
\fBc\-min\-rate\fR
is 4096, in units of KiB/s\&.
.RE
.PP
\fBdisk\-barrier\fR,
.br
\fBdisk\-flushes\fR,
.br
\fBdisk\-drain\fR
.RS 4
.\" drbd.conf: disk-barrier
.\" drbd.conf: disk-flushes
.\" drbd.conf: disk-drain
DRBD has three methods of handling the ordering of dependent write requests:
.PP
\fBdisk\-barrier\fR
.RS 4
Use disk barriers to make sure that requests are written to disk in the right order\&. Barriers ensure that all requests submitted before a barrier make it to the disk before any requests submitted after the barrier\&. This is implemented using \'tagged command queuing\' on SCSI devices and \'native command queuing\' on SATA devices\&. Only some devices and device stacks support this method\&. The device mapper (LVM) only supports barriers in some configurations\&.
.sp
Note that on systems which do not support disk barriers, enabling this option can lead to data loss or corruption\&. Until DRBD 8\&.4\&.1,
\fBdisk\-barrier\fR
was turned on if the I/O stack below DRBD did support barriers\&. Kernels since linux\-2\&.6\&.36 (or 2\&.6\&.32 RHEL6) no longer allow to detect if barriers are supported\&. Since drbd\-8\&.4\&.2, this option is off by default and needs to be enabled explicitly\&.
.RE
.PP
\fBdisk\-flushes\fR
.RS 4
Use disk flushes between dependent write requests, also referred to as \'force unit access\' by drive vendors\&. This forces all data to disk\&. This option is enabled by default\&.
.RE
.PP
\fBdisk\-drain\fR
.RS 4
Wait for the request queue to "drain" (that is, wait for the requests to finish) before submitting a dependent write request\&. This method requires that requests are stable on disk when they finish\&. Before DRBD 8\&.0\&.9, this was the only method implemented\&. This option is enabled by default\&. Do not disable in production environments\&.
.RE
.sp
From these three methods, drbd will use the first that is enabled and supported by the backing storage device\&. If all three of these options are turned off, DRBD will submit write requests without bothering about dependencies\&. Depending on the I/O stack, write requests can be reordered, and they can be submitted in a different order on different cluster nodes\&. This can result in data loss or corruption\&. Therefore, turning off all three methods of controlling write ordering is strongly discouraged\&.
.sp
A general guideline for configuring write ordering is to use disk barriers or disk flushes when using ordinary disks (or an ordinary disk array) with a volatile write cache\&. On storage without cache or with a battery backed write cache, disk draining can be a reasonable choice\&.
.RE
.PP
\fBdisk\-timeout\fR
.RS 4
.\" drbd.conf: disk-timeout
If the lower\-level device on which a DRBD device stores its data does not finish an I/O request within the defined
\fBdisk\-timeout\fR, DRBD treats this as a failure\&. The lower\-level device is detached, and the device\'s disk state advances to Diskless\&. If DRBD is connected to one or more peers, the failed request is passed on to one of them\&.
.sp
This option is
\fIdangerous and may lead to kernel panic!\fR
.sp
"Aborting" requests, or force\-detaching the disk, is intended for completely blocked/hung local backing devices which do no longer complete requests at all, not even do error completions\&. In this situation, usually a hard\-reset and failover is the only way out\&.
.sp
By "aborting", basically faking a local error\-completion, we allow for a more graceful swichover by cleanly migrating services\&. Still the affected node has to be rebooted "soon"\&.
.sp
By completing these requests, we allow the upper layers to re\-use the associated data pages\&.
.sp
If later the local backing device "recovers", and now DMAs some data from disk into the original request pages, in the best case it will just put random data into unused pages; but typically it will corrupt meanwhile completely unrelated data, causing all sorts of damage\&.
.sp
Which means delayed successful completion, especially for READ requests, is a reason to panic()\&. We assume that a delayed *error* completion is OK, though we still will complain noisily about it\&.
.sp
The default value of
\fBdisk\-timeout\fR
is 0, which stands for an infinite timeout\&. Timeouts are specified in units of 0\&.1 seconds\&. This option is available since DRBD 8\&.3\&.12\&.
.RE
.PP
\fBfencing \fR\fB\fIfencing_policy\fR\fR
.RS 4
.\" drbd.conf: fencing
\fBFencing\fR
is a preventive measure to avoid situations where both nodes are primary and disconnected\&. This is also known as a split\-brain situation\&. DRBD supports the following fencing policies:
.PP
\fBdont\-care\fR
.RS 4
No fencing actions are taken\&. This is the default policy\&.
.RE
.PP
\fBresource\-only\fR
.RS 4
If a node becomes a disconnected primary, it tries to fence the peer\&. This is done by calling the
\fBfence\-peer\fR
handler\&. The handler is supposed to reach the peer over an alternative communication path and call \'\fBdrbdadm outdate minor\fR\' there\&.
.RE
.PP
\fBresource\-and\-stonith\fR
.RS 4
If a node becomes a disconnected primary, it freezes all its IO operations and calls its fence\-peer handler\&. The fence\-peer handler is supposed to reach the peer over an alternative communication path and call \'\fBdrbdadm outdate minor\fR\' there\&. In case it cannot do that, it should stonith the peer\&. IO is resumed as soon as the situation is resolved\&. In case the fence\-peer handler fails, I/O can be resumed manually with \'\fBdrbdadm resume\-io\fR\'\&.
.RE
.RE
.PP
\fBmd\-flushes\fR
.RS 4
.\" drbd.conf: md-flushes
Enable disk flushes and disk barriers on the meta\-data device\&. This option is enabled by default\&. See the
\fBdisk\-flushes\fR
parameter\&.
.RE
.PP
\fBon\-io\-error \fR\fB\fIhandler\fR\fR
.RS 4
.\" drbd.conf: on-io-error
Configure how DRBD reacts to I/O errors on a lower\-level device\&. The following policies are defined:
.PP
\fBpass_on\fR
.RS 4
Change the disk status to Inconsistent, mark the failed block as inconsistent in the bitmap, and retry the I/O operation on a remote cluster node\&.
.RE
.PP
\fBcall\-local\-io\-error\fR
.RS 4
Call the
\fBlocal\-io\-error\fR
handler (see the
\fBhandlers\fR
section)\&.
.RE
.PP
\fBdetach\fR
.RS 4
Detach the lower\-level device and continue in diskless mode\&.
.RE
.sp
.RE
.PP
\fBread\-balancing \fR\fB\fIpolicy\fR\fR
.RS 4
.\" drbd.conf: read-balancing
Distribute read requests among cluster nodes as defined by
\fIpolicy\fR\&. The supported policies are
\fBprefer\-local\fR
(the default),
\fBprefer\-remote\fR,
\fBround\-robin\fR,
\fBleast\-pending\fR,
\fBwhen\-congested\-remote\fR,
\fB32K\-striping\fR,
\fB64K\-striping\fR,
\fB128K\-striping\fR,
\fB256K\-striping\fR,
\fB512K\-striping\fR
and
\fB1M\-striping\fR\&.
.sp
This option is available since DRBD 8\&.4\&.1\&.
.RE
.PP
\fBresync\-after \fR\fB\fIres\-name\fR\fR\fB/\fR\fB\fIvolume\fR\fR
.RS 4
.\" drbd.conf: resync-after
Define that a device should only resynchronize after the specified other device\&. By default, no order between devices is defined, and all devices will resynchronize in parallel\&. Depending on the configuration of the lower\-level devices, and the available network and disk bandwidth, this can slow down the overall resync process\&. This option can be used to form a chain or tree of dependencies among devices\&.
.RE
.PP
\fBresync\-rate \fR\fB\fIrate\fR\fR
.RS 4
.\" drbd.conf: resync-rate
Define how much bandwidth DRBD may use for resynchronizing\&. DRBD allows "normal" application I/O even during a resync\&. If the resync takes up too much bandwidth, application I/O can become very slow\&. This parameter allows to avoid that\&. Please note this is option only works when the dynamic resync controller is disabled\&.
.RE
.PP
\fBrs\-discard\-granularity \fR\fB\fIbyte\fR\fR
.RS 4
.\" drbd.conf: rs-discard-granularity
When
\fBrs\-discard\-granularity\fR
is set to a non zero, positive value then DRBD tries to do a resync operation in requests of this size\&. In case such a block contains only zero bytes on the sync source node, the sync target node will issue a discard/trim/unmap command for the area\&.
.sp
The value is constrained by the discard granularity of the backing block device\&. In case
\fBrs\-discard\-granularity\fR
is not a multiplier of the discard granularity of the backing block device DRBD rounds it up\&. The feature only gets active if the backing block device reads back zeroes after a discard command\&.
.sp
The default value of is 0\&. This option is available since 8\&.4\&.7\&.
.RE
.PP
\fBdiscard\-zeroes\-if\-aligned \fR\fB{yes | no}\fR
.RS 4
.\" drbd.conf: discard-zeroes-if-aligned
There are several aspects to discard/trim/unmap support on linux block devices\&. Even if discard is supported in general, it may fail silently, or may partially ignore discard requests\&. Devices also announce whether reading from unmapped blocks returns defined data (usually zeroes), or undefined data (possibly old data, possibly garbage)\&.
.sp
If on different nodes, DRBD is backed by devices with differing discard characteristics, discards may lead to data divergence (old data or garbage left over on one backend, zeroes due to unmapped areas on the other backend)\&. Online verify would now potentially report tons of spurious differences\&. While probably harmless for most use cases (fstrim on a file system), DRBD cannot have that\&.
.sp
To play safe, we have to disable discard support, if our local backend (on a Primary) does not support "discard_zeroes_data=true"\&. We also have to translate discards to explicit zero\-out on the receiving side, unless the receiving side (Secondary) supports "discard_zeroes_data=true", thereby allocating areas what were supposed to be unmapped\&.
.sp
There are some devices (notably the LVM/DM thin provisioning) that are capable of discard, but announce discard_zeroes_data=false\&. In the case of DM\-thin, discards aligned to the chunk size will be unmapped, and reading from unmapped sectors will return zeroes\&. However, unaligned partial head or tail areas of discard requests will be silently ignored\&.
.sp
If we now add a helper to explicitly zero\-out these unaligned partial areas, while passing on the discard of the aligned full chunks, we effectively achieve discard_zeroes_data=true on such devices\&.
.sp
Setting
\fBdiscard\-zeroes\-if\-aligned\fR
to
\fByes\fR
will allow DRBD to use discards, and to announce discard_zeroes_data=true, even on backends that announce discard_zeroes_data=false\&.
.sp
Setting
\fBdiscard\-zeroes\-if\-aligned\fR
to
\fBno\fR
will cause DRBD to always fall\-back to zero\-out on the receiving side, and to not even announce discard capabilities on the Primary, if the respective backend announces discard_zeroes_data=false\&.
.sp
We used to ignore the discard_zeroes_data setting completely\&. To not break established and expected behaviour, and suddenly cause fstrim on thin\-provisioned LVs to run out\-of\-space instead of freeing up space, the default value is
\fByes\fR\&.
.sp
This option is available since 8\&.4\&.7\&.
.RE
.SS "Section global Parameters"
.PP
\fBdialog\-refresh \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: dialog-refresh
The DRBD init script can be used to configure and start DRBD devices, which can involve waiting for other cluster nodes\&. While waiting, the init script shows the remaining waiting time\&. The
\fBdialog\-refresh\fR
defines the number of seconds between updates of that countdown\&. The default value is 1; a value of 0 turns off the countdown\&.
.RE
.PP
\fBdisable\-ip\-verification\fR
.RS 4
.\" drbd.conf: disable-ip-verification
Normally, DRBD verifies that the IP addresses in the configuration match the host names\&. Use the
\fBdisable\-ip\-verification\fR
parameter to disable these checks\&.
.RE
.PP
\fBusage\-count \fR\fB{yes | no | ask}\fR\fB \fR
.RS 4
.\" drbd.conf: usage-count
A explained on DRBD\'s
\m[blue]\fBOnline Usage Counter\fR\m[]\&\s-2\u[2]\d\s+2
web page, DRBD includes a mechanism for anonymously counting how many installations are using which versions of DRBD\&. The results are available on the web page for anyone to see\&.
.sp
This parameter defines if a cluster node participates in the usage counter; the supported values are
\fByes\fR,
\fBno\fR, and
\fBask\fR
(ask the user, the default)\&.
.sp
We would like to ask users to participate in the online usage counter as this provides us valuable feedback for steering the development of DRBD\&.
.RE
.SS "Section handlers Parameters"
.PP
\fBafter\-resync\-target \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: after-resync-target
Called on a resync target when a node state changes from
\fBInconsistent\fR
to
\fBConsistent\fR
when a resync finishes\&. This handler can be used for removing the snapshot created in the
\fBbefore\-resync\-target\fR
handler\&.
.RE
.PP
\fBbefore\-resync\-target \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: before-resync-target
Called on a resync target before a resync begins\&. This handler can be used for creating a snapshot of the lower\-level device for the duration of the resync: if the resync source becomes unavailable during a resync, reverting to the snapshot can restore a consistent state\&.
.RE
.PP
\fBfence\-peer \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: fence-peer
Called when a node should fence a resource on a particular peer\&. The handler should not use the same communication path that DRBD uses for talking to the peer\&.
.RE
.PP
\fBunfence\-peer \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: unfence-peer
Called when a node should remove fencing constraints from other nodes\&.
.RE
.PP
\fBinitial\-split\-brain \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: initial-split-brain
Called when DRBD connects to a peer and detects that the peer is in a split\-brain state with the local node\&. This handler is also called for split\-brain scenarios which will be resolved automatically\&.
.RE
.PP
\fBlocal\-io\-error \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: local-io-error
Called when an I/O error occurs on a lower\-level device\&.
.RE
.PP
\fBpri\-lost \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-lost
The local node is currently primary, but DRBD believes that it should become a sync target\&. The node should give up its primary role\&.
.RE
.PP
\fBpri\-lost\-after\-sb \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-lost-after-sb
The local node is currently primary, but it has lost the after\-split\-brain auto recovery procedure\&. The node should be abandoned\&.
.RE
.PP
\fBpri\-on\-incon\-degr \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: pri-on-incon-degr
The local node is primary, and neither the local lower\-level device nor a lower\-level device on a peer is up to date\&. (The primary has no device to read from or to write to\&.)
.RE
.PP
\fBsplit\-brain \fR\fB\fIcmd\fR\fR
.RS 4
.\" drbd.conf: split-brain
DRBD has detected a split\-brain situation which could not be resolved automatically\&. Manual recovery is necessary\&. This handler can be used to call for administrator attention\&.
.RE
.SS "Section net Parameters"
.PP
\fBafter\-sb\-0pri \fR\fB\fIpolicy\fR\fR
.RS 4
.\" drbd.conf: after-sb-0pri
Define how to react if a split\-brain scenario is detected and none of the two nodes is in primary role\&. (We detect split\-brain scenarios when two nodes connect; split\-brain decisions are always between two nodes\&.) The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization; simply disconnect\&.
.RE
.PP
\fBdiscard\-younger\-primary\fR,
.br
\fBdiscard\-older\-primary\fR
.RS 4
Resynchronize from the node which became primary first (\fBdiscard\-younger\-primary\fR) or last (\fBdiscard\-older\-primary\fR)\&. If both nodes became primary independently, the
\fBdiscard\-least\-changes\fR
policy is used\&.
.RE
.PP
\fBdiscard\-zero\-changes\fR
.RS 4
If only one of the nodes wrote data since the split brain situation was detected, resynchronize from this node to the other\&. If both nodes wrote data, disconnect\&.
.RE
.PP
\fBdiscard\-least\-changes\fR
.RS 4
Resynchronize from the node with more modified blocks\&.
.RE
.PP
\fBdiscard\-node\-\fR\fB\fInodename\fR\fR
.RS 4
Always resynchronize to the named node\&.
.RE
.RE
.PP
\fBafter\-sb\-1pri \fR\fB\fIpolicy\fR\fR
.RS 4
.\" drbd.conf: after-sb-1pri
Define how to react if a split\-brain scenario is detected, with one node in primary role and one node in secondary role\&. (We detect split\-brain scenarios when two nodes connect, so split\-brain decisions are always among two nodes\&.) The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBconsensus\fR
.RS 4
Discard the data on the secondary node if the
\fBafter\-sb\-0pri\fR
algorithm would also discard the data on the secondary node\&. Otherwise, disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm, even if it causes an erratic change of the primary\'s view of the data\&. This is only useful if a single\-node file system (i\&.e\&., not OCFS2 or GFS) with the
\fBallow\-two\-primaries\fR
flag is used\&. This option can cause the primary node to crash, and should not be used\&.
.RE
.PP
\fBdiscard\-secondary\fR
.RS 4
Discard the data on the secondary node\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Always take the decision of the
\fBafter\-sb\-0pri\fR
algorithm\&. If the decision is to discard the data on the primary node, call the
\fBpri\-lost\-after\-sb\fR
handler on the primary node\&.
.RE
.RE
.PP
\fBafter\-sb\-2pri \fR\fB\fIpolicy\fR\fR
.RS 4
.\" drbd.conf: after-sb-2pri
Define how to react if a split\-brain scenario is detected and both nodes are in primary role\&. (We detect split\-brain scenarios when two nodes connect, so split\-brain decisions are always among two nodes\&.) The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\-as0p\fR
.RS 4
See the
\fBviolently\-as0p\fR
policy for
\fBafter\-sb\-1pri\fR\&.
.RE
.PP
\fBcall\-pri\-lost\-after\-sb\fR
.RS 4
Call the
\fBpri\-lost\-after\-sb\fR
helper program on one of the machines unless that machine can demote to secondary\&. The helper program is expected to reboot the machine, which brings the node into a secondary role\&. Which machine runs the helper program is determined by the
\fBafter\-sb\-0pri\fR
strategy\&.
.RE
.RE
.PP
\fBallow\-two\-primaries\fR
.RS 4
.\" drbd.conf: allow-two-primaries
The most common way to configure DRBD devices is to allow only one node to be primary (and thus writable) at a time\&.
.sp
In some scenarios it is preferable to allow two nodes to be primary at once; a mechanism outside of DRBD then must make sure that writes to the shared, replicated device happen in a coordinated way\&. This can be done with a shared\-storage cluster file system like OCFS2 and GFS, or with virtual machine images and a virtual machine manager that can migrate virtual machines between physical machines\&.
.sp
The
\fBallow\-two\-primaries\fR
parameter tells DRBD to allow two nodes to be primary at the same time\&. Never enable this option when using a non\-distributed file system; otherwise, data corruption and node crashes will result!
.RE
.PP
\fBalways\-asbp\fR
.RS 4
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\&.
.sp
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\&.)
.RE
.PP
\fBconnect\-int \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: connect-int
As soon as a connection between two nodes is configured with
\fBdrbdsetup connect\fR, DRBD immediately tries to establish the connection\&. If this fails, DRBD waits for
\fBconnect\-int\fR
seconds and then repeats\&. The default value of
\fBconnect\-int\fR
is 10 seconds\&.
.RE
.PP
\fBcram\-hmac\-alg \fR\fB\fIhash\-algorithm\fR\fR
.RS 4
.\" drbd.conf: cram-hmac-alg
Configure the hash\-based message authentication code (HMAC) or secure hash algorithm to use for peer authentication\&. The kernel supports a number of different algorithms, some of which may be loadable as kernel modules\&. See the shash algorithms listed in /proc/crypto\&. By default,
\fBcram\-hmac\-alg\fR
is unset\&. Peer authentication also requires a
\fBshared\-secret\fR
to be configured\&.
.RE
.PP
\fBcsums\-alg \fR\fB\fIhash\-algorithm\fR\fR
.RS 4
.\" drbd.conf: csums-alg
Normally, when two nodes resynchronize, the sync target requests a piece of out\-of\-sync data from the sync source, and the sync source sends the data\&. With many usage patterns, a significant number of those blocks will actually be identical\&.
.sp
When a
\fBcsums\-alg\fR
algorithm is specified, when requesting a piece of out\-of\-sync data, the sync target also sends along a hash of the data it currently has\&. The sync source compares this hash with its own version of the data\&. It sends the sync target the new data if the hashes differ, and tells it that the data are the same otherwise\&. This reduces the network bandwidth required, at the cost of higher cpu utilization and possibly increased I/O on the sync target\&.
.sp
The
\fBcsums\-alg\fR
can be set to one of the secure hash algorithms supported by the kernel; see the shash algorithms listed in /proc/crypto\&. By default,
\fBcsums\-alg\fR
is unset\&.
.RE
.PP
\fBcsums\-after\-crash\-only\fR
.RS 4
.\" drbd.conf: csums-after-crash-only
Enabling this option (and csums\-alg, above) makes it possible to use the checksum based resync only for the first resync after primary crash, but not for later "network hickups"\&.
.sp
In most cases, block that are marked as need\-to\-be\-resynced are in fact changed, so calculating checksums, and both reading and writing the blocks on the resync target is all effective overhead\&.
.sp
The advantage of checksum based resync is mostly after primary crash recovery, where the recovery marked larger areas (those covered by the activity log) as need\-to\-be\-resynced, just in case\&. Introduced in 8\&.4\&.5\&.
.RE
.PP
\fBdata\-integrity\-alg \fR \fIalg\fR
.RS 4
.\" drbd.conf: data-integrity-alg
DRBD normally relies on the data integrity checks built into the TCP/IP protocol, but if a data integrity algorithm is configured, it will additionally use this algorithm to make sure that the data received over the network match what the sender has sent\&. If a data integrity error is detected, DRBD will close the network connection and reconnect, which will trigger a resync\&.
.sp
The
\fBdata\-integrity\-alg\fR
can be set to one of the secure hash algorithms supported by the kernel; see the shash algorithms listed in /proc/crypto\&. By default, this mechanism is turned off\&.
.sp
Because of the CPU overhead involved, we recommend not to use this option in production environments\&. Also see the notes on data integrity below\&.
.RE
.PP
\fBko\-count \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: ko-count
If a secondary node fails to complete a write request in
\fBko\-count\fR
times the
\fBtimeout\fR
parameter, it is excluded from the cluster\&. The primary node then sets the connection to this secondary node to Standalone\&. To disable this feature, you should explicitly set it to 0; defaults may change between versions\&.
.RE
.PP
\fBmax\-buffers \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: max-buffers
Limits the memory usage per DRBD minor device on the receiving side, or for internal buffers during resync or online\-verify\&. Unit is PAGE_SIZE, which is 4 KiB on most systems\&. The minimum possible setting is hard coded to 32 (=128 KiB)\&. These buffers are used to hold data blocks while they are written to/read from disk\&. To avoid possible distributed deadlocks on congestion, this setting is used as a throttle threshold rather than a hard limit\&. Once more than max\-buffers pages are in use, further allocation from this pool is throttled\&. You want to increase max\-buffers if you cannot saturate the IO backend on the receiving side\&.
.RE
.PP
\fBmax\-epoch\-size \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: max-epoch-size
Define the maximum number of write requests DRBD may issue before issuing a write barrier\&. The default value is 2048, with a minimum of 1 and a maximum of 20000\&. Setting this parameter to a value below 10 is likely to decrease performance\&.
.RE
.PP
\fBon\-congestion \fR\fB\fIpolicy\fR\fR,
.br
\fBcongestion\-fill \fR\fB\fIthreshold\fR\fR,
.br
\fBcongestion\-extents \fR\fB\fIthreshold\fR\fR
.RS 4
By default, DRBD blocks when the TCP send queue is full\&. This prevents applications from generating further write requests until more buffer space becomes available again\&.
.sp
When DRBD is used together with DRBD\-proxy, it can be better to use the
\fBpull\-ahead\fR
\fBon\-congestion\fR
policy, which can switch DRBD into ahead/behind mode before the send queue is full\&. DRBD then records the differences between itself and the peer in its bitmap, but it no longer replicates them to the peer\&. When enough buffer space becomes available again, the node resynchronizes with the peer and switches back to normal replication\&.
.sp
This has the advantage of not blocking application I/O even when the queues fill up, and the disadvantage that peer nodes can fall behind much further\&. Also, while resynchronizing, peer nodes will become inconsistent\&.
.sp
The available congestion policies are
\fBblock\fR
(the default) and
\fBpull\-ahead\fR\&. The
\fBcongestion\-fill\fR
parameter defines how much data is allowed to be "in flight" in this connection\&. The default value is 0, which disables this mechanism of congestion control, with a maximum of 10 GiBytes\&. The
\fBcongestion\-extents\fR
parameter defines how many bitmap extents may be active before switching into ahead/behind mode, with the same default and limits as the
\fBal\-extents\fR
parameter\&. The
\fBcongestion\-extents\fR
parameter is effective only when set to a value smaller than
\fBal\-extents\fR\&.
.sp
Ahead/behind mode is available since DRBD 8\&.3\&.10\&.
.RE
.PP
\fBping\-int \fR\fB\fIinterval\fR\fR
.RS 4
.\" drbd.conf: ping-int
When the TCP/IP connection to a peer is idle for more than
\fBping\-int\fR
seconds, DRBD will send a keep\-alive packet to make sure that a failed peer or network connection is detected reasonably soon\&. The default value is 10 seconds, with a minimum of 1 and a maximum of 120 seconds\&. The unit is seconds\&.
.RE
.PP
\fBping\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
.\" drbd.conf: ping-timeout
Define the timeout for replies to keep\-alive packets\&. If the peer does not reply within
\fBping\-timeout\fR, DRBD will close and try to reestablish the connection\&. The default value is 0\&.5 seconds, with a minimum of 0\&.1 seconds and a maximum of 3 seconds\&. The unit is tenths of a second\&.
.RE
.PP
\fBsocket\-check\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
.\" drbd.conf: socket-check-timeoutIn setups involving a DRBD\-proxy and connections that experience a lot of buffer\-bloat it might be necessary to set
\fBping\-timeout\fR
to an unusual high value\&. By default DRBD uses the same value to wait if a newly established TCP\-connection is stable\&. Since the DRBD\-proxy is usually located in the same data center such a long wait time may hinder DRBD\'s connect process\&.
.sp
In such setups
\fBsocket\-check\-timeout\fR
should be set to at least to the round trip time between DRBD and DRBD\-proxy\&. I\&.e\&. in most cases to 1\&.
.sp
The default unit is tenths of a second, the default value is 0 (which causes DRBD to use the value of
\fBping\-timeout\fR
instead)\&. Introduced in 8\&.4\&.5\&.
.RE
.PP
\fBprotocol \fR\fB\fIname\fR\fR
.RS 4
.\" drbd.conf: protocol
Use the specified protocol on this connection\&. The supported protocols are:
.PP
\fBA\fR
.RS 4
Writes to the DRBD device complete as soon as they have reached the local disk and the TCP/IP send buffer\&.
.RE
.PP
\fBB\fR
.RS 4
Writes to the DRBD device complete as soon as they have reached the local disk, and all peers have acknowledged the receipt of the write requests\&.
.RE
.PP
\fBC\fR
.RS 4
Writes to the DRBD device complete as soon as they have reached the local and all remote disks\&.
.RE
.sp
.RE
.PP
\fBrcvbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
.\" drbd.conf: rcvbuf-size
Configure the size of the TCP/IP receive buffer\&. A value of 0 (the default) causes the buffer size to adjust dynamically\&. This parameter usually does not need to be set, but it can be set to a value up to 10 MiB\&. The default unit is bytes\&.
.RE
.PP
\fBrr\-conflict\fR \fIpolicy\fR
.RS 4
.\" drbd.conf: rr-conflict
This option helps to solve the cases when the outcome of the resync decision is incompatible with the current role assignment in the cluster\&. The defined policies are:
.PP
\fBdisconnect\fR
.RS 4
No automatic resynchronization, simply disconnect\&.
.RE
.PP
\fBviolently\fR
.RS 4
Resync to the primary node is allowed, violating the assumption that data on a block device are stable for one of the nodes\&.
\fIDo not use this option, it is dangerous\&.\fR
.RE
.PP
\fBcall\-pri\-lost\fR
.RS 4
Call the
\fBpri\-lost\fR
handler on one of the machines\&. The handler is expected to reboot the machine, which puts it into secondary role\&.
.RE
.RE
.PP
\fBshared\-secret \fR\fB\fIsecret\fR\fR
.RS 4
.\" drbd.conf: shared-secret
Configure the shared secret used for peer authentication\&. The secret is a string of up to 64 characters\&. Peer authentication also requires the
\fBcram\-hmac\-alg\fR
parameter to be set\&.
.RE
.PP
\fBsndbuf\-size \fR\fB\fIsize\fR\fR
.RS 4
.\" drbd.conf: sndbuf-size
Configure the size of the TCP/IP send buffer\&. Since DRBD 8\&.0\&.13 / 8\&.2\&.7, a value of 0 (the default) causes the buffer size to adjust dynamically\&. Values below 32 KiB are harmful to the throughput on this connection\&. Large buffer sizes can be useful especially when protocol A is used over high\-latency networks; the maximum value supported is 10 MiB\&.
.RE
.PP
\fBtcp\-cork\fR
.RS 4
.\" drbd.conf: tcp-cork
By default, DRBD uses the TCP_CORK socket option to prevent the kernel from sending partial messages; this results in fewer and bigger packets on the network\&. Some network stacks can perform worse with this optimization\&. On these, the
\fBtcp\-cork\fR
parameter can be used to turn this optimization off\&.
.RE
.PP
\fBtimeout \fR\fB\fItime\fR\fR
.RS 4
.\" drbd.conf: timeout
Define the timeout for replies over the network: if a peer node does not send an expected reply within the specified
\fBtimeout\fR, it is considered dead and the TCP/IP connection is closed\&. The timeout value must be lower than
\fBconnect\-int\fR
and lower than
\fBping\-int\fR\&. The default is 6 seconds; the value is specified in tenths of a second\&.
.RE
.PP
\fBunplug\-watermark \fR\fB\fInumber\fR\fR
.RS 4
.\" drbd.conf: unplug-watermark
Mainline kernels before version 2\&.6\&.39\-rc1 use an explicit plug / unplug mechanism to control when a block device starts processing queued requests\&. On those kernels, the
\fBunplug\-watermark\fR
parameter defines how many requests must be queued until a secondary node starts processing them\&. Some storage controllers perform best when
\fBunplug\-watermark\fR
is set to the same value as
\fBmax\-buffers\fR; others are more efficient with smaller values\&. The default value for
\fBunplug\-watermark\fR
is 128, with a minimum of 16 and a maximum of 131072\&.
.sp
More recent kernels handle plugging and unplugging implicitly; on those kernels, this parameter has no effect\&. Note that some distributions have backported this feature to older kernel versions\&.
.RE
.PP
\fBuse\-rle\fR
.RS 4
.\" drbd.conf: use-rle
Each replicated device on a cluster node has a separate bitmap for each of its peer devices\&. The bitmaps are used for tracking the differences between the local and peer device: depending on the cluster state, a disk range can be marked as different from the peer in the device\'s bitmap, in the peer device\'s bitmap, or in both bitmaps\&. When two cluster nodes connect, they exchange each other\'s bitmaps, and they each compute the union of the local and peer bitmap to determine the overall differences\&.
.sp
Bitmaps of very large devices are also relatively large, but they usually compress very well using run\-length encoding\&. This can save time and bandwidth for the bitmap transfers\&.
.sp
The
\fBuse\-rle\fR
parameter determines if run\-length encoding should be used\&. It is on by default since DRBD 8\&.4\&.0\&.
.RE
.PP
\fBverify\-alg \fR\fB\fIhash\-algorithm\fR\fR
.RS 4
Online verification (\fBdrbdadm verify\fR) computes and compares checksums of disk blocks (i\&.e\&., hash values) in order to detect if they differ\&. The
\fBverify\-alg\fR
parameter determines which algorithm to use for these checksums\&. It must be set to one of the secure hash algorithms supported by the kernel before online verify can be used; see the shash algorithms listed in /proc/crypto\&.
.sp
We recommend to schedule online verifications regularly during low\-load periods, for example once a month\&. Also see the notes on data integrity below\&.
.RE
.SS "Section on Parameters"
.PP
\fBaddress \fR\fB\fI[address\-family]\fR\fR\fB \fR\fB\fIaddress\fR\fR\fB:\fR\fB\fIport\fR\fR
.RS 4
.\" drbd.conf: address
Defines the address family, address, and port of a connection endpoint\&.
.sp
The address families
\fBipv4\fR,
\fBipv6\fR,
\fBssocks\fR
(Dolphin Interconnect Solutions\' "super sockets"),
\fBsdp\fR
(Infiniband Sockets Direct Protocol), and
\fBsci\fR
are supported (\fBsci\fR
is an alias for
\fBssocks\fR)\&. If no address family is specified,
\fBipv4\fR
is assumed\&. For all address families except
\fBipv6\fR, the address is specified in IPV4 address notation (for example, 1\&.2\&.3\&.4)\&. For
\fBipv6\fR, the address is enclosed in brackets and uses IPv6 address notation (for example,
[fd01:2345:6789:abcd::1])\&. The port is always specified as a decimal number from 1 to 65535\&.
.sp
On each host, the port numbers must be unique for each address; ports cannot be shared\&.
.RE
.PP
\fBnode\-id \fR\fB\fIvalue\fR\fR
.RS 4
.\" drbd.conf: node-id
Defines the unique node identifier for a node in the cluster\&. Node identifiers are used to identify individual nodes in the network protocol, and to assign bitmap slots to nodes in the metadata\&.
.sp
Node identifiers can only be reasssigned in a cluster when the cluster is down\&. It is essential that the node identifiers in the configuration and in the device metadata are changed consistently on all hosts\&. To change the metadata, dump the current state with
\fBdrbdmeta dump\-md\fR, adjust the bitmap slot assignment, and update the metadata with
\fBdrbdmeta restore\-md\fR\&.
.sp
The
\fBnode\-id\fR
parameter exists since DRBD 9\&. Its value ranges from 0 to 16; there is no default\&.
.RE
.SS "Section options Parameters (Resource Options)"
.PP
\fBauto\-promote \fR\fB\fIbool\-value\fR\fR
.RS 4
.\" drbd.conf: auto-promote
A resource must be promoted to primary role before any of its devices can be mounted or opened for writing\&.
.sp
Before DRBD 9, this could only be done explicitly ("drbdadm primary")\&. Since DRBD 9, the
\fBauto\-promote\fR
parameter allows to automatically promote a resource to primary role when one of its devices is mounted or opened for writing\&. As soon as all devices are unmounted or closed with no more remaining users, the role of the resource changes back to secondary\&.
.sp
Automatic promotion only succeeds if the cluster state allows it (that is, if an explicit
\fBdrbdadm primary\fR
command would succeed)\&. Otherwise, mounting or opening the device fails as it already did before DRBD 9: the
\fBmount\fR(2)
system call fails with errno set to EROFS (Read\-only file system); the
\fBopen\fR(2)
system call fails with errno set to EMEDIUMTYPE (wrong medium type)\&.
.sp
Irrespective of the
\fBauto\-promote\fR
parameter, if a device is promoted explicitly (\fBdrbdadm primary\fR), it also needs to be demoted explicitly (\fBdrbdadm secondary\fR)\&.
.sp
The
\fBauto\-promote\fR
parameter is available since DRBD 9\&.0\&.0, and defaults to
\fByes\fR\&.
.RE
.PP
\fBcpu\-mask \fR\fB\fIcpu\-mask\fR\fR
.RS 4
.\" drbd.conf: cpu-mask
Set the cpu affinity mask for DRBD kernel threads\&. The cpu mask is specified as a hexadecimal number\&. The default value is 0, which lets the scheduler decide which kernel threads run on which CPUs\&. CPU numbers in
\fBcpu\-mask\fR
which do not exist in the system are ignored\&.
.RE
.PP
\fBon\-no\-data\-accessible \fR\fB\fIpolicy\fR\fR
.RS 4
Determine how to deal with I/O requests when the requested data is not available locally or remotely (for example, when all disks have failed)\&. The defined policies are:
.PP
\fBio\-error\fR
.RS 4
System calls fail with errno set to EIO\&.
.RE
.PP
\fBsuspend\-io\fR
.RS 4
The resource suspends I/O\&. I/O can be resumed by (re)attaching the lower\-level device, by connecting to a peer which has access to the data, or by forcing DRBD to resume I/O with
\fBdrbdadm resume\-io \fR\fB\fIres\fR\fR\&. When no data is available, forcing I/O to resume will result in the same behavior as the
\fBio\-error\fR
policy\&.
.RE
.sp
This setting is available since DRBD 8\&.3\&.9; the default policy is
\fBio\-error\fR\&.
.RE
.PP
\fBpeer\-ack\-window \fR\fB\fIvalue\fR\fR
.RS 4
.\" drbd.conf: peer-ack-window
On each node and for each device, DRBD maintains a bitmap of the differences between the local and remote data for each peer device\&. For example, in a three\-node setup (nodes A, B, C) each with a single device, every node maintains one bitmap for each of its peers\&.
.sp
When nodes receive write requests, they know how to update the bitmaps for the writing node, but not how to update the bitmaps between themselves\&. In this example, when a write request propagates from node A to B and C, nodes B and C know that they have the same data as node A, but not whether or not they both have the same data\&.
.sp
As a remedy, the writing node occasionally sends peer\-ack packets to its peers which tell them which state they are in relative to each other\&.
.sp
The
\fBpeer\-ack\-window\fR
parameter specifies how much data a primary node may send before sending a peer\-ack packet\&. A low value causes increased network traffic; a high value causes less network traffic but higher memory consumption on secondary nodes and higher resync times between the secondary nodes after primary node failures\&. (Note: peer\-ack packets may be sent due to other reasons as well, e\&.g\&. membership changes or expiry of the
\fBpeer\-ack\-delay\fR
timer\&.)
.sp
The default value for
\fBpeer\-ack\-window\fR
is 2 MiB, the default unit is sectors\&. This option is available since 9\&.0\&.0\&.
.RE
.PP
\fBpeer\-ack\-delay \fR\fB\fIexpiry\-time\fR\fR
.RS 4
.\" drbd.conf: peer-ack-delay
If after the last finished write request no new write request gets issued for
\fIexpiry\-time\fR, then a peer\-ack packet is sent\&. If a new write request is issued before the timer expires, the timer gets reset to
\fIexpiry\-time\fR\&. (Note: peer\-ack packets may be sent due to other reasons as well, e\&.g\&. membership changes or the
\fBpeer\-ack\-window\fR
option\&.)
.sp
This parameter may influence resync behavior on remote nodes\&. Peer nodes need to wait until they receive an peer\-ack for releasing a lock on an AL\-extent\&. Resync operations between peers may need to wait for for these locks\&.
.sp
The default value for
\fBpeer\-ack\-delay\fR
is 100 milliseconds, the default unit is milliseconds\&. This option is available since 9\&.0\&.0\&.
.RE
.SS "Section startup Parameters"
.PP
The parameters in this section define the behavior of DRBD at system startup time, in the DRBD init script\&. They have no effect once the system is up and running\&.
.PP
\fBdegr\-wfc\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
.\" drbd.conf: degr-wfc-timeout
Define how long to wait until all peers are connected in case the cluster consisted of a single node only when the system went down\&. This parameter is usually set to a value smaller than
\fBwfc\-timeout\fR\&. The assumption here is that peers which were unreachable before a reboot are less likely to be be reachable after the reboot, so waiting is less likely to help\&.
.sp
The timeout is specified in seconds\&. The default value is 0, which stands for an infinite timeout\&. Also see the
\fBwfc\-timeout\fR
parameter\&.
.RE
.PP
\fBoutdated\-wfc\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
.\" drbd.conf: outdated-wfc-timeout
Define how long to wait until all peers are connected if all peers were outdated when the system went down\&. This parameter is usually set to a value smaller than
\fBwfc\-timeout\fR\&. The assumption here is that an outdated peer cannot have become primary in the meantime, so we don\'t need to wait for it as long as for a node which was alive before\&.
.sp
The timeout is specified in seconds\&. The default value is 0, which stands for an infinite timeout\&. Also see the
\fBwfc\-timeout\fR
parameter\&.
.RE
.PP
\fBstacked\-timeouts\fR
.RS 4
On stacked devices, the
\fBwfc\-timeout\fR
and
\fBdegr\-wfc\-timeout\fR
parameters in the configuration are usually ignored, and both timeouts are set to twice the
\fBconnect\-int\fR
timeout\&. The
\fBstacked\-timeouts\fR
parameter tells DRBD to use the
\fBwfc\-timeout\fR
and
\fBdegr\-wfc\-timeout\fR
parameters as defined in the configuration, even on stacked devices\&. Only use this parameter if the peer of the stacked resource is usually not available, or will not become primary\&. Incorrect use of this parameter can lead to unexpected split\-brain scenarios\&.
.RE
.PP
\fBwait\-after\-sb\fR
.RS 4
This parameter causes DRBD to continue waiting in the init script even when a split\-brain situation has been detected, and the nodes therefore refuse to connect to each other\&.
.RE
.PP
\fBwfc\-timeout \fR\fB\fItimeout\fR\fR
.RS 4
.\" drbd.conf: wfc-timeout
Define how long the init script waits until all peers are connected\&. This can be useful in combination with a cluster manager which cannot manage DRBD resources: when the cluster manager starts, the DRBD resources will already be up and running\&. With a more capable cluster manager such as Pacemaker, it makes more sense to let the cluster manager control DRBD resources\&. The timeout is specified in seconds\&. The default value is 0, which stands for an infinite timeout\&. Also see the
\fBdegr\-wfc\-timeout\fR
parameter\&.
.RE
.SS "Section volume Parameters"
.PP
\fBdevice /dev/drbd\fR\fB\fIminor\-number\fR\fR
.RS 4
.\" drbd.conf: device
Define the device name and minor number of a replicated block device\&. This is the device that applications are supposed to access; in most cases, the device is not used directly, but as a file system\&. This parameter is required and the standard device naming convention is assumed\&.
.sp
In addition to this device, udev will create
\fB/dev/drbd/by\-res/\fR\fB\fIresource\fR\fR\fB/\fR\fB\fIvolume\fR\fR
and
\fB/dev/drbd/by\-disk/\fR\fB\fIlower\-level\-device\fR\fR
symlinks to the device\&.
.RE
.PP
\fBdisk\fR {[disk] | \fBnone\fR}
.RS 4
.\" drbd.conf: disk
Define the lower\-level block device that DRBD will use for storing the actual data\&. While the replicated drbd device is configured, the lower\-level device must not be used directly\&. Even read\-only access with tools like
\fBdumpe2fs\fR(8)
and similar is not allowed\&. The keyword
\fBnone\fR
specifies that no lower\-level block device is configured; this also overrides inheritance of the lower\-level device\&.
.RE
.PP
\fBmeta\-disk internal\fR,
.br
\fBmeta\-disk \fR\fB\fIdevice\fR\fR,
.br
\fBmeta\-disk \fR\fB\fIdevice\fR\fR\fB [\fR\fB\fIindex\fR\fR\fB]\fR
.RS 4
.\" drbd.conf: meta-disk
Define where the metadata of a replicated block device resides: it can be
\fBinternal\fR, meaning that the lower\-level device contains both the data and the metadata, or on a separate device\&.
.sp
When the
\fIindex\fR
form of this parameter is used, multiple replicated devices can share the same metadata device, each using a separate index\&. Each index occupies 128 MiB of data, which corresponds to a replicated device size of at most 4 TiB with two cluster nodes\&. We recommend not to share metadata devices anymore, and to instead use the lvm volume manager for creating metadata devices as needed\&.
.sp
When the
\fIindex\fR
form of this parameter is not used, the size of the lower\-level device determines the size of the metadata\&. The size needed is 36 KiB + (size of lower\-level device) / 32K * (number of nodes \- 1)\&. If
the metadata device is bigger than that, the extra space is not used\&.
.sp
This parameter is required if a
\fBdisk\fR
other than
\fBnone\fR
is specified, and ignored if
\fBdisk\fR
is set to
\fBnone\fR\&. A
\fBmeta\-disk\fR
parameter without a
\fBdisk\fR
parameter is not allowed\&.
.RE
.SH "NOTES ON DATA INTEGRITY"
.PP
DRBD supports two different mechanisms for data integrity checking: first, the
\fBdata\-integrity\-alg\fR
network parameter allows to add a checksum to the data sent over the network\&. Second, the online verification mechanism (\fBdrbdadm verify\fR
and the
\fBverify\-alg\fR
parameter) allows to check for differences in the on\-disk data\&.
.PP
Both mechanisms can produce false positives if the data is modified during I/O (i\&.e\&., while it is being sent over the network or written to disk)\&. This does not always indicate a problem: for example, some file systems and applications do modify data under I/O for certain operations\&. Swap space can also undergo changes while under I/O\&.
.PP
Network data integrity checking tries to identify data modification during I/O by verifying the checksums on the sender side after sending the data\&. If it detects a mismatch, it logs an error\&. The receiver also logs an error when it detects a mismatch\&. Thus, an error logged only on the receiver side indicates an error on the network, and an error logged on both sides indicates data modification under I/O\&.
.PP
The most recent example of systematic data corruption was identified as a bug in the TCP offloading engine and driver of a certain type of GBit NIC in 2007: the data corruption happened on the DMA transfer from core memory to the card\&. Because the TCP checksum were calculated on the card, the TCP/IP protocol checksums did not reveal this problem\&.
.SH "VERSION"
.sp
This document was revised for version 9\&.0\&.0 of the DRBD distribution\&.
.SH "AUTHOR"
.sp
Written by Philipp Reisner philipp\&.reisner@linbit\&.com and Lars Ellenberg lars\&.ellenberg@linbit\&.com\&.
.SH "REPORTING BUGS"
.sp
Report bugs to drbd\-user@lists\&.linbit\&.com\&.
.SH "COPYRIGHT"
.sp
Copyright 2001\-2012 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\&.
.SH "SEE ALSO"
.PP
\fBdrbd\fR(8),
\fBdrbddisk\fR(8),
\fBdrbdsetup\fR(8),
\fBdrbdadm\fR(8),
\m[blue]\fBDRBD User\'s Guide\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fBDRBD Web Site\fR\m[]\&\s-2\u[3]\d\s+2
.SH "NOTES"
.IP " 1." 4
DRBD User's Guide
.RS 4
\%http://www.drbd.org/users-guide/
.RE
.IP " 2." 4
Online Usage Counter
.RS 4
\%http://usage.drbd.org
.RE
.IP " 3." 4
DRBD Web Site
.RS 4
\%http://www.drbd.org/
.RE
drbd-utils-8.9.6/documentation/v9/xml-usage-to-docbook.xsl 0000644 0001750 0001750 00000001756 12466702073 023422 0 ustar apoikos apoikos
drbdsetup
drbd-utils-8.9.6/documentation/v9/drbdsetup-options.xml 0000644 0001750 0001750 00000201761 12654402323 023131 0 ustar apoikos apoikos drbd.confal-extents DRBD automatically maintains a "hot" or "active" disk area
likely to be written to again soon based on the recent write activity.
The "active" disk area can be written to immediately, while "inactive"
disk areas must be "activated" first, which requires a meta-data write.
We also refer to this active disk area as the "activity log".The activity log saves meta-data writes, but the whole log must be
resynced upon recovery of a failed node. The size of the activity log is
a major factor of how long a resync will take and how fast a replicated
disk will become consistent after a crash.The activity log consists of a number of 4-Megabyte segments; the
al-extents parameter determines how many of
those segments can be active at the same time. The default value for
al-extents is 1237, with a minimum of 7 and a
maximum of 65536.
Note that the effective maximum may be smaller, depending on how
you created the device meta data, see also
drbdmeta8
The effective maximum is 919 * (available on-disk activity-log ring-buffer area/4kB -1),
the default 32kB ring-buffer effects a maximum of 6433 (covers more than 25 GiB of data)
We recommend to keep this well within the amount your backend storage
and replication link are able to resync inside of about 5 minutes.
drbd.confal-updates With this parameter, the activity log can be turned off
entirely (see the parameter). This will speed
up writes because fewer meta-data writes will be necessary, but the
entire device needs to be resynchronized opon recovery of a failed
primary node. The default value for is
.
Dynamically control the resync speed. This mechanism is enabled by
setting the parameter to a positive value.
The goal is to either fill the buffers along the data path with a defined
amount of data if is defined, or to have a
defined delay along the path if is
defined. The maximum bandwidth is limited by the
parameter.The parameter defines how fast drbd
adapts to changes in the resync speed. It should be set to five times
the network round-trip time or more. Common values for
for "normal" data paths range from 4K to
100K. If drbd-proxy is used, it is advised to use
instead of . The
parameter is used if the
parameter is undefined or set to 0. The
parameter should be set to five times the
network round-trip time or more. The option
should be set to either the bandwidth available between the DRBD-hosts and the
machines hosting DRBD-proxy, or to the available disk bandwidth.The default values of these parameters are:
= 20 (in units of 0.1 seconds),
= 0 (in units of sectors),
= 1 (in units of 0.1 seconds),
and = 102400 (in units of KiB/s).Dynamic resync speed control is available since DRBD 8.3.9.A node which is primary and sync-source has to schedule application
I/O requests and resync I/O requests. The
parameter limits how much bandwidth is available for resync I/O; the
remaining bandwidth is used for application I/O.A value of 0 means that there is no
limit on the resync I/O bandwidth. This can slow down application I/O
significantly. Use a value of 1 (1 KiB/s) for the lowest possible resync
rate.The default value of is 4096, in units of
KiB/s.drbd.confdisk-barrierdrbd.confdisk-flushesdrbd.confdisk-drainDRBD has three methods of handling the ordering of dependent write
requests:
Use disk barriers to make sure that requests are written to
disk in the right order. Barriers ensure that all requests
submitted before a barrier make it to the disk before any
requests submitted after the barrier. This is implemented using
'tagged command queuing' on SCSI devices and 'native command
queuing' on SATA devices. Only some devices and device stacks
support this method. The device mapper (LVM) only supports
barriers in some configurations.Note that on systems which do not support
disk barriers, enabling this option can lead to data loss or
corruption. Until DRBD 8.4.1, was
turned on if the I/O stack below DRBD did support barriers.
Kernels since linux-2.6.36 (or 2.6.32 RHEL6) no longer allow to
detect if barriers are supported. Since drbd-8.4.2,
this option is off by default and needs to be enabled explicitly.
Use disk flushes between dependent write requests, also
referred to as 'force unit access' by drive vendors. This forces
all data to disk. This option is enabled by default.
Wait for the request queue to "drain" (that is, wait for
the requests to finish) before submitting a dependent write
request. This method requires that requests are stable on disk
when they finish. Before DRBD 8.0.9, this was the only method
implemented. This option is enabled by default. Do not disable
in production environments.
From these three methods, drbd will use the first that is enabled and
supported by the backing storage device. If all three of these options
are turned off, DRBD will submit write requests without bothering about
dependencies. Depending on the I/O stack, write requests can be
reordered, and they can be submitted in a different order on different
cluster nodes. This can result in data loss or corruption. Therefore,
turning off all three methods of controlling write ordering is strongly
discouraged.
A general guideline for configuring write ordering is to use disk
barriers or disk flushes when using ordinary disks (or an ordinary disk
array) with a volatile write cache. On storage without cache or with a
battery backed write cache, disk draining can be a reasonable
choice.drbd.confdisk-timeoutIf the lower-level device on which a DRBD device stores its data does
not finish an I/O request within the defined
, DRBD treats this as a failure. The
lower-level device is detached, and the device's disk state advances to
Diskless. If DRBD is connected to one or more peers, the failed request
is passed on to one of them.This option is dangerous and may lead to kernel panic!"Aborting" requests, or force-detaching the disk, is intended for
completely blocked/hung local backing devices which do no longer
complete requests at all, not even do error completions. In this
situation, usually a hard-reset and failover is the only way out.By "aborting", basically faking a local error-completion,
we allow for a more graceful swichover by cleanly migrating services.
Still the affected node has to be rebooted "soon".By completing these requests, we allow the upper layers to re-use
the associated data pages.If later the local backing device "recovers", and now DMAs some data
from disk into the original request pages, in the best case it will
just put random data into unused pages; but typically it will corrupt
meanwhile completely unrelated data, causing all sorts of damage.Which means delayed successful completion,
especially for READ requests, is a reason to panic().
We assume that a delayed *error* completion is OK,
though we still will complain noisily about it.The default value of
is 0, which stands for an infinite timeout.
Timeouts are specified in units of 0.1 seconds. This option is available
since DRBD 8.3.12.drbd.conffencing is a preventive measure to avoid
situations where both nodes are primary and disconnected. This is also
known as a split-brain situation. DRBD supports the following fencing
policies:No fencing actions are taken. This is the default policy.If a node becomes a disconnected primary, it tries to fence the peer.
This is done by calling the handler. The
handler is supposed to reach the peer over an alternative communication path
and call '' there.If a node becomes a disconnected primary, it freezes all its IO operations
and calls its fence-peer handler. The fence-peer handler is supposed to reach
the peer over an alternative communication path and call
'' there. In case it cannot
do that, it should stonith the peer. IO is resumed as soon as
the situation is resolved. In case the fence-peer handler fails,
I/O can be resumed manually with ''.drbd.confmd-flushesEnable disk flushes and disk barriers on the meta-data device.
This option is enabled by default. See the
parameter.drbd.confon-io-error Configure how DRBD reacts to I/O errors on a
lower-level device. The following policies are defined:
Change the disk status to Inconsistent, mark the failed
block as inconsistent in the bitmap, and retry the I/O operation
on a remote cluster node.Call the handler (see the
section).Detach the lower-level device and continue in diskless mode.
drbd.confread-balancing
Distribute read requests among cluster nodes as defined by
policy. The supported policies are
(the default),
, ,
, ,
, ,
, ,
and .This option is available since DRBD 8.4.1.drbd.confdiscard-zeroes-if-aligned
There are several aspects to discard/trim/unmap support on linux
block devices. Even if discard is supported in general, it may fail
silently, or may partially ignore discard requests. Devices also
announce whether reading from unmapped blocks returns defined data
(usually zeroes), or undefined data (possibly old data, possibly
garbage).
If on different nodes, DRBD is backed by devices with differing discard
characteristics, discards may lead to data divergence (old data or
garbage left over on one backend, zeroes due to unmapped areas on the
other backend). Online verify would now potentially report tons of
spurious differences. While probably harmless for most use cases
(fstrim on a file system), DRBD cannot have that.
To play safe, we have to disable discard support, if our local backend
(on a Primary) does not support "discard_zeroes_data=true". We also have to
translate discards to explicit zero-out on the receiving side, unless
the receiving side (Secondary) supports "discard_zeroes_data=true",
thereby allocating areas what were supposed to be unmapped.
There are some devices (notably the LVM/DM thin provisioning) that are
capable of discard, but announce discard_zeroes_data=false. In the case of
DM-thin, discards aligned to the chunk size will be unmapped, and
reading from unmapped sectors will return zeroes. However, unaligned
partial head or tail areas of discard requests will be silently ignored.
If we now add a helper to explicitly zero-out these unaligned partial
areas, while passing on the discard of the aligned full chunks, we
effectively achieve discard_zeroes_data=true on such devices.
Setting to
will allow DRBD to use discards, and to announce discard_zeroes_data=true,
even on backends that announce discard_zeroes_data=false.
Setting to
will cause DRBD to always fall-back to zero-out on the receiving side,
and to not even announce discard capabilities on the Primary,
if the respective backend announces discard_zeroes_data=false.
We used to ignore the discard_zeroes_data setting completely. To not
break established and expected behaviour, and suddenly cause fstrim on
thin-provisioned LVs to run out-of-space instead of freeing up space,
the default value is .
This option is available since 8.4.7.
drbd.confrs-discard-granularity
When is set to a non zero, positive
value then DRBD tries to do a resync operation in requests of this size.
In case such a block contains only zero bytes on the sync source node,
the sync target node will issue a discard/trim/unmap command for
the area.The value is constrained by the discard granularity of the backing
block device. In case is not a
multiplier of the discard granularity of the backing block device DRBD
rounds it up. The feature only gets active if the backing block device
reads back zeroes after a discard command. The default value of is 0. This option is available since 8.4.7.
drbd.confresync-after Define that a device should only resynchronize after the
specified other device. By default, no order between devices is
defined, and all devices will resynchronize in parallel. Depending on
the configuration of the lower-level devices, and the available
network and disk bandwidth, this can slow down the overall resync
process. This option can be used to form a chain or tree of
dependencies among devices.drbd.confresync-rate Define how much bandwidth DRBD may use for
resynchronizing. DRBD allows "normal" application I/O even during a
resync. If the resync takes up too much bandwidth, application I/O
can become very slow. This parameter allows to avoid that. Please
note this is option only works when the dynamic resync controller is
disabled.Specify the size of the lower-level device explicitly instead of
determining it automatically. The device size must be determined once
and is remembered for the lifetime of the device. In order to
determine it automatically, all the lower-level devices on all nodes
must be attached, and all nodes must be connected. If the size is
specified explicitly, this is not necessary. The
value is assumed to be in units of sectors (512 bytes) by
default.drbd.confdialog-refresh The DRBD init script can be used to configure and start
DRBD devices, which can involve waiting for other cluster nodes.
While waiting, the init script shows the remaining waiting time. The
defines the number of seconds between
updates of that countdown. The default value is 1; a value of 0 turns
off the countdown.drbd.confdisable-ip-verification
Normally, DRBD verifies that the IP addresses in the configuration
match the host names. Use the
parameter to disable these checks.
drbd.confusage-countA explained on DRBD's
Online Usage Counter web page, DRBD includes a
mechanism for anonymously counting how many installations are using which
versions of DRBD. The results are available on the web page for anyone to
see.This parameter defines if a cluster node participates in the usage
counter; the supported values are ,
, and (ask the user, the
default).We would like to ask users to participate in the online usage
counter as this provides us valuable feedback for steering the
development of DRBD.drbd.confafter-sb-0priDefine how to react if a split-brain scenario is detected and none
of the two nodes is in primary role. (We detect split-brain scenarios
when two nodes connect; split-brain decisions are always between two
nodes.) The defined policies are:No automatic resynchronization; simply disconnect.Resynchronize from the node which became primary first
() or last
(). If both nodes became
primary independently, the
policy is used.If only one of the nodes wrote data since the split brain
situation was detected, resynchronize from this node to the other.
If both nodes wrote data, disconnect.Resynchronize from the node with more modified blocks.Always resynchronize to the named node.drbd.confafter-sb-1priDefine how to react if a split-brain scenario is detected, with one
node in primary role and one node in secondary role. (We detect
split-brain scenarios when two nodes connect, so split-brain decisions
are always among two nodes.) The defined policies are:No automatic resynchronization, simply disconnect.Discard the data on the secondary node if the
algorithm would also discard the
data on the secondary node. Otherwise, disconnect.Always take the decision of the algorithm,
even if it causes an erratic change of the primary's view of the
data. This is only useful if a single-node file system (i.e., not
OCFS2 or GFS) with the flag
is used. This option can cause the primary node to crash, and
should not be used.Discard the data on the secondary node.Always take the decision of the
algorithm. If the decision is to
discard the data on the primary node, call the
handler on the primary
node.drbd.confafter-sb-2priDefine how to react if a split-brain scenario is detected and both
nodes are in primary role. (We detect split-brain scenarios when two
nodes connect, so split-brain decisions are always among two nodes.) The
defined policies are:No automatic resynchronization, simply disconnect.See the policy for
.Call the helper program on one
of the machines unless that machine can demote to secondary. The helper
program is expected to reboot the machine, which brings the node into
a secondary role. Which machine runs the helper program is determined
by the strategy.drbd.confallow-two-primaries The most common way to configure DRBD devices is to allow
only one node to be primary (and thus writable) at a time.In some scenarios it is preferable to allow two nodes to be
primary at once; a mechanism outside of DRBD then must make sure that
writes to the shared, replicated device happen in a coordinated way.
This can be done with a shared-storage cluster file system like OCFS2
and GFS, or with virtual machine images and a virtual machine manager
that can migrate virtual machines between physical machines.The parameter tells DRBD to
allow two nodes to be primary at the same time. Never enable this
option when using a non-distributed file system; otherwise, data
corruption and node crashes will result!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.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.)drbd.confconnect-int As soon as a connection between two nodes is configured
with drbdsetup connect, DRBD
immediately tries to establish the connection. If this fails, DRBD
waits for seconds and then repeats. The
default value of is 10 seconds.drbd.confcram-hmac-alg Configure the hash-based message authentication code
(HMAC) or secure hash algorithm to use for peer authentication. The
kernel supports a number of different algorithms, some of which may be
loadable as kernel modules. See the shash algorithms listed in
/proc/crypto. By default, is unset.
Peer authentication also requires a to
be configured.drbd.confcsums-alg Normally, when two nodes resynchronize, the sync target
requests a piece of out-of-sync data from the sync source, and the sync
source sends the data. With many usage patterns, a significant number of those blocks
will actually be identical.When a algorithm is specified, when
requesting a piece of out-of-sync data, the sync target also sends
along a hash of the data it currently has. The sync source compares
this hash with its own version of the data. It sends the sync target
the new data if the hashes differ, and tells it that the data are the
same otherwise. This reduces the network bandwidth required, at the
cost of higher cpu utilization and possibly increased I/O on the sync
target.The can be set to one of the secure
hash algorithms supported by the kernel; see the shash algorithms
listed in /proc/crypto. By default, is
unset.drbd.confcsums-after-crash-only Enabling this option (and csums-alg, above) makes it possible to
use the checksum based resync only for the first resync after primary crash,
but not for later "network hickups".In most cases, block that are marked as need-to-be-resynced are in fact changed,
so calculating checksums, and both reading and writing the blocks on the resync target
is all effective overhead.The advantage of checksum based resync is mostly after primary crash recovery,
where the recovery marked larger areas (those covered by the activity log)
as need-to-be-resynced, just in case. Introduced in 8.4.5.algdrbd.confdata-integrity-algDRBD normally relies on the data integrity checks built into the
TCP/IP protocol, but if a data integrity algorithm is configured, it will
additionally use this algorithm to make sure that the data received over
the network match what the sender has sent. If a data integrity error is
detected, DRBD will close the network connection and reconnect, which
will trigger a resync.The can be set to one of the
secure hash algorithms supported by the kernel; see the shash algorithms
listed in /proc/crypto. By default, this mechanism is turned off.Because of the CPU overhead involved, we recommend not to use this
option in production environments. Also see the notes on data
integrity below.drbd.confko-count If a secondary node fails to complete a write request in
times the parameter,
it is excluded from the cluster. The primary node then sets the
connection to this secondary node to Standalone.
To disable this feature, you should explicitly set it to 0; defaults may change between versions.
drbd.confmax-buffers Limits the memory usage per DRBD minor device on the receiving side,
or for internal buffers during resync or online-verify.
Unit is PAGE_SIZE, which is 4 KiB on most systems.
The minimum possible setting is hard coded to 32 (=128 KiB).
These buffers are used to hold data blocks while they are written to/read from disk.
To avoid possible distributed deadlocks on congestion, this setting is used
as a throttle threshold rather than a hard limit. Once more than max-buffers
pages are in use, further allocation from this pool is throttled.
You want to increase max-buffers if you cannot saturate the IO backend on the
receiving side.drbd.confmax-epoch-size Define the maximum number of write requests DRBD may issue
before issuing a write barrier. The default value is 2048, with a
minimum of 1 and a maximum of 20000. Setting this parameter to a value
below 10 is likely to decrease performance.By default, DRBD blocks when the TCP send queue is full. This prevents
applications from generating further write requests until more buffer
space becomes available again.When DRBD is used together with DRBD-proxy, it can be better to use
the policy,
which can switch DRBD into ahead/behind mode before the send queue is full.
DRBD then records the differences between itself and the peer in its
bitmap, but it no longer replicates them to the peer. When enough buffer
space becomes available again, the node resynchronizes with the peer and
switches back to normal replication.This has the advantage of not blocking application I/O even when the
queues fill up, and the disadvantage that peer nodes can fall behind much
further. Also, while resynchronizing, peer nodes will become
inconsistent.The available congestion policies are (the
default) and . The
parameter defines how much data is
allowed to be "in flight" in this connection. The default value is 0,
which disables this mechanism of congestion control, with a maximum of
10 GiBytes. The parameter defines
how many bitmap extents may be active before switching into ahead/behind
mode, with the same default and limits as the
parameter. The parameter is
effective only when set to a value smaller than
.Ahead/behind mode is available since DRBD 8.3.10.drbd.confping-int When the TCP/IP connection to a peer is idle for more than
seconds, DRBD will send a keep-alive packet
to make sure that a failed peer or network connection is detected
reasonably soon. The default value is 10 seconds, with a minimum of 1
and a maximum of 120 seconds. The unit is seconds.drbd.confping-timeout Define the timeout for replies to keep-alive packets. If
the peer does not reply within , DRBD will
close and try to reestablish the connection. The default value is 0.5
seconds, with a minimum of 0.1 seconds and a maximum of 3 seconds. The
unit is tenths of a second.drbd.confsocket-check-timeoutIn setups involving a DRBD-proxy and connections that experience a lot of
buffer-bloat it might be necessary to set to an
unusual high value. By default DRBD uses the same value to wait if a newly
established TCP-connection is stable. Since the DRBD-proxy is usually located
in the same data center such a long wait time may hinder DRBD's connect process.In such setups should be set to
at least to the round trip time between DRBD and DRBD-proxy. I.e. in most
cases to 1.The default unit is tenths of a second, the default value is 0 (which causes
DRBD to use the value of instead).
Introduced in 8.4.5.drbd.confprotocolUse the specified protocol on this connection. The supported
protocols are:
Writes to the DRBD device complete as soon as they have
reached the local disk and the TCP/IP send buffer.Writes to the DRBD device complete as soon as they have
reached the local disk, and all peers have acknowledged the
receipt of the write requests.Writes to the DRBD device complete as soon as they have
reached the local and all remote disks.drbd.confrcvbuf-size Configure the size of the TCP/IP receive buffer. A value
of 0 (the default) causes the buffer size to adjust dynamically.
This parameter usually does not need to be set, but it can be set
to a value up to 10 MiB. The default unit is bytes.policydrbd.confrr-conflictThis option helps to solve the cases when the outcome of the resync decision is
incompatible with the current role assignment in the cluster. The
defined policies are:No automatic resynchronization, simply disconnect.Resync to the primary node is allowed, violating the assumption that data on
a block device are stable for one of the nodes. Do not
use this option, it is dangerous.Call the handler on one of the machines. The handler is
expected to reboot the machine, which puts it into secondary role.drbd.confshared-secret Configure the shared secret used for peer authentication.
The secret is a string of up to 64 characters. Peer authentication also
requires the parameter to be set.drbd.confsndbuf-size Configure the size of the TCP/IP send buffer. Since DRBD
8.0.13 / 8.2.7, a value of 0 (the default) causes the buffer size to
adjust dynamically. Values below 32 KiB are harmful to the throughput
on this connection. Large buffer sizes can be useful especially when
protocol A is used over high-latency networks; the maximum value
supported is 10 MiB.drbd.conftcp-corkBy default, DRBD uses the TCP_CORK socket option to prevent the
kernel from sending partial messages; this results in fewer and bigger
packets on the network. Some network stacks can perform worse with this
optimization. On these, the parameter can be
used to turn this optimization off.drbd.conftimeout Define the timeout for replies over the network: if a peer
node does not send an expected reply within the specified ,
it is considered dead and the TCP/IP connection is closed. The timeout
value must be lower than and lower than
. The default is 6 seconds; the value is
specified in tenths of a second.drbd.confunplug-watermarkMainline kernels before version 2.6.39-rc1 use an explicit
plug / unplug mechanism to control when a block device starts processing
queued requests. On those kernels, the
parameter defines how many requests must be queued until a secondary
node starts processing them. Some storage controllers perform best when
is set to the same value as
; others are more efficient with smaller
values. The default value for is 128,
with a minimum of 16 and a maximum of 131072.More recent kernels handle plugging and unplugging implicitly; on
those kernels, this parameter has no effect. Note that some distributions
have backported this feature to older kernel versions.drbd.confuse-rle Each replicated device on a cluster node has a separate
bitmap for each of its peer devices. The bitmaps are used for tracking
the differences between the local and peer device: depending on the
cluster state, a disk range can be marked as different from the peer in
the device's bitmap, in the peer device's bitmap, or in both bitmaps.
When two cluster nodes connect, they exchange each other's bitmaps, and
they each compute the union of the local and peer bitmap to determine
the overall differences.Bitmaps of very large devices are also relatively large, but they
usually compress very well using run-length encoding. This can save
time and bandwidth for the bitmap transfers.The parameter determines if run-length
encoding should be used. It is on by default since DRBD 8.4.0.Online verification (drbdadm
verify) computes and compares checksums of disk blocks
(i.e., hash values) in order to detect if they differ. The
parameter determines which algorithm to use
for these checksums. It must be set to one of the secure hash algorithms
supported by the kernel before online verify can be used; see the shash
algorithms listed in /proc/crypto.We recommend to schedule online verifications regularly during
low-load periods, for example once a month. Also see the notes on data
integrity below.Discard the local data and resynchronize with the peer that has the
most up-to-data data. Use this option to manually recover from a
split-brain situation.Only determine if a connection to the peer can be established and
if a resync is necessary (and in which direction) without actually
establishing the connection or starting the resync. Check the system
log to see what DRBD would do without the
option.drbd.confauto-promoteA resource must be promoted to primary role before any of its devices
can be mounted or opened for writing.Before DRBD 9, this could only be done explicitly ("drbdadm
primary"). Since DRBD 9, the parameter
allows to automatically promote a resource to primary role when one of
its devices is mounted or opened for writing. As soon as all devices are
unmounted or closed with no more remaining users, the role of the
resource changes back to secondary.Automatic promotion only succeeds if the cluster state allows it
(that is, if an explicit drbdadm
primary command would succeed). Otherwise, mounting or
opening the device fails as it already did before DRBD 9: the
mount2
system call fails with errno set to EROFS (Read-only file system); the
open2
system call fails with errno set to EMEDIUMTYPE (wrong medium
type).Irrespective of the parameter, if a
device is promoted explicitly (drbdadm
primary), it also needs to be demoted explicitly (drbdadm secondary).The parameter is available since DRBD
9.0.0, and defaults to yes.drbd.confcpu-mask Set the cpu affinity mask for DRBD kernel threads. The
cpu mask is specified as a hexadecimal number. The default value is 0,
which lets the scheduler decide which kernel threads run on which CPUs.
CPU numbers in which do not exist in the
system are ignored.Determine how to deal with I/O requests when the requested data is
not available locally or remotely (for example, when all disks have
failed). The defined policies are:
System calls fail with errno set to EIO.
The resource suspends I/O. I/O can be resumed by (re)attaching
the lower-level device, by connecting to a peer which has
access to the data, or by forcing DRBD to resume I/O with
drbdadm resume-io
res. When no data is
available, forcing I/O to resume will result in the same
behavior as the policy.
This setting is available since DRBD 8.3.9; the default policy is
. drbd.confpeer-ack-window
On each node and for each device, DRBD maintains a bitmap of the
differences between the local and remote data for each peer device.
For example, in a three-node setup (nodes A, B, C) each with a single
device, every node maintains one bitmap for each of its peers.When nodes receive write requests, they know how to update the
bitmaps for the writing node, but not how to update the bitmaps between
themselves. In this example, when a write request propagates from node
A to B and C, nodes B and C know that they have the same data as node
A, but not whether or not they both have the same data.As a remedy, the writing node occasionally sends peer-ack packets
to its peers which tell them which state they are in relative to each
other.The parameter specifies how much
data a primary node may send before sending a peer-ack packet. A low
value causes increased network traffic; a high value causes less
network traffic but higher memory consumption on secondary nodes and
higher resync times between the secondary nodes after primary node
failures. (Note: peer-ack packets may be sent due to other reasons as
well, e.g. membership changes or expiry of the
timer.)The default value for is 2 MiB,
the default unit is sectors. This option is available since
9.0.0.drbd.confpeer-ack-delay
If after the last finished write request no new write request gets issued for
expiry-time, then a peer-ack packet is sent.
If a new write request is issued before the timer expires, the timer gets reset
to expiry-time. (Note: peer-ack packets may be sent
due to other reasons as well, e.g. membership changes or the
option.)This parameter may influence resync behavior on remote nodes. Peer nodes
need to wait until they receive an peer-ack for releasing a lock on an AL-extent.
Resync operations between peers may need to wait for for these locks.
The default value for is 100 milliseconds,
the default unit is milliseconds. This option is available since
9.0.0.drbd.confdegr-wfc-timeout Define how long to wait until all peers are
connected in case the cluster consisted of a single node only
when the system went down. This parameter is usually set to a
value smaller than . The
assumption here is that peers which were unreachable before a
reboot are less likely to be be reachable after the reboot, so
waiting is less likely to help.The timeout is specified in seconds. The default value is 0,
which stands for an infinite timeout. Also see the
parameter.drbd.confoutdated-wfc-timeout Define how long to wait until all peers are
connected if all peers were outdated when the system went down.
This parameter is usually set to a value smaller than
. The assumption here is that an
outdated peer cannot have become primary in the meantime, so we
don't need to wait for it as long as for a node which was alive
before.The timeout is specified in seconds. The default value is 0,
which stands for an infinite timeout. Also see the
parameter.This parameter causes DRBD to continue waiting in the init
script even when a split-brain situation has been detected, and
the nodes therefore refuse to connect to each other.drbd.confwfc-timeout Define how long the init script waits until all peers are
connected. This can be useful in combination with a cluster manager
which cannot manage DRBD resources: when the cluster manager starts,
the DRBD resources will already be up and running. With a more capable
cluster manager such as Pacemaker, it makes more sense to let the
cluster manager control DRBD resources. The timeout is specified in
seconds. The default value is 0, which stands for an infinite timeout.
Also see the parameter.
drbd-utils-8.9.6/documentation/v9/drbd-overview.xml 0000644 0001750 0001750 00000005373 12466702073 022232 0 ustar apoikos apoikos
drbd-overviewOverview of all configured DRBD resourcesDRBD9.0.024 June 2014drbd-overview8System Administrationdrbd-overviewDescription
drbd-overview offers an overview of the state of all configured DRBD resources.
It provides information about the connection status of each DRBD resource. It
will also use auxiliary information provided by
df1,
lvm8,
xm1 and
virsh1
for DRBD resources used as mounted filesystems, LVM physical volumes, Xen
domain backing disks and libvirt instance disks respectively.
AuthorWritten by Philipp Reisner philipp.reisner@linbit.com
and Lars Ellenberg lars.ellenberg@linbit.com.
Initial man-page contributed by Apollon Oikonomopoulos apoikos@gmail.com.
Reporting BugsReport bugs to drbd-user@lists.linbit.com.
CopyrightCopyright 2008-2014 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.
See Alsodrbd.conf5,
drbdsetup8,
drbdadm8,
DRBD Homepage
drbd-utils-8.9.6/configure 0000755 0001750 0001750 00000434401 12654447466 015442 0 ustar apoikos apoikos #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for DRBD 8.9.6.
#
# Report bugs to .
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir/$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
CONFIG_SHELL=$as_shell as_have_required=yes
if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
break 2
fi
fi
done;;
esac
as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno; then :
$as_echo "$0: This script requires a shell more modern than all"
$as_echo "$0: the shells that I found on your system."
if test x${ZSH_VERSION+set} = xset ; then
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: drbd-dev@lists.linbit.com about your system, including
$0: any error possibly output before this message. Then
$0: install a modern shell, or manually run the script
$0: under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='DRBD'
PACKAGE_TARNAME='drbd'
PACKAGE_VERSION='8.9.6'
PACKAGE_STRING='DRBD 8.9.6'
PACKAGE_BUGREPORT='drbd-dev@lists.linbit.com'
PACKAGE_URL=''
ac_subst_vars='LTLIBOBJS
LIBOBJS
DRBD_CONFIG_DIR
DRBD_LOCK_DIR
DRBD_RUN_DIR
DRBD_LIB_DIR
RPM_REQ_CHKCONFIG_PREUN
RPM_REQ_CHKCONFIG_POST
RPM_REQ_XEN
RPM_REQ_BASH_COMPLETION
RPM_REQ_HEARTBEAT
RPM_REQ_PACEMAKER
RPM_SUBPACKAGE_NOARCH
RPM_BUILDREQ_DEFAULT
RPM_DIST_TAG
UDEV_RULE_SUFFIX
BASH_COMPLETION_SUFFIX
INITDIR
DISTRO
UDEVINFO
UDEVADM
DPKG_BUILDPACKAGE
GIT
TAR
XSLTPROC
RPMBUILD
FLEX
GREP
SED
LN_S
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
initscripttype
udevrulesdir
udevdir
tmpfilesdir
systemdunitdir
PKG_CONFIG
WITH_MANUAL
WITH_BASHCOMPLETION
WITH_RGMANAGER
WITH_HEARTBEAT
WITH_PACEMAKER
WITH_XEN
WITH_UDEV
WITH_84_SUPPORT
WITH_83_SUPPORT
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
with_83support
with_84support
with_udev
with_xen
with_pacemaker
with_heartbeat
with_rgmanager
with_bashcompletion
with_distro
with_initdir
with_noarchsubpkg
enable_spec
with_manual
with_systemdunitdir
with_tmpfilesdir
with_initscripttype
'
ac_precious_vars='build_alias
host_alias
target_alias
PKG_CONFIG
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures DRBD 8.9.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/drbd]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of DRBD 8.9.6:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-spec Rather than creating Makefiles, create an RPM spec
file only
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-83support Do not include support for drbd driver/module <= 8.3
--without-84support Do not include support for drbd driver/module 8.4
--with-udev Enable udev integration
--with-xen Enable Xen integration
--with-pacemaker Enable Pacemaker integration
--with-heartbeat Enable Heartbeat v1 haresources integration scripts
--with-rgmanager Enable Red Hat Cluster Suite integration
--with-bashcompletion Enable programmable bash completion
--with-distro Configure for a specific distribution (supported
values: generic, redhat, suse, debian, gentoo,
slackware; default is to autodetect)
--with-initdir Override directory for init scripts (default is
distribution-specific)
--with-noarchsubpkg Build subpackages that support it for the "noarch"
architecture (makes sense only with --enable-spec,
supported by RPM from 4.6.0 forward)
--without-manual Do not include manual pages
--with-systemdunitdir=DIR
Directory for systemd service files [Auto]
--with-tmpfilesdir=DIR install configuration files for management of
volatile files and directories in DIR
[[PREFIX/lib/tmpfiles.d]]
--with-initscripttype=INIT_SCRIPT_TYPE
Type of init script to install (sysv|systemd|both).
[auto]
Some influential environment variables:
PKG_CONFIG path to pkg-config utility
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to .
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
DRBD configure 8.9.6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by DRBD $as_me 8.9.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
$as_echo "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
echo
$as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
$as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
$as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
$as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
$as_echo "$as_me: caught signal $ac_signal"
$as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
$as_echo "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
# We do not want a PATH search for config.site.
case $CONFIG_SITE in #((
-*) ac_site_file1=./$CONFIG_SITE;;
*/*) ac_site_file1=$CONFIG_SITE;;
*) ac_site_file1=./$CONFIG_SITE;;
esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
else
ac_site_file1=$ac_default_prefix/share/config.site
ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "$prefix" = "NONE"; then
prefix=$ac_default_prefix
fi
exec_prefix=$prefix
prefix="`eval echo ${prefix}`"
exec_prefix="`eval echo ${exec_prefix}`"
bindir="`eval echo ${bindir}`"
sbindir="`eval echo ${sbindir}`"
libexecdir="`eval echo ${libexecdir}`"
datarootdir="`eval echo ${datarootdir}`"
datadir="`eval echo ${datadir}`"
sysconfdir="`eval echo ${sysconfdir}`"
sharedstatedir="`eval echo ${sharedstatedir}`"
localstatedir="`eval echo ${localstatedir}`"
libdir="`eval echo ${libdir}`"
includedir="`eval echo ${includedir}`"
oldincludedir="`eval echo ${oldincludedir}`"
infodir="`eval echo ${infodir}`"
mandir="`eval echo ${mandir}`"
docdir="`eval echo ${docdir}`"
WITH_83_SUPPORT=yes
WITH_84_SUPPORT=yes
WITH_UDEV=yes
WITH_XEN=yes
WITH_PACEMAKER=yes
WITH_HEARTBEAT=yes
WITH_RGMANAGER=no
WITH_BASHCOMPLETION=yes
WITH_NOARCH_SUBPACKAGES=no
WITH_MANUAL=yes
# Check whether --with-83support was given.
if test "${with_83support+set}" = set; then :
withval=$with_83support; WITH_83_SUPPORT=$withval
fi
# Check whether --with-84support was given.
if test "${with_84support+set}" = set; then :
withval=$with_84support; WITH_84_SUPPORT=$withval
fi
# Check whether --with-udev was given.
if test "${with_udev+set}" = set; then :
withval=$with_udev; WITH_UDEV=$withval
fi
# Check whether --with-xen was given.
if test "${with_xen+set}" = set; then :
withval=$with_xen; WITH_XEN=$withval
fi
# Check whether --with-pacemaker was given.
if test "${with_pacemaker+set}" = set; then :
withval=$with_pacemaker; WITH_PACEMAKER=$withval
fi
# Check whether --with-heartbeat was given.
if test "${with_heartbeat+set}" = set; then :
withval=$with_heartbeat; WITH_HEARTBEAT=$withval
fi
# Check whether --with-rgmanager was given.
if test "${with_rgmanager+set}" = set; then :
withval=$with_rgmanager; WITH_RGMANAGER=$withval
fi
# Check whether --with-bashcompletion was given.
if test "${with_bashcompletion+set}" = set; then :
withval=$with_bashcompletion; WITH_BASHCOMPLETION=$withval
fi
# Check whether --with-distro was given.
if test "${with_distro+set}" = set; then :
withval=$with_distro; DISTRO=$withval
fi
# Check whether --with-initdir was given.
if test "${with_initdir+set}" = set; then :
withval=$with_initdir; INITDIR=$withval
fi
# Check whether --with-noarchsubpkg was given.
if test "${with_noarchsubpkg+set}" = set; then :
withval=$with_noarchsubpkg; WITH_NOARCH_SUBPACKAGES=$withval
fi
# Check whether --enable-spec was given.
if test "${enable_spec+set}" = set; then :
enableval=$enable_spec; SPECMODE=$enableval
else
SPECMODE=""
fi
# Check whether --with-manual was given.
if test "${with_manual+set}" = set; then :
withval=$with_manual; WITH_MANUAL=$withval
fi
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
PKG_CONFIG=""
fi
fi
# Check whether --with-systemdunitdir was given.
if test "${with_systemdunitdir+set}" = set; then :
withval=$with_systemdunitdir; WITH_SYSTEMD_UNIT_DIR=$withval
fi
if test x"$with_systemdunitdir" = x || \
test x"$with_systemdunitdir" = xyes ; then
if test x"$PKG_CONFIG" != x; then
systemdunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
fi
if test x"$systemdunitdir" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Could not detect systemd unit directory" >&5
$as_echo "$as_me: Could not detect systemd unit directory" >&6;}
fi
else
systemdunitdir=$with_systemdunitdir
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using systemd unit directory: $systemdunitdir" >&5
$as_echo "Using systemd unit directory: $systemdunitdir" >&6; }
# Check whether --with-tmpfilesdir was given.
if test "${with_tmpfilesdir+set}" = set; then :
withval=$with_tmpfilesdir; tmpfilesdir=$withval
else
tmpfilesdir='${prefix}/lib/tmpfiles.d'
fi
# set default early
default_udevdir=/lib/udev
if test x"$with_udev" = x || \
test x"$with_udev" = xyes ; then
if test x"$PKG_CONFIG" != x; then
udevdir=$($PKG_CONFIG --variable=udevdir udev)
fi
if test x"$udevdir" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Could not detect udev rules directory, using default" >&5
$as_echo "$as_me: Could not detect udev rules directory, using default" >&6;}
udevdir=$default_udevdir
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using udev rules directory: $udevdir" >&5
$as_echo "Using udev rules directory: $udevdir" >&6; }
else
udevdir=$default_udevdir
fi
udevrulesdir=$udevdir/rules.d
# Check whether --with-initscripttype was given.
if test "${with_initscripttype+set}" = set; then :
withval=$with_initscripttype;
fi
case "$with_initscripttype" in
"")
if grep -ql systemd /sbin/init ; then
initscripttype=systemd
else
initscripttype=sysv
fi ;;
sysv|systemd|both)
initscripttype=$with_initscripttype ;;
*)
as_fn_error $? "Illegal value -$with_initscripttype- for option --with-initscripttype" "$LINENO" 5 ;;
esac
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_CC" && break
done
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
# safe: cross compilers may not add the suffix if given an `-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
break;;
* )
break;;
esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
if test -z "$ac_file"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
inside strings and character constants. */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
$as_echo "no, using $LN_S" >&6; }
fi
# Extract the first word of "sed", so it can be a program name with args.
set dummy sed; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_SED+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SED in
[\\/]* | ?:[\\/]*)
ac_cv_path_SED="$SED" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
SED=$ac_cv_path_SED
if test -n "$SED"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5
$as_echo "$SED" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "grep", so it can be a program name with args.
set dummy grep; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GREP in
[\\/]* | ?:[\\/]*)
ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
GREP=$ac_cv_path_GREP
if test -n "$GREP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5
$as_echo "$GREP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_FLEX+:} false; then :
$as_echo_n "(cached) " >&6
else
case $FLEX in
[\\/]* | ?:[\\/]*)
ac_cv_path_FLEX="$FLEX" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
FLEX=$ac_cv_path_FLEX
if test -n "$FLEX"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5
$as_echo "$FLEX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "rpmbuild", so it can be a program name with args.
set dummy rpmbuild; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_RPMBUILD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $RPMBUILD in
[\\/]* | ?:[\\/]*)
ac_cv_path_RPMBUILD="$RPMBUILD" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_RPMBUILD="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
RPMBUILD=$ac_cv_path_RPMBUILD
if test -n "$RPMBUILD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPMBUILD" >&5
$as_echo "$RPMBUILD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "xsltproc", so it can be a program name with args.
set dummy xsltproc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_XSLTPROC+:} false; then :
$as_echo_n "(cached) " >&6
else
case $XSLTPROC in
[\\/]* | ?:[\\/]*)
ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
XSLTPROC=$ac_cv_path_XSLTPROC
if test -n "$XSLTPROC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
$as_echo "$XSLTPROC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "tar", so it can be a program name with args.
set dummy tar; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_TAR+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TAR in
[\\/]* | ?:[\\/]*)
ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
TAR=$ac_cv_path_TAR
if test -n "$TAR"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
$as_echo "$TAR" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "git", so it can be a program name with args.
set dummy git; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GIT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GIT in
[\\/]* | ?:[\\/]*)
ac_cv_path_GIT="$GIT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
GIT=$ac_cv_path_GIT
if test -n "$GIT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5
$as_echo "$GIT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "dpkg-buildpackage", so it can be a program name with args.
set dummy dpkg-buildpackage; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_DPKG_BUILDPACKAGE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $DPKG_BUILDPACKAGE in
[\\/]* | ?:[\\/]*)
ac_cv_path_DPKG_BUILDPACKAGE="$DPKG_BUILDPACKAGE" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_DPKG_BUILDPACKAGE="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
DPKG_BUILDPACKAGE=$ac_cv_path_DPKG_BUILDPACKAGE
if test -n "$DPKG_BUILDPACKAGE"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DPKG_BUILDPACKAGE" >&5
$as_echo "$DPKG_BUILDPACKAGE" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "udevadm", so it can be a program name with args.
set dummy udevadm; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_UDEVADM+:} false; then :
$as_echo_n "(cached) " >&6
else
case $UDEVADM in
[\\/]* | ?:[\\/]*)
ac_cv_path_UDEVADM="$UDEVADM" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /sbin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_UDEVADM="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_UDEVADM" && ac_cv_path_UDEVADM="false"
;;
esac
fi
UDEVADM=$ac_cv_path_UDEVADM
if test -n "$UDEVADM"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UDEVADM" >&5
$as_echo "$UDEVADM" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "udevinfo", so it can be a program name with args.
set dummy udevinfo; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_UDEVINFO+:} false; then :
$as_echo_n "(cached) " >&6
else
case $UDEVINFO in
[\\/]* | ?:[\\/]*)
ac_cv_path_UDEVINFO="$UDEVINFO" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /sbin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_UDEVINFO="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_UDEVINFO" && ac_cv_path_UDEVINFO="false"
;;
esac
fi
UDEVINFO=$ac_cv_path_UDEVINFO
if test -n "$UDEVINFO"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UDEVINFO" >&5
$as_echo "$UDEVINFO" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$CC"; then
as_fn_error $? "Cannot build utils without a C compiler." "$LINENO" 5
fi
if test -z $FLEX; then
as_fn_error $? "Cannot build utils without flex." "$LINENO" 5
fi
if test -z $RPMBUILD; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No rpmbuild found, building RPM packages is disabled." >&5
$as_echo "$as_me: WARNING: No rpmbuild found, building RPM packages is disabled." >&2;}
fi
if test -z $DPKG_BUILDPACKAGE; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No dpkg-buildpackage found, building Debian packages is disabled." >&5
$as_echo "$as_me: WARNING: No dpkg-buildpackage found, building Debian packages is disabled." >&2;}
fi
if test -z $XSLTPROC; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot build man pages without xsltproc. You may safely ignore this warning when building from a tarball." >&5
$as_echo "$as_me: WARNING: Cannot build man pages without xsltproc. You may safely ignore this warning when building from a tarball." >&2;}
XSLTPROC=xsltproc
fi
if test -z $GIT; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot update buildtag without git. You may safely ignore this warning when building from a tarball." >&5
$as_echo "$as_me: WARNING: Cannot update buildtag without git. You may safely ignore this warning when building from a tarball." >&2;}
fi
if test $UDEVADM = false && test $UDEVINFO = false; then
if test "$WITH_UDEV" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: udev support enabled, but neither udevadm nor udevinfo found on this system." >&5
$as_echo "$as_me: WARNING: udev support enabled, but neither udevadm nor udevinfo found on this system." >&2;}
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
static unsigned int dummy = CTRL_CMD_DELMCAST_GRP;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_CTRL_CMD_DELMCAST_GRP 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
BASH_COMPLETION_SUFFIX=""
UDEV_RULE_SUFFIX=""
RPM_DIST_TAG=""
RPM_BUILDREQ_DEFAULT="gcc flex glibc-devel make"
RPM_SUBPACKAGE_NOARCH=""
RPM_REQ_PACEMAKER=""
RPM_REQ_HEARTBEAT=""
RPM_REQ_BASH_COMPLETION=""
RPM_REQ_XEN=""
RPM_REQ_CHKCONFIG_POST=""
RPM_REQ_CHKCONFIG_PREUN=""
if test -z $DISTRO; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/gentoo-release" >&5
$as_echo_n "checking for /etc/gentoo-release... " >&6; }
if ${ac_cv_file__etc_gentoo_release+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/etc/gentoo-release"; then
ac_cv_file__etc_gentoo_release=yes
else
ac_cv_file__etc_gentoo_release=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_gentoo_release" >&5
$as_echo "$ac_cv_file__etc_gentoo_release" >&6; }
if test "x$ac_cv_file__etc_gentoo_release" = xyes; then :
DISTRO="gentoo"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/redhat-release" >&5
$as_echo_n "checking for /etc/redhat-release... " >&6; }
if ${ac_cv_file__etc_redhat_release+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/etc/redhat-release"; then
ac_cv_file__etc_redhat_release=yes
else
ac_cv_file__etc_redhat_release=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_redhat_release" >&5
$as_echo "$ac_cv_file__etc_redhat_release" >&6; }
if test "x$ac_cv_file__etc_redhat_release" = xyes; then :
DISTRO="redhat"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/slackware-version" >&5
$as_echo_n "checking for /etc/slackware-version... " >&6; }
if ${ac_cv_file__etc_slackware_version+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/etc/slackware-version"; then
ac_cv_file__etc_slackware_version=yes
else
ac_cv_file__etc_slackware_version=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_slackware_version" >&5
$as_echo "$ac_cv_file__etc_slackware_version" >&6; }
if test "x$ac_cv_file__etc_slackware_version" = xyes; then :
DISTRO="slackware"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/debian_version" >&5
$as_echo_n "checking for /etc/debian_version... " >&6; }
if ${ac_cv_file__etc_debian_version+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/etc/debian_version"; then
ac_cv_file__etc_debian_version=yes
else
ac_cv_file__etc_debian_version=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_debian_version" >&5
$as_echo "$ac_cv_file__etc_debian_version" >&6; }
if test "x$ac_cv_file__etc_debian_version" = xyes; then :
DISTRO="debian"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/SuSE-release" >&5
$as_echo_n "checking for /etc/SuSE-release... " >&6; }
if ${ac_cv_file__etc_SuSE_release+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/etc/SuSE-release"; then
ac_cv_file__etc_SuSE_release=yes
else
ac_cv_file__etc_SuSE_release=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_SuSE_release" >&5
$as_echo "$ac_cv_file__etc_SuSE_release" >&6; }
if test "x$ac_cv_file__etc_SuSE_release" = xyes; then :
DISTRO="suse"
fi
fi
case "$DISTRO" in
gentoo)
{ $as_echo "$as_me:${as_lineno-$LINENO}: configured for Gentoo." >&5
$as_echo "$as_me: configured for Gentoo." >&6;}
;;
redhat)
test -z $INITDIR && INITDIR="$sysconfdir/rc.d/init.d"
RPM_DIST_TAG="%{?dist}"
RPM_BUILDREQ_DEFAULT="flex"
RPM_REQ_CHKCONFIG_POST="Requires(post): chkconfig"
RPM_REQ_CHKCONFIG_PREUN="Requires(preun): chkconfig"
{ $as_echo "$as_me:${as_lineno-$LINENO}: configured for Red Hat (includes Fedora, RHEL, CentOS)." >&5
$as_echo "$as_me: configured for Red Hat (includes Fedora, RHEL, CentOS)." >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/fedora-release" >&5
$as_echo_n "checking for /etc/fedora-release... " >&6; }
if ${ac_cv_file__etc_fedora_release+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/etc/fedora-release"; then
ac_cv_file__etc_fedora_release=yes
else
ac_cv_file__etc_fedora_release=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_fedora_release" >&5
$as_echo "$ac_cv_file__etc_fedora_release" >&6; }
if test "x$ac_cv_file__etc_fedora_release" = xyes; then :
SUB_DISTRO="fedora"
else
SUB_DISTRO="RHEL"
fi
if test "$SUB_DISTRO" = "fedora"; then
# pacemaker, heartbeat and bash-completion are not available in RHEL
# Xen: Be relaxed on RHEL (hassle free update). Be strict on Fedora
RPM_REQ_PACEMAKER="Requires: pacemaker"
RPM_REQ_HEARTBEAT="Requires: heartbeat"
RPM_REQ_BASH_COMPLETION="Requires: bash-completion"
RPM_REQ_XEN="Requires: xen"
fi
;;
slackware)
test -z $INITDIR && INITDIR="$sysconfdir/rc.d"
{ $as_echo "$as_me:${as_lineno-$LINENO}: configured for Slackware." >&5
$as_echo "$as_me: configured for Slackware." >&6;}
;;
debian)
{ $as_echo "$as_me:${as_lineno-$LINENO}: configured for Debian (includes Ubuntu)." >&5
$as_echo "$as_me: configured for Debian (includes Ubuntu)." >&6;}
;;
suse)
BASH_COMPLETION_SUFFIX=".sh"
# RPM_REQ_CHKCONFIG_POST="" chkconfig is part of aaa_base on suse
# RPM_REQ_CHKCONFIG_PREUN="" chkconfig is part of aaa_base on suse
{ $as_echo "$as_me:${as_lineno-$LINENO}: configured for SUSE (includes openSUSE, SLES)." >&5
$as_echo "$as_me: configured for SUSE (includes openSUSE, SLES)." >&6;}
RPM_REQ_BASH_COMPLETION="Requires: bash"
# The following are disabled for hassle free updates:
# RPM_REQ_XEN="Requires: xen"
# RPM_REQ_PACEMAKER="Requires: pacemaker"
# RPM_REQ_HEARTBEAT="Requires: heartbeat"
# Unfortunately gcc on SLES9 is broken with -O2. Works with -O1
if grep -q 'VERSION = 9' /etc/SuSE-release; then
CFLAGS="-g -O1"
fi
;;
"")
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to determine what distribution we are running on. Distribution-specific features will be disabled." >&5
$as_echo "$as_me: WARNING: Unable to determine what distribution we are running on. Distribution-specific features will be disabled." >&2;}
;;
esac
test -z $INITDIR && INITDIR="$sysconfdir/init.d"
if test "$WITH_UDEV" = "yes"; then
udev_version=`$UDEVADM version 2>/dev/null` || udev_version=`$UDEVINFO -V | cut -d " " -f 3`
if test -z $udev_version || test $udev_version -lt 85; then
UDEV_RULE_SUFFIX=".disabled"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Obsolete or unknown udev version. Installing disabled udev rules." >&5
$as_echo "$as_me: WARNING: Obsolete or unknown udev version. Installing disabled udev rules." >&2;}
fi
fi
if test "$WITH_NOARCH_SUBPACKAGES" = "yes"; then
RPM_SUBPACKAGE_NOARCH="BuildArch: noarch"
fi
DRBD_LIB_DIR=$localstatedir/lib/$PACKAGE_TARNAME
DRBD_RUN_DIR=$localstatedir/run/$PACKAGE_TARNAME
DRBD_LOCK_DIR=$localstatedir/lock
DRBD_CONFIG_DIR=$sysconfdir
cat >>confdefs.h <<_ACEOF
#define DRBD_LIB_DIR "$DRBD_LIB_DIR"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define DRBD_RUN_DIR "$DRBD_RUN_DIR"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define DRBD_LOCK_DIR "$DRBD_LOCK_DIR"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define DRBD_CONFIG_DIR "$DRBD_CONFIG_DIR"
_ACEOF
if test "$WITH_83_SUPPORT" = "yes"; then
$as_echo "#define DRBD_LEGACY_83 1" >>confdefs.h
fi
if test "$WITH_84_SUPPORT" = "yes"; then
$as_echo "#define DRBD_LEGACY_84 1" >>confdefs.h
fi
if test -z $SPECMODE; then
ac_config_files="$ac_config_files Makefile user/shared/Makefile user/v9/Makefile user/v83/Makefile user/v84/Makefile scripts/Makefile documentation/v9/Makefile documentation/v83/Makefile documentation/v84/Makefile scripts/drbd.rules"
ac_config_headers="$ac_config_headers user/shared/config.h"
else
ac_config_files="$ac_config_files drbd.spec"
fi
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by DRBD $as_me 8.9.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
instantiate the configuration header FILE
Configuration files:
$config_files
Configuration headers:
$config_headers
Report bugs to ."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
DRBD config.status 8.9.6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
$as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
$as_echo "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"user/shared/Makefile") CONFIG_FILES="$CONFIG_FILES user/shared/Makefile" ;;
"user/v9/Makefile") CONFIG_FILES="$CONFIG_FILES user/v9/Makefile" ;;
"user/v83/Makefile") CONFIG_FILES="$CONFIG_FILES user/v83/Makefile" ;;
"user/v84/Makefile") CONFIG_FILES="$CONFIG_FILES user/v84/Makefile" ;;
"scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
"documentation/v9/Makefile") CONFIG_FILES="$CONFIG_FILES documentation/v9/Makefile" ;;
"documentation/v83/Makefile") CONFIG_FILES="$CONFIG_FILES documentation/v83/Makefile" ;;
"documentation/v84/Makefile") CONFIG_FILES="$CONFIG_FILES documentation/v84/Makefile" ;;
"scripts/drbd.rules") CONFIG_FILES="$CONFIG_FILES scripts/drbd.rules" ;;
"user/shared/config.h") CONFIG_HEADERS="$CONFIG_HEADERS user/shared/config.h" ;;
"drbd.spec") CONFIG_FILES="$CONFIG_FILES drbd.spec" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.
# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
if test -z "$ac_tt"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any. Preserve backslash
# newline sequences.
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[ ]*#[ ]*define[ ][ ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' >$CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
for (key in D) D_is_set[key] = 1
FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
line = \$ 0
split(line, arg, " ")
if (arg[1] == "#") {
defundef = arg[2]
mac1 = arg[3]
} else {
defundef = substr(arg[1], 2)
mac1 = arg[2]
}
split(mac1, mac2, "(") #)
macro = mac2[1]
prefix = substr(line, 1, index(line, defundef) - 1)
if (D_is_set[macro]) {
# Preserve the white space surrounding the "#".
print prefix "define", macro P[macro] D[macro]
next
} else {
# Replace #undef with comments. This is necessary, for example,
# in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
if (defundef == "undef") {
print "/*", prefix defundef, macro, "*/"
next
}
}
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
$as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`$as_echo "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:H)
#
# CONFIG_HEADER
#
if test x"$ac_file" != x-; then
{
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
drbd-utils-8.9.6/ChangeLog 0000644 0001750 0001750 00000011370 12654447436 015276 0 ustar apoikos apoikos Latest:
------
For even more detail, use "git log" or visit http://git.drbd.org/.
8.9.6
--------
* Call "drbdsetup resize" only as often as necessary on "drbdadm resize"
* Disconnect connection first on single path deletion from connection
* Add unfence-peer handler
* Fix "drbdadm adjust" for proxy configurations
8.9.5
--------
* add support for new disk option 'rs-discard-granularity' (module v8.4.7)
* add support for new disk option 'discard-zeroes-if-aligned' (module v8.4.7)
* add support for v9 "path" commands
* doc improvements/corrections
* improvements to drbd ocf resource agent
and pacemaker "constraint based fencing" (crm-fence-peer.sh)
* drbd-overview improvements
8.9.4
--------
* Add an autoconf switch for building without man pages
* Fix compatibility with the musl C library
* Introduce the concept of paths within a connection to the config file;
add support for paths to drbdadm adjust
* Allow multiple connection-mesh statements within one resource
* Document peer-device-options on the drbd-9.0 man pages
* increase the lower boundary for al-extents from 7 to 67; drbdadm clamps
al-extents to 67 implicitly if you configures something lower than 67
* Document the events2 command on the drbd-8.4 man page
* Fix environment variables for handlers
8.9.3
--------
* Support for the new new-peer, add-path, connect, del-path, disconnect
and del-peer commands of drbd-9.0.0; drbdadm support for the new
commands
* New configuration file directive template-file; with that a dedicated
file for the common section of a resource can be specified
* Rewrite the parser for configure options; reuse the data structures
describing drbdsetup options
* No longer try to set peer-device-options with the connect or attach
commands; Only do it with the up and attach commands
* Fixed issues with stderr messages might go into arbitrary FDs
* Allow recursive includes; drbdadm includes each config file only once
* Fix parsing cut-off proxy sections
* When converting 8.4 to 9.0 meta-data produce meta-data the drbd9
kernel driver will accept
* Obey max-peers for all volumes when creating meta-data
* Do not re-register at usage.drbd.org when the module is not loaded
when drbdadm is invoked
8.9.2
--------
* change systemd unit file: basically just call the init script
* make some previously hardcoded timeouts configurable
* drbdadm: New command peer-device-options
* drbd 9: Move max_buffers to net_conf
* drbd 9: Log errors to syslog if stderr is not available
* init script: fixes for stacked resources
* fix regression corner cases in bitmap size calculation
* allow create-md to initialize peer-max-bio-size to 1M
* drbd 9: make transport selectable
* fix aggregating drbdsetup / drbdmeta exit statii
* some documentation fixes (content and build)
* added direct-connect command
* incompatible drbd-9 metadata format change. use: node_id as index for
peer_md instead of the bitmap_index
* drbdadm/meta/usage_cnt: ensure output is visible
* drbdsetup: fix arguments for all commands expecting a peer_device
* exit codes: redefine E_USAGE to 1 (not 3)
* some build changes
* init script: on start, first try to load the module
* drbdsetup events2: Improve how timestamps are assigned
* udev rules (symlinks in /dev/by-res and by-disk) got fixed
* Fixed upper limit for drbd-8.4 activity log entries
* many fixes to drbdadm adjust and proxy commands for drbd-9
* rhcs_fence: Do not invoke fence agents in parallel, rewrite in bash
* drbdsetup events2 is now also available in drbd-8.4 (backported from drbd-9)
* reorganized the repository have common code for drbd-9, drbd-8.4
and drbd-8.3 only once
* Fix drbd.ocf for resources without volume 0
8.9.1
--------
* add DRBD systemd service
* new configuration options socket-check-timeout and csums-after-crash-only
* update xen block-drbd helper: allow for type "phy"
* update udev rules and move from /etc/ to /lib/
* fix various regressions/fallout from the kernel/userland package split,
re-add scripts drbddisk and drbdupper,
re-add "become-on-primary" feature to init script
* crm-fence-peer.sh: improve detection of "clean down"
* updated fencing scripts stonith_admin-fence-peer.sh and rhcs_fence
* improved "proxy" configuration section parsing
* added manpage for drbd-overview, minor review of man pages
* build: various changes in configure.ac, makefiles, debian/* and spec file
8.9.0
--------
* Initial release of unified drbd-utils
* Supports drbd drivers 8.3, 8.4 and 9.0
* Ships with man page links defaulting to 8.4
* Fixed offline resizing in drbdmeta; A regression that causes
data loss, since meta-data was written with wrong offset.
The regression was introduced with 8.4.3
drbd-utils-8.9.6/autogen.sh 0000755 0001750 0001750 00000000461 12466702073 015514 0 ustar apoikos apoikos #!/bin/sh
# for those that expect an autogen.sh,
# here it is.
aclocal
autoheader
autoconf
echo "
suggested configure parameters:
# prepare for rpmbuild, only generate spec files
./configure --enable-spec
# or prepare for direct build
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
"
drbd-utils-8.9.6/drbd-headers/ 0000755 0001750 0001750 00000000000 12654475367 016052 5 ustar apoikos apoikos drbd-utils-8.9.6/drbd-headers/drbd_protocol.h 0000644 0001750 0001750 00000033466 12650365606 021061 0 ustar apoikos apoikos #ifndef __DRBD_PROTOCOL_H
#define __DRBD_PROTOCOL_H
#ifdef __KERNEL__
#include
#else
#include
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif
enum drbd_packet {
/* receiver (data socket) */
P_DATA = 0x00,
P_DATA_REPLY = 0x01, /* Response to P_DATA_REQUEST */
P_RS_DATA_REPLY = 0x02, /* Response to P_RS_DATA_REQUEST */
P_BARRIER = 0x03,
P_BITMAP = 0x04,
P_BECOME_SYNC_TARGET = 0x05,
P_BECOME_SYNC_SOURCE = 0x06,
P_UNPLUG_REMOTE = 0x07, /* Used at various times to hint the peer */
P_DATA_REQUEST = 0x08, /* Used to ask for a data block */
P_RS_DATA_REQUEST = 0x09, /* Used to ask for a data block for resync */
P_SYNC_PARAM = 0x0a,
P_PROTOCOL = 0x0b,
P_UUIDS = 0x0c,
P_SIZES = 0x0d,
P_STATE = 0x0e,
P_SYNC_UUID = 0x0f,
P_AUTH_CHALLENGE = 0x10,
P_AUTH_RESPONSE = 0x11,
P_STATE_CHG_REQ = 0x12,
/* asender (meta socket */
P_PING = 0x13,
P_PING_ACK = 0x14,
P_RECV_ACK = 0x15, /* Used in protocol B */
P_WRITE_ACK = 0x16, /* Used in protocol C */
P_RS_WRITE_ACK = 0x17, /* Is a P_WRITE_ACK, additionally call set_in_sync(). */
P_SUPERSEDED = 0x18, /* Used in proto C, two-primaries conflict detection */
P_NEG_ACK = 0x19, /* Sent if local disk is unusable */
P_NEG_DREPLY = 0x1a, /* Local disk is broken... */
P_NEG_RS_DREPLY = 0x1b, /* Local disk is broken... */
P_BARRIER_ACK = 0x1c,
P_STATE_CHG_REPLY = 0x1d,
/* "new" commands, no longer fitting into the ordering scheme above */
P_OV_REQUEST = 0x1e, /* data socket */
P_OV_REPLY = 0x1f,
P_OV_RESULT = 0x20, /* meta socket */
P_CSUM_RS_REQUEST = 0x21, /* data socket */
P_RS_IS_IN_SYNC = 0x22, /* meta socket */
P_SYNC_PARAM89 = 0x23, /* data socket, protocol version 89 replacement for P_SYNC_PARAM */
P_COMPRESSED_BITMAP = 0x24, /* compressed or otherwise encoded bitmap transfer */
/* P_CKPT_FENCE_REQ = 0x25, * currently reserved for protocol D */
/* P_CKPT_DISABLE_REQ = 0x26, * currently reserved for protocol D */
P_DELAY_PROBE = 0x27, /* is used on BOTH sockets */
P_OUT_OF_SYNC = 0x28, /* Mark as out of sync (Outrunning), data socket */
P_RS_CANCEL = 0x29, /* meta: Used to cancel RS_DATA_REQUEST packet by SyncSource */
P_CONN_ST_CHG_REQ = 0x2a, /* data sock: state change request */
P_CONN_ST_CHG_REPLY = 0x2b, /* meta sock: state change reply */
P_RETRY_WRITE = 0x2c, /* Protocol C: retry conflicting write request */
P_PROTOCOL_UPDATE = 0x2d, /* data sock: is used in established connections */
P_TWOPC_PREPARE = 0x2e, /* data sock: prepare state change */
P_TWOPC_ABORT = 0x2f, /* data sock: abort state change */
P_DAGTAG = 0x30, /* data sock: set the current dagtag */
/* REQ_DISCARD. We used "discard" in different contexts before,
* which is why I chose TRIM here, to disambiguate. */
P_TRIM = 0x31,
/* Only use these two if both support FF_THIN_RESYNC */
P_RS_THIN_REQ = 0x32, /* Request a block for resync or reply P_RS_DEALLOCATED */
P_RS_DEALLOCATED = 0x33, /* Contains only zeros on sync source node */
/* REQ_WRITE_SAME.
* On a receiving side without REQ_WRITE_SAME,
* we may fall back to an opencoded loop instead. */
P_WSAME = 0x34,
P_PEER_ACK = 0x40, /* meta sock: tell which nodes have acked a request */
P_PEERS_IN_SYNC = 0x41, /* data sock: Mark area as in sync */
P_UUIDS110 = 0x42, /* data socket */
P_PEER_DAGTAG = 0x43, /* data socket, used to trigger reconciliation resync */
P_CURRENT_UUID = 0x44, /* data socket */
P_TWOPC_YES = 0x45, /* meta sock: allow two-phase commit */
P_TWOPC_NO = 0x46, /* meta sock: reject two-phase commit */
P_TWOPC_COMMIT = 0x47, /* data sock: commit state change */
P_TWOPC_RETRY = 0x48, /* meta sock: retry two-phase commit */
P_MAY_IGNORE = 0x100, /* Flag to test if (cmd > P_MAY_IGNORE) ... */
/* special command ids for handshake */
P_INITIAL_META = 0xfff1, /* First Packet on the MetaSock */
P_INITIAL_DATA = 0xfff2, /* First Packet on the Socket */
P_CONNECTION_FEATURES = 0xfffe /* FIXED for the next century! */
};
#ifndef __packed
#define __packed __attribute__((packed))
#endif
/* This is the layout for a packet on the wire.
* The byteorder is the network byte order.
* (except block_id and barrier fields.
* these are pointers to local structs
* and have no relevance for the partner,
* which just echoes them as received.)
*
* NOTE that the payload starts at a long aligned offset,
* regardless of 32 or 64 bit arch!
*/
struct p_header80 {
uint32_t magic;
uint16_t command;
uint16_t length; /* bytes of data after this header */
} __packed;
/* Header for big packets, Used for data packets exceeding 64kB */
struct p_header95 {
uint16_t magic; /* use DRBD_MAGIC_BIG here */
uint16_t command;
uint32_t length;
} __packed;
struct p_header100 {
uint32_t magic;
uint16_t volume;
uint16_t command;
uint32_t length;
uint32_t pad;
} __packed;
/* These defines must not be changed without changing the protocol version.
* New defines may only be introduced together with protocol version bump or
* new protocol feature flags.
*/
#define DP_HARDBARRIER 1 /* no longer used */
#define DP_RW_SYNC 2 /* equals REQ_SYNC */
#define DP_MAY_SET_IN_SYNC 4
#define DP_UNPLUG 8 /* equals REQ_UNPLUG (compat) */
#define DP_FUA 16 /* equals REQ_FUA */
#define DP_FLUSH 32 /* equals REQ_FLUSH */
#define DP_DISCARD 64 /* equals REQ_DISCARD */
#define DP_SEND_RECEIVE_ACK 128 /* This is a proto B write request */
#define DP_SEND_WRITE_ACK 256 /* This is a proto C write request */
#define DP_WSAME 512 /* equiv. REQ_WRITE_SAME */
struct p_data {
uint64_t sector; /* 64 bits sector number */
uint64_t block_id; /* to identify the request in protocol B&C */
uint32_t seq_num;
uint32_t dp_flags;
} __packed;
struct p_trim {
struct p_data p_data;
uint32_t size; /* == bio->bi_size */
} __packed;
struct p_wsame {
struct p_data p_data;
uint32_t size; /* == bio->bi_size */
} __packed;
/*
* commands which share a struct:
* p_block_ack:
* P_RECV_ACK (proto B), P_WRITE_ACK (proto C),
* P_SUPERSEDED (proto C, two-primaries conflict detection)
* p_block_req:
* P_DATA_REQUEST, P_RS_DATA_REQUEST
*/
struct p_block_ack {
uint64_t sector;
uint64_t block_id;
uint32_t blksize;
uint32_t seq_num;
} __packed;
struct p_block_req {
uint64_t sector;
uint64_t block_id;
uint32_t blksize;
uint32_t pad; /* to multiple of 8 Byte */
} __packed;
/*
* commands with their own struct for additional fields:
* P_CONNECTION_FEATURES
* P_BARRIER
* P_BARRIER_ACK
* P_SYNC_PARAM
* ReportParams
*/
/* supports TRIM/DISCARD on the "wire" protocol */
#define DRBD_FF_TRIM 1
/* Detect all-zeros during resync, and rather TRIM/UNMAP/DISCARD those blocks
* instead of fully allocate a supposedly thin volume on initial resync */
#define DRBD_FF_THIN_RESYNC 2
/* supports REQ_WRITE_SAME on the "wire" protocol.
* Note: this flag is overloaded,
* its presence also
* - indicates support for 128 MiB "batch bios",
* max discard size of 128 MiB
* instead of 4M before that.
* - indicates that we exchange additional settings in p_sizes
* drbd_send_sizes()/receive_sizes()
*/
#define DRBD_FF_WSAME 4
struct p_connection_features {
uint32_t protocol_min;
uint32_t feature_flags;
uint32_t protocol_max;
uint32_t sender_node_id;
uint32_t receiver_node_id;
/* should be more than enough for future enhancements
* for now, feature_flags and the reserved array shall be zero.
*/
uint32_t _pad;
uint64_t reserved[6];
} __packed;
struct p_barrier {
uint32_t barrier; /* barrier number _handle_ only */
uint32_t pad; /* to multiple of 8 Byte */
} __packed;
struct p_barrier_ack {
uint32_t barrier;
uint32_t set_size;
} __packed;
struct p_rs_param {
uint32_t resync_rate;
/* Since protocol version 88 and higher. */
char verify_alg[0];
} __packed;
struct p_rs_param_89 {
uint32_t resync_rate;
/* protocol version 89: */
char verify_alg[SHARED_SECRET_MAX];
char csums_alg[SHARED_SECRET_MAX];
} __packed;
struct p_rs_param_95 {
uint32_t resync_rate;
char verify_alg[SHARED_SECRET_MAX];
char csums_alg[SHARED_SECRET_MAX];
uint32_t c_plan_ahead;
uint32_t c_delay_target;
uint32_t c_fill_target;
uint32_t c_max_rate;
} __packed;
enum drbd_conn_flags {
CF_DISCARD_MY_DATA = 1,
CF_DRY_RUN = 2,
};
struct p_protocol {
uint32_t protocol;
uint32_t after_sb_0p;
uint32_t after_sb_1p;
uint32_t after_sb_2p;
uint32_t conn_flags;
uint32_t two_primaries;
/* Since protocol version 87 and higher. */
char integrity_alg[0];
} __packed;
#define UUID_FLAG_DISCARD_MY_DATA 1
#define UUID_FLAG_CRASHED_PRIMARY 2
#define UUID_FLAG_INCONSISTENT 4
#define UUID_FLAG_SKIP_INITIAL_SYNC 8
#define UUID_FLAG_NEW_DATAGEN 16
#define UUID_FLAG_STABLE 32
#define UUID_FLAG_GOT_STABLE 64 /* send UUIDs */
#define UUID_FLAG_RESYNC 128 /* compare UUIDs and eventually start resync */
#define UUID_FLAG_RECONNECT 256
#define UUID_FLAG_DISKLESS_PRIMARY 512 /* Use with UUID_FLAG_RESYNC if a diskless primary is
the reason */
struct p_uuids {
uint64_t current_uuid;
uint64_t bitmap_uuid;
uint64_t history_uuids[HISTORY_UUIDS_V08];
uint64_t dirty_bits;
uint64_t uuid_flags;
} __packed;
struct p_uuids110 {
uint64_t current_uuid;
uint64_t dirty_bits;
uint64_t uuid_flags;
uint64_t node_mask; /* weak_nodes when UUID_FLAG_NEW_DATAGEN is set ;
authoritative nodes when UUID_FLAG_STABLE not set */
uint64_t bitmap_uuids_mask; /* non zero bitmap UUIDS for these nodes */
uint64_t other_uuids[0]; /* the first hweight(bitmap_uuids_mask) slots carry bitmap uuids.
The node with the lowest node_id first.
The remaining slots carry history uuids */
} __packed;
struct p_current_uuid {
uint64_t uuid;
uint64_t weak_nodes;
} __packed;
struct p_uuid {
uint64_t uuid;
} __packed;
/* optional queue_limits if (agreed_features & DRBD_FF_WSAME)
* see also struct queue_limits, as of late 2015 */
struct o_qlim {
/* we don't need it yet, but we may as well communicate it now */
uint32_t physical_block_size;
/* so the original in struct queue_limits is unsigned short,
* but I'd have to put in padding anyways. */
uint32_t logical_block_size;
/* One incoming bio becomes one DRBD request,
* which may be translated to several bio on the receiving side.
* We don't need to communicate chunk/boundary/segment ... limits.
*/
/* various IO hints may be useful with "diskless client" setups */
uint32_t alignment_offset;
uint32_t io_min;
uint32_t io_opt;
/* We may need to communicate integrity stuff at some point,
* but let's not get ahead of ourselves. */
/* Backend discard capabilities.
* Receiving side uses "blkdev_issue_discard()", no need to communicate
* more specifics. If the backend cannot do discards, the DRBD peer
* may fall back to blkdev_issue_zeroout().
*/
uint8_t discard_enabled;
uint8_t discard_zeroes_data;
uint8_t write_same_capable;
uint8_t _pad;
} __packed;
struct p_sizes {
uint64_t d_size; /* size of disk */
uint64_t u_size; /* user requested size */
uint64_t c_size; /* current exported size */
uint32_t max_bio_size; /* Maximal size of a BIO */
uint16_t queue_order_type; /* not yet implemented in DRBD*/
uint16_t dds_flags; /* use enum dds_flags here. */
/* optional queue_limits if (agreed_features & DRBD_FF_WSAME) */
struct o_qlim qlim[0];
} __packed;
struct p_state {
uint32_t state;
} __packed;
struct p_req_state {
uint32_t mask;
uint32_t val;
} __packed;
struct p_req_state_reply {
uint32_t retcode;
} __packed;
struct p_twopc_request {
uint32_t tid; /* transaction identifier */
uint32_t initiator_node_id; /* initiator of the transaction */
uint32_t target_node_id; /* target of the transaction (or -1) */
uint64_t nodes_to_reach;
uint64_t primary_nodes;
uint32_t mask;
uint32_t val;
} __packed;
struct p_twopc_reply {
uint32_t tid; /* transaction identifier */
uint32_t initiator_node_id; /* initiator of the transaction */
uint64_t reachable_nodes;
uint64_t primary_nodes;
uint64_t weak_nodes;
} __packed;
struct p_drbd06_param {
uint64_t size;
uint32_t state;
uint32_t blksize;
uint32_t protocol;
uint32_t version;
uint32_t gen_cnt[5];
uint32_t bit_map_gen[5];
} __packed;
struct p_block_desc {
uint64_t sector;
uint32_t blksize;
uint32_t pad; /* to multiple of 8 Byte */
} __packed;
/* Valid values for the encoding field.
* Bump proto version when changing this. */
enum drbd_bitmap_code {
/* RLE_VLI_Bytes = 0,
* and other bit variants had been defined during
* algorithm evaluation. */
RLE_VLI_Bits = 2,
};
struct p_compressed_bm {
/* (encoding & 0x0f): actual encoding, see enum drbd_bitmap_code
* (encoding & 0x80): polarity (set/unset) of first runlength
* ((encoding >> 4) & 0x07): pad_bits, number of trailing zero bits
* used to pad up to head.length bytes
*/
uint8_t encoding;
uint8_t code[0];
} __packed;
struct p_delay_probe93 {
uint32_t seq_num; /* sequence number to match the two probe packets */
uint32_t offset; /* usecs the probe got sent after the reference time point */
} __packed;
struct p_dagtag {
uint64_t dagtag;
} __packed;
struct p_peer_ack {
uint64_t mask;
uint64_t dagtag;
} __packed;
struct p_peer_block_desc {
uint64_t sector;
uint64_t mask;
uint32_t size;
uint32_t pad; /* to multiple of 8 Byte */
} __packed;
struct p_peer_dagtag {
uint64_t dagtag;
uint32_t node_id;
} __packed;
/*
* Bitmap packets need to fit within a single page on the sender and receiver,
* so we are limited to 4 KiB (and not to PAGE_SIZE, which can be bigger).
*/
#define DRBD_SOCKET_BUFFER_SIZE 4096
#endif /* __DRBD_PROTOCOL_H */
drbd-utils-8.9.6/drbd-headers/drbd_strings.c 0000644 0001750 0001750 00000021407 12654447447 020704 0 ustar apoikos apoikos /*
drbd.h
This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
Copyright (C) 2003-2008, LINBIT Information Technologies GmbH.
Copyright (C) 2003-2008, Philipp Reisner .
Copyright (C) 2003-2008, Lars Ellenberg .
drbd is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
drbd is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with drbd; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include
#include "drbd_strings.h"
#include "drbd_protocol.h"
static const char * const __conn_state_names[] = {
[C_STANDALONE] = "StandAlone",
[C_DISCONNECTING] = "Disconnecting",
[C_UNCONNECTED] = "Unconnected",
[C_TIMEOUT] = "Timeout",
[C_BROKEN_PIPE] = "BrokenPipe",
[C_NETWORK_FAILURE] = "NetworkFailure",
[C_PROTOCOL_ERROR] = "ProtocolError",
[C_TEAR_DOWN] = "TearDown",
[C_CONNECTING] = "Connecting",
[C_CONNECTED] = "Connected",
};
struct state_names drbd_conn_state_names = {
.names = __conn_state_names,
.size = sizeof __conn_state_names / sizeof __conn_state_names[0],
};
static const char * const __repl_state_names[] = {
[L_OFF] = "Off",
[L_ESTABLISHED] = "Established",
[L_STARTING_SYNC_S] = "StartingSyncS",
[L_STARTING_SYNC_T] = "StartingSyncT",
[L_WF_BITMAP_S] = "WFBitMapS",
[L_WF_BITMAP_T] = "WFBitMapT",
[L_WF_SYNC_UUID] = "WFSyncUUID",
[L_SYNC_SOURCE] = "SyncSource",
[L_SYNC_TARGET] = "SyncTarget",
[L_VERIFY_S] = "VerifyS",
[L_VERIFY_T] = "VerifyT",
[L_PAUSED_SYNC_S] = "PausedSyncS",
[L_PAUSED_SYNC_T] = "PausedSyncT",
[L_AHEAD] = "Ahead",
[L_BEHIND] = "Behind",
};
struct state_names drbd_repl_state_names = {
.names = __repl_state_names,
.size = sizeof __repl_state_names / sizeof __repl_state_names[0],
};
static const char * const __role_state_names[] = {
[R_UNKNOWN] = "Unknown",
[R_PRIMARY] = "Primary",
[R_SECONDARY] = "Secondary",
};
struct state_names drbd_role_state_names = {
.names = __role_state_names,
.size = sizeof __role_state_names / sizeof __role_state_names[0],
};
static const char * const __disk_state_names[] = {
[D_DISKLESS] = "Diskless",
[D_ATTACHING] = "Attaching",
[D_DETACHING] = "Detaching",
[D_FAILED] = "Failed",
[D_NEGOTIATING] = "Negotiating",
[D_INCONSISTENT] = "Inconsistent",
[D_OUTDATED] = "Outdated",
[D_UNKNOWN] = "DUnknown",
[D_CONSISTENT] = "Consistent",
[D_UP_TO_DATE] = "UpToDate",
};
struct state_names drbd_disk_state_names = {
.names = __disk_state_names,
.size = sizeof __disk_state_names / sizeof __disk_state_names[0],
};
static const char * const __error_messages[] = {
[-SS_TWO_PRIMARIES] = "Multiple primaries not allowed by config",
[-SS_NO_UP_TO_DATE_DISK] = "Need access to UpToDate data",
[-SS_NO_LOCAL_DISK] = "Can not resync without local disk",
[-SS_NO_REMOTE_DISK] = "Can not resync without remote disk",
[-SS_CONNECTED_OUTDATES] = "Refusing to be Outdated while Connected",
[-SS_PRIMARY_NOP] = "Refusing to be Primary while peer is not outdated",
[-SS_RESYNC_RUNNING] = "Can not start OV/resync since it is already active",
[-SS_ALREADY_STANDALONE] = "Can not disconnect a StandAlone device",
[-SS_CW_FAILED_BY_PEER] = "State change was refused by peer node",
[-SS_IS_DISKLESS] = "Device is diskless, the requested operation requires a disk",
[-SS_DEVICE_IN_USE] = "Device is held open by someone",
[-SS_NO_NET_CONFIG] = "Have no net/connection configuration",
[-SS_NO_VERIFY_ALG] = "Need a verify algorithm to start online verify",
[-SS_NEED_CONNECTION] = "Need a connection to start verify or resync",
[-SS_NOT_SUPPORTED] = "Peer does not support protocol",
[-SS_LOWER_THAN_OUTDATED] = "Disk state is lower than outdated",
[-SS_IN_TRANSIENT_STATE] = "In transient state, retry after next state change",
[-SS_CONCURRENT_ST_CHG] = "Concurrent state changes detected and aborted",
[-SS_O_VOL_PEER_PRI] = "Other vol primary on peer not allowed by config",
[-SS_PRIMARY_READER] = "Peer may not become primary while device is opened read-only",
[-SS_INTERRUPTED] = "Interrupted state change",
[-SS_TIMEOUT] = "Timeout in operation",
[-SS_WEAKLY_CONNECTED] = "Primary nodes must be strongly connected among each other",
};
struct state_names drbd_error_messages = {
.names = __error_messages,
.size = sizeof __error_messages / sizeof __error_messages[0],
};
static const char * const __packet_names[] = {
[P_DATA] = "P_DATA",
[P_WSAME] = "P_WSAME",
[P_TRIM] = "P_TRIM",
[P_DATA_REPLY] = "P_DATA_REPLY",
[P_RS_DATA_REPLY] = "P_RS_DATA_REPLY",
[P_BARRIER] = "P_BARRIER",
[P_BITMAP] = "P_BITMAP",
[P_BECOME_SYNC_TARGET] = "P_BECOME_SYNC_TARGET",
[P_BECOME_SYNC_SOURCE] = "P_BECOME_SYNC_SOURCE",
[P_UNPLUG_REMOTE] = "P_UNPLUG_REMOTE",
[P_DATA_REQUEST] = "P_DATA_REQUEST",
[P_RS_DATA_REQUEST] = "P_RS_DATA_REQUEST",
[P_SYNC_PARAM] = "P_SYNC_PARAM",
[P_SYNC_PARAM89] = "P_SYNC_PARAM89",
[P_PROTOCOL] = "P_PROTOCOL",
[P_UUIDS] = "P_UUIDS",
[P_SIZES] = "P_SIZES",
[P_STATE] = "P_STATE",
[P_SYNC_UUID] = "P_SYNC_UUID",
[P_AUTH_CHALLENGE] = "P_AUTH_CHALLENGE",
[P_AUTH_RESPONSE] = "P_AUTH_RESPONSE",
[P_PING] = "P_PING",
[P_PING_ACK] = "P_PING_ACK",
[P_RECV_ACK] = "P_RECV_ACK",
[P_WRITE_ACK] = "P_WRITE_ACK",
[P_RS_WRITE_ACK] = "P_RS_WRITE_ACK",
[P_SUPERSEDED] = "P_SUPERSEDED",
[P_NEG_ACK] = "P_NEG_ACK",
[P_NEG_DREPLY] = "P_NEG_DREPLY",
[P_NEG_RS_DREPLY] = "P_NEG_RS_DREPLY",
[P_BARRIER_ACK] = "P_BARRIER_ACK",
[P_STATE_CHG_REQ] = "P_STATE_CHG_REQ",
[P_STATE_CHG_REPLY] = "P_STATE_CHG_REPLY",
[P_OV_REQUEST] = "P_OV_REQUEST",
[P_OV_REPLY] = "P_OV_REPLY",
[P_OV_RESULT] = "P_OV_RESULT",
[P_CSUM_RS_REQUEST] = "P_CSUM_RS_REQUEST",
[P_RS_IS_IN_SYNC] = "P_RS_IS_IN_SYNC",
[P_COMPRESSED_BITMAP] = "P_COMPRESSED_BITMAP",
[P_DELAY_PROBE] = "P_DELAY_PROBE",
[P_OUT_OF_SYNC] = "P_OUT_OF_SYNC",
[P_RETRY_WRITE] = "P_RETRY_WRITE",
[P_RS_CANCEL] = "P_RS_CANCEL",
[P_CONN_ST_CHG_REQ] = "P_CONN_ST_CHG_REQ",
[P_CONN_ST_CHG_REPLY] = "P_CONN_ST_CHG_REPLY",
[P_RETRY_WRITE] = "P_RETRY_WRITE",
[P_PROTOCOL_UPDATE] = "P_PROTOCOL_UPDATE",
[P_TWOPC_PREPARE] = "P_TWOPC_PREPARE",
[P_TWOPC_ABORT] = "P_TWOPC_ABORT",
[P_DAGTAG] = "P_DAGTAG",
[P_PEER_ACK] = "P_PEER_ACK",
[P_PEERS_IN_SYNC] = "P_PEERS_IN_SYNC",
[P_UUIDS110] = "P_UUIDS110",
[P_PEER_DAGTAG] = "P_PEER_DAGTAG",
[P_CURRENT_UUID] = "P_CURRENT_UUID",
[P_TWOPC_COMMIT] = "P_TWOPC_COMMIT",
[P_TWOPC_YES] = "P_TWOPC_YES",
[P_TWOPC_NO] = "P_TWOPC_NO",
[P_TWOPC_RETRY] = "P_TWOPC_RETRY",
/* enum drbd_packet, but not commands - obsoleted flags:
* P_MAY_IGNORE
* P_MAX_OPT_CMD
*/
};
struct state_names drbd_packet_names = {
.names = __packet_names,
.size = sizeof __packet_names / sizeof __packet_names[0],
};
const char *drbd_repl_str(enum drbd_repl_state s)
{
return (s < 0 || s >= drbd_repl_state_names.size ||
!drbd_repl_state_names.names[s]) ?
"?" : drbd_repl_state_names.names[s];
}
const char *drbd_conn_str(enum drbd_conn_state s)
{
return (s < 0 || s >= drbd_conn_state_names.size ||
!drbd_conn_state_names.names[s]) ?
"?" : drbd_conn_state_names.names[s];
}
const char *drbd_role_str(enum drbd_role s)
{
return (s < 0 || s >= drbd_role_state_names.size ||
!drbd_role_state_names.names[s]) ?
"?" : drbd_role_state_names.names[s];
}
const char *drbd_disk_str(enum drbd_disk_state s)
{
return (s < 0 || s >= drbd_disk_state_names.size ||
!drbd_disk_state_names.names[s]) ?
"?" : drbd_disk_state_names.names[s];
}
const char *drbd_set_st_err_str(enum drbd_state_rv err)
{
return (-err < 0 || -err >= drbd_error_messages.size ||
!drbd_error_messages.names[-err]) ?
"?" : drbd_error_messages.names[-err];
}
const char *drbd_packet_name(enum drbd_packet cmd)
{
/* too big for the array: 0xfffX */
if (cmd == P_INITIAL_META)
return "InitialMeta";
if (cmd == P_INITIAL_DATA)
return "InitialData";
if (cmd == P_CONNECTION_FEATURES)
return "ConnectionFeatures";
return (cmd < 0 || cmd >= ARRAY_SIZE(__packet_names) ||
!__packet_names[cmd]) ?
"?" : __packet_names[cmd];
}
drbd-utils-8.9.6/drbd-headers/linux/ 0000755 0001750 0001750 00000000000 12654475367 017211 5 ustar apoikos apoikos drbd-utils-8.9.6/drbd-headers/linux/genl_magic_func.h 0000644 0001750 0001750 00000025460 12477341210 022447 0 ustar apoikos apoikos #ifndef GENL_MAGIC_FUNC_H
#define GENL_MAGIC_FUNC_H
#include
/*
* Magic: declare tla policy {{{1
* Magic: declare nested policies
* {{{2
*/
#undef GENL_mc_group
#define GENL_mc_group(group)
#undef GENL_notification
#define GENL_notification(op_name, op_num, mcast_group, tla_list)
#undef GENL_op
#define GENL_op(op_name, op_num, handler, tla_list)
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
[tag_name] = { .type = NLA_NESTED },
static struct nla_policy CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy)[] \
__attribute__((unused)) = {
#include GENL_MAGIC_INCLUDE_FILE
};
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
static struct nla_policy s_name ## _nl_policy[] __read_mostly = \
{ s_fields };
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, _type, __get, \
__put, __is_signed) \
[attr_nr] = { .type = nla_type },
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, _type, maxlen, \
__get, __put, __is_signed) \
[attr_nr] = { .type = nla_type, \
.len = maxlen - (nla_type == NLA_NUL_STRING) },
#include GENL_MAGIC_INCLUDE_FILE
#ifndef __KERNEL__
#ifndef pr_info
#define pr_info(args...) fprintf(stderr, args);
#endif
#endif
#ifdef GENL_MAGIC_DEBUG
static void dprint_field(const char *dir, int nla_type,
const char *name, void *valp)
{
__u64 val = valp ? *(__u32 *)valp : 1;
switch (nla_type) {
case NLA_U8: val = (__u8)val;
case NLA_U16: val = (__u16)val;
case NLA_U32: val = (__u32)val;
pr_info("%s attr %s: %d 0x%08x\n", dir,
name, (int)val, (unsigned)val);
break;
case NLA_U64:
val = *(__u64*)valp;
pr_info("%s attr %s: %lld 0x%08llx\n", dir,
name, (long long)val, (unsigned long long)val);
break;
case NLA_FLAG:
if (val)
pr_info("%s attr %s: set\n", dir, name);
break;
}
}
static void dprint_array(const char *dir, int nla_type,
const char *name, const char *val, unsigned len)
{
switch (nla_type) {
case NLA_NUL_STRING:
if (len && val[len-1] == '\0')
len--;
pr_info("%s attr %s: [len:%u] '%s'\n", dir, name, len, val);
break;
default:
/* we can always show 4 byte,
* thats what nlattr are aligned to. */
pr_info("%s attr %s: [len:%u] %02x%02x%02x%02x ...\n",
dir, name, len, val[0], val[1], val[2], val[3]);
}
}
#define DPRINT_TLA(a, op, b) pr_info("%s %s %s\n", a, op, b);
/* Name is a member field name of the struct s.
* If s is NULL (only parsing, no copy requested in *_from_attrs()),
* nla is supposed to point to the attribute containing the information
* corresponding to that struct member. */
#define DPRINT_FIELD(dir, nla_type, name, s, nla) \
do { \
if (s) \
dprint_field(dir, nla_type, #name, &s->name); \
else if (nla) \
dprint_field(dir, nla_type, #name, \
(nla_type == NLA_FLAG) ? NULL \
: nla_data(nla)); \
} while (0)
#define DPRINT_ARRAY(dir, nla_type, name, s, nla) \
do { \
if (s) \
dprint_array(dir, nla_type, #name, \
s->name, s->name ## _len); \
else if (nla) \
dprint_array(dir, nla_type, #name, \
nla_data(nla), nla_len(nla)); \
} while (0)
#else
#define DPRINT_TLA(a, op, b) do {} while (0)
#define DPRINT_FIELD(dir, nla_type, name, s, nla) do {} while (0)
#define DPRINT_ARRAY(dir, nla_type, name, s, nla) do {} while (0)
#endif
/*
* Magic: provide conversion functions {{{1
* populate struct from attribute table:
* {{{2
*/
/* processing of generic netlink messages is serialized.
* use one static buffer for parsing of nested attributes */
static struct nlattr *nested_attr_tb[128];
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
static int __ ## s_name ## _from_attrs(struct s_name *s, \
struct genl_info *info, bool exclude_invariants) \
{ \
const int maxtype = ARRAY_SIZE(s_name ## _nl_policy)-1; \
struct nlattr *tla = info->attrs[tag_number]; \
struct nlattr **ntb = nested_attr_tb; \
struct nlattr *nla; \
int err; \
BUILD_BUG_ON(ARRAY_SIZE(s_name ## _nl_policy) > ARRAY_SIZE(nested_attr_tb)); \
if (!tla) \
return -ENOMSG; \
DPRINT_TLA(#s_name, "<=-", #tag_name); \
err = drbd_nla_parse_nested(ntb, maxtype, tla, s_name ## _nl_policy); \
if (err) \
return err; \
\
s_fields \
return 0; \
} __attribute__((unused)) \
static int s_name ## _from_attrs(struct s_name *s, \
struct genl_info *info) \
{ \
return __ ## s_name ## _from_attrs(s, info, false); \
} __attribute__((unused)) \
static int s_name ## _from_attrs_for_change(struct s_name *s, \
struct genl_info *info) \
{ \
return __ ## s_name ## _from_attrs(s, info, true); \
} __attribute__((unused)) \
#define __assign(attr_nr, attr_flag, name, nla_type, type, assignment...) \
nla = ntb[attr_nr]; \
if (nla) { \
if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \
pr_info("<< must not change invariant attr: %s\n", #name); \
return -EEXIST; \
} \
assignment; \
} else if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \
/* attribute missing from payload, */ \
/* which was expected */ \
} else if ((attr_flag) & DRBD_F_REQUIRED) { \
pr_info("<< missing attr: %s\n", #name); \
return -ENOMSG; \
}
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put, \
__is_signed) \
__assign(attr_nr, attr_flag, name, nla_type, type, \
if (s) \
s->name = __get(nla); \
DPRINT_FIELD("<<", nla_type, name, s, nla))
/* validate_nla() already checked nla_len <= maxlen appropriately. */
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, \
__get, __put, __is_signed) \
__assign(attr_nr, attr_flag, name, nla_type, type, \
if (s) \
s->name ## _len = \
__get(s->name, nla, maxlen); \
DPRINT_ARRAY("<<", nla_type, name, s, nla))
#include GENL_MAGIC_INCLUDE_FILE
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields)
/*
* Magic: define op number to op name mapping {{{1
* {{{2
*/
static const char *CONCAT_(GENL_MAGIC_FAMILY, _genl_cmd_to_str)(__u8 cmd)
__attribute__ ((unused));
static const char *CONCAT_(GENL_MAGIC_FAMILY, _genl_cmd_to_str)(__u8 cmd)
{
switch (cmd) {
#undef GENL_op
#define GENL_op(op_name, op_num, handler, tla_list) \
case op_num: return #op_name;
#include GENL_MAGIC_INCLUDE_FILE
default:
return "unknown";
}
}
#ifdef __KERNEL__
#include
/*
* Magic: define genl_ops {{{1
* {{{2
*/
#undef GENL_op
#define GENL_op(op_name, op_num, handler, tla_list) \
{ \
handler \
.cmd = op_name, \
.policy = CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy), \
},
#define ZZZ_genl_ops CONCAT_(GENL_MAGIC_FAMILY, _genl_ops)
static struct genl_ops ZZZ_genl_ops[] __read_mostly = {
#include GENL_MAGIC_INCLUDE_FILE
};
#undef GENL_op
#define GENL_op(op_name, op_num, handler, tla_list)
/*
* Define the genl_family, multicast groups, {{{1
* and provide register/unregister functions.
* {{{2
*/
#define ZZZ_genl_family CONCAT_(GENL_MAGIC_FAMILY, _genl_family)
static struct genl_family ZZZ_genl_family __read_mostly = {
.id = GENL_ID_GENERATE,
.name = __stringify(GENL_MAGIC_FAMILY),
.version = GENL_MAGIC_VERSION,
#ifdef GENL_MAGIC_FAMILY_HDRSZ
.hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ),
#endif
.maxattr = ARRAY_SIZE(drbd_tla_nl_policy)-1,
};
/*
* Magic: define multicast groups
* Magic: define multicast group registration helper
*/
/* COMPAT
* See linux 3.13,
* genetlink: make multicast groups const, prevent abuse
* genetlink: pass family to functions using groups
* genetlink: only pass array to genl_register_family_with_ops()
* which are commits c53ed742..2a94fe48
*/
#ifdef genl_register_family_with_ops_groups
#include
#else
#include
#endif
/*
* Magic: provide conversion functions {{{1
* populate skb from struct.
* {{{2
*/
#undef GENL_op
#define GENL_op(op_name, op_num, handler, tla_list)
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
static int s_name ## _to_skb(struct sk_buff *skb, struct s_name *s, \
const bool exclude_sensitive) \
{ \
struct nlattr *tla = nla_nest_start(skb, tag_number); \
if (!tla) \
goto nla_put_failure; \
DPRINT_TLA(#s_name, "-=>", #tag_name); \
s_fields \
nla_nest_end(skb, tla); \
return 0; \
\
nla_put_failure: \
if (tla) \
nla_nest_cancel(skb, tla); \
return -EMSGSIZE; \
} \
static inline int s_name ## _to_priv_skb(struct sk_buff *skb, \
struct s_name *s) \
{ \
return s_name ## _to_skb(skb, s, 0); \
} \
static inline int s_name ## _to_unpriv_skb(struct sk_buff *skb, \
struct s_name *s) \
{ \
return s_name ## _to_skb(skb, s, 1); \
}
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put, \
__is_signed) \
if (!exclude_sensitive || !((attr_flag) & DRBD_F_SENSITIVE)) { \
DPRINT_FIELD(">>", nla_type, name, s, NULL); \
if (__put(skb, attr_nr, s->name)) \
goto nla_put_failure; \
}
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, \
__get, __put, __is_signed) \
if (!exclude_sensitive || !((attr_flag) & DRBD_F_SENSITIVE)) { \
DPRINT_ARRAY(">>",nla_type, name, s, NULL); \
if (__put(skb, attr_nr, min_t(int, maxlen, \
s->name ## _len + (nla_type == NLA_NUL_STRING)),\
s->name)) \
goto nla_put_failure; \
}
#include GENL_MAGIC_INCLUDE_FILE
/* Functions for initializing structs to default values. */
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put, \
__is_signed)
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, \
__get, __put, __is_signed)
#undef __u32_field_def
#define __u32_field_def(attr_nr, attr_flag, name, default) \
x->name = default;
#undef __s32_field_def
#define __s32_field_def(attr_nr, attr_flag, name, default) \
x->name = default;
#undef __flg_field_def
#define __flg_field_def(attr_nr, attr_flag, name, default) \
x->name = default;
#undef __str_field_def
#define __str_field_def(attr_nr, attr_flag, name, maxlen) \
memset(x->name, 0, sizeof(x->name)); \
x->name ## _len = 0;
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
static void set_ ## s_name ## _defaults(struct s_name *x) __attribute__((unused)); \
static void set_ ## s_name ## _defaults(struct s_name *x) { \
s_fields \
}
#include GENL_MAGIC_INCLUDE_FILE
#endif /* __KERNEL__ */
/* }}}1 */
#endif /* GENL_MAGIC_FUNC_H */
/* vim: set foldmethod=marker foldlevel=1 nofoldenable : */
drbd-utils-8.9.6/drbd-headers/linux/drbd_genl.h 0000644 0001750 0001750 00000053330 12634301701 021260 0 ustar apoikos apoikos /*
* General overview:
* full generic netlink message:
* |nlmsghdr|genlmsghdr|
*
* payload:
* |optional fixed size family header|
*
* sequence of netlink attributes:
* I chose to have all "top level" attributes NLA_NESTED,
* corresponding to some real struct.
* So we have a sequence of |tla, len|
*
* nested nla sequence:
* may be empty, or contain a sequence of netlink attributes
* representing the struct fields.
*
* The tag number of any field (regardless of containing struct)
* will be available as T_ ## field_name,
* so you cannot have the same field name in two differnt structs.
*
* The tag numbers themselves are per struct, though,
* so should always begin at 1 (not 0, that is the special "NLA_UNSPEC" type,
* which we won't use here).
* The tag numbers are used as index in the respective nla_policy array.
*
* GENL_struct(tag_name, tag_number, struct name, struct fields) - struct and policy
* genl_magic_struct.h
* generates the struct declaration,
* generates an entry in the tla enum,
* genl_magic_func.h
* generates an entry in the static tla policy
* with .type = NLA_NESTED
* generates the static _nl_policy definition,
* and static conversion functions
*
* genl_magic_func.h
*
* GENL_mc_group(group)
* genl_magic_struct.h
* does nothing
* genl_magic_func.h
* defines and registers the mcast group,
* and provides a send helper
*
* GENL_notification(op_name, op_num, mcast_group, tla list)
* These are notifications to userspace.
*
* genl_magic_struct.h
* generates an entry in the genl_ops enum,
* genl_magic_func.h
* does nothing
*
* mcast group: the name of the mcast group this notification should be
* expected on
* tla list: the list of expected top level attributes,
* for documentation and sanity checking.
*
* GENL_op(op_name, op_num, flags and handler, tla list) - "genl operations"
* These are requests from userspace.
*
* _op and _notification share the same "number space",
* op_nr will be assigned to "genlmsghdr->cmd"
*
* genl_magic_struct.h
* generates an entry in the genl_ops enum,
* genl_magic_func.h
* generates an entry in the static genl_ops array,
* and static register/unregister functions to
* genl_register_family_with_ops().
*
* flags and handler:
* GENL_op_init( .doit = x, .dumpit = y, .flags = something)
* GENL_doit(x) => .dumpit = NULL, .flags = GENL_ADMIN_PERM
* tla list: the list of expected top level attributes,
* for documentation and sanity checking.
*/
/*
* STRUCTS
*/
/* this is sent kernel -> userland on various error conditions, and contains
* informational textual info, which is supposedly human readable.
* The computer relevant return code is in the drbd_genlmsghdr.
*/
GENL_struct(DRBD_NLA_CFG_REPLY, 1, drbd_cfg_reply,
/* "arbitrary" size strings, nla_policy.len = 0 */
__str_field(1, DRBD_GENLA_F_MANDATORY, info_text, 0)
)
/* Configuration requests typically need a context to operate on.
* Possible keys are device minor (fits in the drbd_genlmsghdr),
* the replication link (aka connection) name,
* and/or the replication group (aka resource) name,
* and the volume id within the resource. */
GENL_struct(DRBD_NLA_CFG_CONTEXT, 2, drbd_cfg_context,
__u32_field(6, DRBD_GENLA_F_MANDATORY, ctx_peer_node_id)
__u32_field(1, DRBD_GENLA_F_MANDATORY, ctx_volume)
__str_field(2, DRBD_GENLA_F_MANDATORY, ctx_resource_name, 128)
__bin_field(3, DRBD_GENLA_F_MANDATORY, ctx_my_addr, 128)
__bin_field(4, DRBD_GENLA_F_MANDATORY, ctx_peer_addr, 128)
__str_field_def(5, 0, ctx_conn_name, SHARED_SECRET_MAX)
)
GENL_struct(DRBD_NLA_DISK_CONF, 3, disk_conf,
__str_field(1, DRBD_F_REQUIRED | DRBD_F_INVARIANT, backing_dev, 128)
__str_field(2, DRBD_F_REQUIRED | DRBD_F_INVARIANT, meta_dev, 128)
__s32_field(3, DRBD_F_REQUIRED | DRBD_F_INVARIANT, meta_dev_idx)
/* use the resize command to try and change the disk_size */
__u64_field(4, DRBD_GENLA_F_MANDATORY | DRBD_F_INVARIANT, disk_size)
/*__u32_field(5, DRBD_GENLA_F_MANDATORY | DRBD_F_INVARIANT, max_bio_bvecs)*/
__u32_field_def(6, DRBD_GENLA_F_MANDATORY, on_io_error, DRBD_ON_IO_ERROR_DEF)
/*__u32_field_def(7, DRBD_GENLA_F_MANDATORY, fencing_policy, DRBD_FENCING_DEF)*/
__s32_field_def(9, DRBD_GENLA_F_MANDATORY, resync_after, DRBD_MINOR_NUMBER_DEF)
__u32_field_def(10, DRBD_GENLA_F_MANDATORY, al_extents, DRBD_AL_EXTENTS_DEF)
__flg_field_def(16, DRBD_GENLA_F_MANDATORY, disk_barrier, DRBD_DISK_BARRIER_DEF)
__flg_field_def(17, DRBD_GENLA_F_MANDATORY, disk_flushes, DRBD_DISK_FLUSHES_DEF)
__flg_field_def(18, DRBD_GENLA_F_MANDATORY, disk_drain, DRBD_DISK_DRAIN_DEF)
__flg_field_def(19, DRBD_GENLA_F_MANDATORY, md_flushes, DRBD_MD_FLUSHES_DEF)
__u32_field_def(20, DRBD_GENLA_F_MANDATORY, disk_timeout, DRBD_DISK_TIMEOUT_DEF)
__u32_field_def(21, DRBD_GENLA_F_MANDATORY, read_balancing, DRBD_READ_BALANCING_DEF)
__u32_field_def(22, DRBD_GENLA_F_MANDATORY, unplug_watermark, DRBD_UNPLUG_WATERMARK_DEF)
__u32_field_def(25, 0 /* OPTIONAL */, rs_discard_granularity, DRBD_RS_DISCARD_GRANULARITY_DEF)
__flg_field_def(23, 0 /* OPTIONAL */, al_updates, DRBD_AL_UPDATES_DEF)
__flg_field_def(24, 0 /* OPTIONAL */, discard_zeroes_if_aligned, DRBD_DISCARD_ZEROES_IF_ALIGNED_DEF)
)
GENL_struct(DRBD_NLA_RESOURCE_OPTS, 4, res_opts,
__str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, DRBD_CPU_MASK_SIZE)
__u32_field_def(2, DRBD_GENLA_F_MANDATORY, on_no_data, DRBD_ON_NO_DATA_DEF)
__flg_field_def(3, DRBD_GENLA_F_MANDATORY, auto_promote, DRBD_AUTO_PROMOTE_DEF)
__u32_field(4, DRBD_F_REQUIRED | DRBD_F_INVARIANT, node_id)
__u32_field_def(5, DRBD_GENLA_F_MANDATORY, peer_ack_window, DRBD_PEER_ACK_WINDOW_DEF)
__u32_field_def(6, DRBD_GENLA_F_MANDATORY, twopc_timeout, DRBD_TWOPC_TIMEOUT_DEF)
__u32_field_def(7, DRBD_GENLA_F_MANDATORY, twopc_retry_timeout, DRBD_TWOPC_RETRY_TIMEOUT_DEF)
__u32_field_def(8, 0 /* OPTIONAL */, peer_ack_delay, DRBD_PEER_ACK_DELAY_DEF)
__u32_field_def(9, 0 /* OPTIONAL */, auto_promote_timeout, DRBD_AUTO_PROMOTE_TIMEOUT_DEF)
)
GENL_struct(DRBD_NLA_NET_CONF, 5, net_conf,
__str_field_def(1, DRBD_GENLA_F_MANDATORY | DRBD_F_SENSITIVE,
shared_secret, SHARED_SECRET_MAX)
__str_field_def(2, DRBD_GENLA_F_MANDATORY, cram_hmac_alg, SHARED_SECRET_MAX)
__str_field_def(3, DRBD_GENLA_F_MANDATORY, integrity_alg, SHARED_SECRET_MAX)
__str_field_def(4, DRBD_GENLA_F_MANDATORY, verify_alg, SHARED_SECRET_MAX)
__str_field_def(5, DRBD_GENLA_F_MANDATORY, csums_alg, SHARED_SECRET_MAX)
__u32_field_def(6, DRBD_GENLA_F_MANDATORY, wire_protocol, DRBD_PROTOCOL_DEF)
__u32_field_def(7, DRBD_GENLA_F_MANDATORY, connect_int, DRBD_CONNECT_INT_DEF)
__u32_field_def(8, DRBD_GENLA_F_MANDATORY, timeout, DRBD_TIMEOUT_DEF)
__u32_field_def(9, DRBD_GENLA_F_MANDATORY, ping_int, DRBD_PING_INT_DEF)
__u32_field_def(10, DRBD_GENLA_F_MANDATORY, ping_timeo, DRBD_PING_TIMEO_DEF)
__u32_field_def(11, DRBD_GENLA_F_MANDATORY, sndbuf_size, DRBD_SNDBUF_SIZE_DEF)
__u32_field_def(12, DRBD_GENLA_F_MANDATORY, rcvbuf_size, DRBD_RCVBUF_SIZE_DEF)
__u32_field_def(13, DRBD_GENLA_F_MANDATORY, ko_count, DRBD_KO_COUNT_DEF)
__u32_field_def(15, DRBD_GENLA_F_MANDATORY, max_epoch_size, DRBD_MAX_EPOCH_SIZE_DEF)
__u32_field_def(17, DRBD_GENLA_F_MANDATORY, after_sb_0p, DRBD_AFTER_SB_0P_DEF)
__u32_field_def(18, DRBD_GENLA_F_MANDATORY, after_sb_1p, DRBD_AFTER_SB_1P_DEF)
__u32_field_def(19, DRBD_GENLA_F_MANDATORY, after_sb_2p, DRBD_AFTER_SB_2P_DEF)
__u32_field_def(20, DRBD_GENLA_F_MANDATORY, rr_conflict, DRBD_RR_CONFLICT_DEF)
__u32_field_def(21, DRBD_GENLA_F_MANDATORY, on_congestion, DRBD_ON_CONGESTION_DEF)
__u32_field_def(22, DRBD_GENLA_F_MANDATORY, cong_fill, DRBD_CONG_FILL_DEF)
__u32_field_def(23, DRBD_GENLA_F_MANDATORY, cong_extents, DRBD_CONG_EXTENTS_DEF)
__flg_field_def(24, DRBD_GENLA_F_MANDATORY, two_primaries, DRBD_ALLOW_TWO_PRIMARIES_DEF)
__flg_field_def(26, DRBD_GENLA_F_MANDATORY, tcp_cork, DRBD_TCP_CORK_DEF)
__flg_field_def(27, DRBD_GENLA_F_MANDATORY, always_asbp, DRBD_ALWAYS_ASBP_DEF)
__flg_field_def(29, DRBD_GENLA_F_MANDATORY, use_rle, DRBD_USE_RLE_DEF)
__u32_field_def(30, DRBD_GENLA_F_MANDATORY, fencing_policy, DRBD_FENCING_DEF)
__str_field_def(31, DRBD_GENLA_F_MANDATORY, name, SHARED_SECRET_MAX)
/* moved into ctx_peer_node_id: __u32_field(32, DRBD_F_REQUIRED | DRBD_F_INVARIANT, peer_node_id) */
__flg_field_def(33, 0 /* OPTIONAL */, csums_after_crash_only, DRBD_CSUMS_AFTER_CRASH_ONLY_DEF)
__u32_field_def(34, 0 /* OPTIONAL */, sock_check_timeo, DRBD_SOCKET_CHECK_TIMEO_DEF)
__str_field_def(35, DRBD_F_INVARIANT, transport_name, SHARED_SECRET_MAX)
__u32_field_def(36, 0 /* OPTIONAL */, max_buffers, DRBD_MAX_BUFFERS_DEF)
)
GENL_struct(DRBD_NLA_SET_ROLE_PARMS, 6, set_role_parms,
__flg_field(1, DRBD_GENLA_F_MANDATORY, assume_uptodate)
)
GENL_struct(DRBD_NLA_RESIZE_PARMS, 7, resize_parms,
__u64_field(1, DRBD_GENLA_F_MANDATORY, resize_size)
__flg_field(2, DRBD_GENLA_F_MANDATORY, resize_force)
__flg_field(3, DRBD_GENLA_F_MANDATORY, no_resync)
__u32_field_def(4, 0 /* OPTIONAL */, al_stripes, DRBD_AL_STRIPES_DEF)
__u32_field_def(5, 0 /* OPTIONAL */, al_stripe_size, DRBD_AL_STRIPE_SIZE_DEF)
)
GENL_struct(DRBD_NLA_START_OV_PARMS, 9, start_ov_parms,
__u64_field(1, DRBD_GENLA_F_MANDATORY, ov_start_sector)
__u64_field(2, DRBD_GENLA_F_MANDATORY, ov_stop_sector)
)
GENL_struct(DRBD_NLA_NEW_C_UUID_PARMS, 10, new_c_uuid_parms,
__flg_field(1, DRBD_GENLA_F_MANDATORY, clear_bm)
)
GENL_struct(DRBD_NLA_TIMEOUT_PARMS, 11, timeout_parms,
__u32_field(1, DRBD_F_REQUIRED, timeout_type)
)
GENL_struct(DRBD_NLA_DISCONNECT_PARMS, 12, disconnect_parms,
__flg_field(1, DRBD_GENLA_F_MANDATORY, force_disconnect)
)
GENL_struct(DRBD_NLA_DETACH_PARMS, 13, detach_parms,
__flg_field(1, DRBD_GENLA_F_MANDATORY, force_detach)
)
GENL_struct(DRBD_NLA_DEVICE_CONF, 14, device_conf,
__u32_field_def(1, DRBD_F_INVARIANT, max_bio_size, DRBD_MAX_BIO_SIZE_DEF)
)
GENL_struct(DRBD_NLA_RESOURCE_INFO, 15, resource_info,
__u32_field(1, 0, res_role)
__flg_field(2, 0, res_susp)
__flg_field(3, 0, res_susp_nod)
__flg_field(4, 0, res_susp_fen)
)
GENL_struct(DRBD_NLA_DEVICE_INFO, 16, device_info,
__u32_field(1, 0, dev_disk_state)
)
GENL_struct(DRBD_NLA_CONNECTION_INFO, 17, connection_info,
__u32_field(1, 0, conn_connection_state)
__u32_field(2, 0, conn_role)
)
GENL_struct(DRBD_NLA_PEER_DEVICE_INFO, 18, peer_device_info,
__u32_field(1, 0, peer_repl_state)
__u32_field(2, 0, peer_disk_state)
__u32_field(3, 0, peer_resync_susp_user)
__u32_field(4, 0, peer_resync_susp_peer)
__u32_field(5, 0, peer_resync_susp_dependency)
)
GENL_struct(DRBD_NLA_RESOURCE_STATISTICS, 19, resource_statistics,
__u32_field(1, 0, res_stat_write_ordering)
)
GENL_struct(DRBD_NLA_DEVICE_STATISTICS, 20, device_statistics,
__u64_field(1, 0, dev_size) /* (sectors) */
__u64_field(2, 0, dev_read) /* (sectors) */
__u64_field(3, 0, dev_write) /* (sectors) */
__u64_field(4, 0, dev_al_writes) /* activity log writes (count) */
__u64_field(5, 0, dev_bm_writes) /* bitmap writes (count) */
__u32_field(6, 0, dev_upper_pending) /* application requests in progress */
__u32_field(7, 0, dev_lower_pending) /* backing device requests in progress */
__flg_field(8, 0, dev_upper_blocked)
__flg_field(9, 0, dev_lower_blocked)
__flg_field(10, 0, dev_al_suspended) /* activity log suspended */
__u64_field(11, 0, dev_exposed_data_uuid)
__u64_field(12, 0, dev_current_uuid)
__u32_field(13, 0, dev_disk_flags)
__bin_field(14, 0, history_uuids, HISTORY_UUIDS * sizeof(__u64))
)
GENL_struct(DRBD_NLA_CONNECTION_STATISTICS, 21, connection_statistics,
__flg_field(1, 0, conn_congested)
)
GENL_struct(DRBD_NLA_PEER_DEVICE_STATISTICS, 22, peer_device_statistics,
__u64_field(1, 0, peer_dev_received) /* sectors */
__u64_field(2, 0, peer_dev_sent) /* sectors */
__u32_field(3, 0, peer_dev_pending) /* number of requests */
__u32_field(4, 0, peer_dev_unacked) /* number of requests */
__u64_field(5, 0, peer_dev_out_of_sync) /* sectors */
__u64_field(6, 0, peer_dev_resync_failed) /* sectors */
__u64_field(7, 0, peer_dev_bitmap_uuid)
__u32_field(9, 0, peer_dev_flags)
)
GENL_struct(DRBD_NLA_NOTIFICATION_HEADER, 23, drbd_notification_header,
__u32_field(1, DRBD_GENLA_F_MANDATORY, nh_type)
)
GENL_struct(DRBD_NLA_HELPER, 24, drbd_helper_info,
__str_field(1, DRBD_GENLA_F_MANDATORY, helper_name, 32)
__u32_field(2, DRBD_GENLA_F_MANDATORY, helper_status)
)
GENL_struct(DRBD_NLA_INVALIDATE_PARMS, 25, invalidate_parms,
__s32_field_def(1, DRBD_GENLA_F_MANDATORY, sync_from_peer_node_id, DRBD_SYNC_FROM_NID_DEF)
)
GENL_struct(DRBD_NLA_FORGET_PEER_PARMS, 26, forget_peer_parms,
__s32_field_def(1, DRBD_GENLA_F_MANDATORY, forget_peer_node_id, DRBD_SYNC_FROM_NID_DEF)
)
GENL_struct(DRBD_NLA_PEER_DEVICE_OPTS, 27, peer_device_conf,
__u32_field_def(1, DRBD_GENLA_F_MANDATORY, resync_rate, DRBD_RESYNC_RATE_DEF)
__u32_field_def(2, DRBD_GENLA_F_MANDATORY, c_plan_ahead, DRBD_C_PLAN_AHEAD_DEF)
__u32_field_def(3, DRBD_GENLA_F_MANDATORY, c_delay_target, DRBD_C_DELAY_TARGET_DEF)
__u32_field_def(4, DRBD_GENLA_F_MANDATORY, c_fill_target, DRBD_C_FILL_TARGET_DEF)
__u32_field_def(5, DRBD_GENLA_F_MANDATORY, c_max_rate, DRBD_C_MAX_RATE_DEF)
__u32_field_def(6, DRBD_GENLA_F_MANDATORY, c_min_rate, DRBD_C_MIN_RATE_DEF)
)
GENL_struct(DRBD_NLA_PATH_PARMS, 28, path_parms,
__bin_field(1, DRBD_GENLA_F_MANDATORY, my_addr, 128)
__bin_field(2, DRBD_GENLA_F_MANDATORY, peer_addr, 128)
)
GENL_struct(DRBD_NLA_CONNECT_PARMS, 29, connect_parms,
__flg_field_def(1, DRBD_GENLA_F_MANDATORY, tentative, 0)
__flg_field_def(2, DRBD_GENLA_F_MANDATORY, discard_my_data, 0)
)
GENL_struct(DRBD_NLA_PATH_INFO, 30, drbd_path_info,
__flg_field(1, 0, path_established)
)
/*
* Notifications and commands (genlmsghdr->cmd)
*/
GENL_mc_group(events)
/* add DRBD minor devices as volumes to resources */
GENL_op(DRBD_ADM_NEW_MINOR, 5, GENL_doit(drbd_adm_new_minor),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DEVICE_CONF, DRBD_GENLA_F_MANDATORY))
GENL_op(DRBD_ADM_DEL_MINOR, 6, GENL_doit(drbd_adm_del_minor),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
/* add or delete resources */
GENL_op(DRBD_ADM_NEW_RESOURCE, 7, GENL_doit(drbd_adm_new_resource),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_DEL_RESOURCE, 8, GENL_doit(drbd_adm_del_resource),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_RESOURCE_OPTS, 9,
GENL_doit(drbd_adm_resource_opts),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_RESOURCE_OPTS, DRBD_GENLA_F_MANDATORY)
)
GENL_op(DRBD_ADM_NEW_PEER, 44, GENL_doit(drbd_adm_new_peer),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_NET_CONF, DRBD_GENLA_F_MANDATORY)
)
GENL_op(DRBD_ADM_NEW_PATH, 45, GENL_doit(drbd_adm_new_path),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_PATH_PARMS, DRBD_F_REQUIRED)
)
GENL_op(DRBD_ADM_DEL_PEER, 46, GENL_doit(drbd_adm_del_peer),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DISCONNECT_PARMS, DRBD_GENLA_F_MANDATORY)
)
GENL_op(DRBD_ADM_DEL_PATH, 47, GENL_doit(drbd_adm_del_path),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_PATH_PARMS, DRBD_F_REQUIRED)
)
GENL_op(DRBD_ADM_CONNECT, 10, GENL_doit(drbd_adm_connect),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_CONNECT_PARMS, DRBD_GENLA_F_MANDATORY)
)
GENL_op(
DRBD_ADM_CHG_NET_OPTS, 29,
GENL_doit(drbd_adm_net_opts),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_NET_CONF, DRBD_F_REQUIRED)
)
GENL_op(DRBD_ADM_DISCONNECT, 11, GENL_doit(drbd_adm_disconnect),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DISCONNECT_PARMS, DRBD_GENLA_F_MANDATORY)
)
GENL_op(DRBD_ADM_ATTACH, 12,
GENL_doit(drbd_adm_attach),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DISK_CONF, DRBD_F_REQUIRED)
)
GENL_op(DRBD_ADM_CHG_DISK_OPTS, 28,
GENL_doit(drbd_adm_disk_opts),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DISK_OPTS, DRBD_F_REQUIRED)
)
GENL_op(
DRBD_ADM_RESIZE, 13,
GENL_doit(drbd_adm_resize),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_RESIZE_PARMS, DRBD_GENLA_F_MANDATORY)
)
GENL_op(
DRBD_ADM_PRIMARY, 14,
GENL_doit(drbd_adm_set_role),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_SET_ROLE_PARMS, DRBD_F_REQUIRED)
)
GENL_op(
DRBD_ADM_SECONDARY, 15,
GENL_doit(drbd_adm_set_role),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_SET_ROLE_PARMS, DRBD_F_REQUIRED)
)
GENL_op(
DRBD_ADM_NEW_C_UUID, 16,
GENL_doit(drbd_adm_new_c_uuid),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_NEW_C_UUID_PARMS, DRBD_GENLA_F_MANDATORY)
)
GENL_op(
DRBD_ADM_START_OV, 17,
GENL_doit(drbd_adm_start_ov),
GENL_tla_expected(DRBD_NLA_START_OV_PARMS, DRBD_GENLA_F_MANDATORY)
)
GENL_op(DRBD_ADM_DETACH, 18, GENL_doit(drbd_adm_detach),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DETACH_PARMS, DRBD_GENLA_F_MANDATORY))
GENL_op(DRBD_ADM_INVALIDATE, 19, GENL_doit(drbd_adm_invalidate),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_INVALIDATE_PARMS, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_INVAL_PEER, 20, GENL_doit(drbd_adm_invalidate_peer),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_PAUSE_SYNC, 21, GENL_doit(drbd_adm_pause_sync),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_RESUME_SYNC, 22, GENL_doit(drbd_adm_resume_sync),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_SUSPEND_IO, 23, GENL_doit(drbd_adm_suspend_io),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_RESUME_IO, 24, GENL_doit(drbd_adm_resume_io),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_OUTDATE, 25, GENL_doit(drbd_adm_outdate),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_GET_TIMEOUT_TYPE, 26, GENL_doit(drbd_adm_get_timeout_type),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_DOWN, 27, GENL_doit(drbd_adm_down),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_GET_RESOURCES, 30,
GENL_op_init(
.dumpit = drbd_adm_dump_resources,
),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_RESOURCE_INFO, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_RESOURCE_STATISTICS, DRBD_GENLA_F_MANDATORY))
GENL_op(DRBD_ADM_GET_DEVICES, 31,
GENL_op_init(
.dumpit = drbd_adm_dump_devices,
.done = drbd_adm_dump_devices_done,
),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_DEVICE_INFO, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_DEVICE_STATISTICS, DRBD_GENLA_F_MANDATORY))
GENL_op(DRBD_ADM_GET_CONNECTIONS, 32,
GENL_op_init(
.dumpit = drbd_adm_dump_connections,
.done = drbd_adm_dump_connections_done,
),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_CONNECTION_INFO, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_CONNECTION_STATISTICS, DRBD_GENLA_F_MANDATORY))
GENL_op(DRBD_ADM_GET_PEER_DEVICES, 33,
GENL_op_init(
.dumpit = drbd_adm_dump_peer_devices,
.done = drbd_adm_dump_peer_devices_done,
),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_PEER_DEVICE_INFO, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_PEER_DEVICE_STATISTICS, DRBD_GENLA_F_MANDATORY))
GENL_notification(
DRBD_RESOURCE_STATE, 34, events,
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_RESOURCE_INFO, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_RESOURCE_STATISTICS, DRBD_F_REQUIRED))
GENL_notification(
DRBD_DEVICE_STATE, 35, events,
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DEVICE_INFO, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_DEVICE_STATISTICS, DRBD_F_REQUIRED))
GENL_notification(
DRBD_CONNECTION_STATE, 36, events,
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_PATH_PARMS, DRBD_GENLA_F_MANDATORY)
GENL_tla_expected(DRBD_NLA_CONNECTION_INFO, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_CONNECTION_STATISTICS, DRBD_F_REQUIRED))
GENL_notification(
DRBD_PEER_DEVICE_STATE, 37, events,
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_PEER_DEVICE_INFO, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_PEER_DEVICE_STATISTICS, DRBD_F_REQUIRED))
GENL_op(
DRBD_ADM_GET_INITIAL_STATE, 38,
GENL_op_init(
.dumpit = drbd_adm_get_initial_state,
),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY))
GENL_notification(
DRBD_HELPER, 40, events,
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_HELPER, DRBD_F_REQUIRED))
GENL_notification(
DRBD_INITIAL_STATE_DONE, 41, events,
GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_FORGET_PEER, 42, GENL_doit(drbd_adm_forget_peer),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_FORGET_PEER_PARMS, DRBD_F_REQUIRED))
GENL_op(DRBD_ADM_CHG_PEER_DEVICE_OPTS, 43,
GENL_doit(drbd_adm_peer_device_opts),
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_PEER_DEVICE_OPTS, DRBD_F_REQUIRED))
GENL_notification(
DRBD_PATH_STATE, 48, events,
GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)
GENL_tla_expected(DRBD_NLA_PATH_INFO, DRBD_F_REQUIRED))
drbd-utils-8.9.6/drbd-headers/linux/genl_magic_struct.h 0000644 0001750 0001750 00000016730 12477341210 023040 0 ustar apoikos apoikos #ifndef GENL_MAGIC_STRUCT_H
#define GENL_MAGIC_STRUCT_H
#ifndef GENL_MAGIC_FAMILY
# error "you need to define GENL_MAGIC_FAMILY before inclusion"
#endif
#ifndef GENL_MAGIC_VERSION
# error "you need to define GENL_MAGIC_VERSION before inclusion"
#endif
#ifndef GENL_MAGIC_INCLUDE_FILE
# error "you need to define GENL_MAGIC_INCLUDE_FILE before inclusion"
#endif
#include
#include
#include
#define CONCAT__(a,b) a ## b
#define CONCAT_(a,b) CONCAT__(a,b)
extern int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void);
extern void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void);
/*
* Extension of genl attribute validation policies {{{2
*/
/*
* @DRBD_GENLA_F_MANDATORY: By default, netlink ignores attributes it does not
* know about. This flag can be set in nlattr->nla_type to indicate that this
* attribute must not be ignored.
*
* We check and remove this flag in drbd_nla_check_mandatory() before
* validating the attribute types and lengths via nla_parse_nested().
*/
#define DRBD_GENLA_F_MANDATORY (1 << 14)
/*
* Flags specific to drbd and not visible at the netlink layer, used in
* _from_attrs and _to_skb:
*
* @DRBD_F_REQUIRED: Attribute is required; a request without this attribute is
* invalid.
*
* @DRBD_F_SENSITIVE: Attribute includes sensitive information and must not be
* included in unpriviledged get requests or broadcasts.
*
* @DRBD_F_INVARIANT: Attribute is set when an object is initially created, but
* cannot subsequently be changed.
*/
#define DRBD_F_REQUIRED (1 << 0)
#define DRBD_F_SENSITIVE (1 << 1)
#define DRBD_F_INVARIANT (1 << 2)
#define __nla_type(x) ((__u16)((x) & NLA_TYPE_MASK & ~DRBD_GENLA_F_MANDATORY))
/* }}}1
* MAGIC
* multi-include macro expansion magic starts here
*/
/* MAGIC helpers {{{2 */
/* possible field types */
#define __flg_field(attr_nr, attr_flag, name) \
__field(attr_nr, attr_flag, name, NLA_U8, char, \
nla_get_u8, nla_put_u8, false)
#define __u8_field(attr_nr, attr_flag, name) \
__field(attr_nr, attr_flag, name, NLA_U8, unsigned char, \
nla_get_u8, nla_put_u8, false)
#define __u16_field(attr_nr, attr_flag, name) \
__field(attr_nr, attr_flag, name, NLA_U16, __u16, \
nla_get_u16, nla_put_u16, false)
#define __u32_field(attr_nr, attr_flag, name) \
__field(attr_nr, attr_flag, name, NLA_U32, __u32, \
nla_get_u32, nla_put_u32, false)
#define __s32_field(attr_nr, attr_flag, name) \
__field(attr_nr, attr_flag, name, NLA_U32, __s32, \
nla_get_u32, nla_put_u32, true)
#define __u64_field(attr_nr, attr_flag, name) \
__field(attr_nr, attr_flag, name, NLA_U64, __u64, \
nla_get_u64, nla_put_u64, false)
#define __str_field(attr_nr, attr_flag, name, maxlen) \
__array(attr_nr, attr_flag, name, NLA_NUL_STRING, char, maxlen, \
nla_strlcpy, nla_put, false)
#define __bin_field(attr_nr, attr_flag, name, maxlen) \
__array(attr_nr, attr_flag, name, NLA_BINARY, char, maxlen, \
nla_memcpy, nla_put, false)
/* fields with default values */
#define __flg_field_def(attr_nr, attr_flag, name, default) \
__flg_field(attr_nr, attr_flag, name)
#define __u32_field_def(attr_nr, attr_flag, name, default) \
__u32_field(attr_nr, attr_flag, name)
#define __s32_field_def(attr_nr, attr_flag, name, default) \
__s32_field(attr_nr, attr_flag, name)
#define __str_field_def(attr_nr, attr_flag, name, maxlen) \
__str_field(attr_nr, attr_flag, name, maxlen)
#define GENL_op_init(args...) args
#define GENL_doit(handler) \
.doit = handler, \
.flags = GENL_ADMIN_PERM,
#define GENL_dumpit(handler) \
.dumpit = handler, \
.flags = GENL_ADMIN_PERM,
/* }}}1
* Magic: define the enum symbols for genl_ops
* Magic: define the enum symbols for top level attributes
* Magic: define the enum symbols for nested attributes
* {{{2
*/
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields)
#undef GENL_mc_group
#define GENL_mc_group(group)
#undef GENL_notification
#define GENL_notification(op_name, op_num, mcast_group, tla_list) \
op_name = op_num,
#undef GENL_op
#define GENL_op(op_name, op_num, handler, tla_list) \
op_name = op_num,
enum {
#include GENL_MAGIC_INCLUDE_FILE
};
#undef GENL_notification
#define GENL_notification(op_name, op_num, mcast_group, tla_list)
#undef GENL_op
#define GENL_op(op_name, op_num, handler, attr_list)
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
tag_name = tag_number,
enum {
#include GENL_MAGIC_INCLUDE_FILE
};
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
enum { \
s_fields \
};
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, type, \
__get, __put, __is_signed) \
T_ ## name = (__u16)(attr_nr | ((attr_flag) & DRBD_GENLA_F_MANDATORY)),
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, type, \
maxlen, __get, __put, __is_signed) \
T_ ## name = (__u16)(attr_nr | ((attr_flag) & DRBD_GENLA_F_MANDATORY)),
#include GENL_MAGIC_INCLUDE_FILE
/* }}}1
* Magic: compile time assert unique numbers for operations
* Magic: -"- unique numbers for top level attributes
* Magic: -"- unique numbers for nested attributes
* {{{2
*/
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields)
#undef GENL_op
#define GENL_op(op_name, op_num, handler, attr_list) \
case op_name:
#undef GENL_notification
#define GENL_notification(op_name, op_num, mcast_group, tla_list) \
case op_name:
static inline void ct_assert_unique_operations(void)
{
switch (0) {
#include GENL_MAGIC_INCLUDE_FILE
;
}
}
#undef GENL_op
#define GENL_op(op_name, op_num, handler, attr_list)
#undef GENL_notification
#define GENL_notification(op_name, op_num, mcast_group, tla_list)
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
case tag_number:
static inline void ct_assert_unique_top_level_attributes(void)
{
switch (0) {
#include GENL_MAGIC_INCLUDE_FILE
;
}
}
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
static inline void ct_assert_unique_ ## s_name ## _attributes(void) \
{ \
switch (0) { \
s_fields \
; \
} \
}
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put, \
__is_signed) \
case attr_nr:
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, \
__get, __put, __is_signed) \
case attr_nr:
#include GENL_MAGIC_INCLUDE_FILE
/* }}}1
* Magic: declare structs
* struct {
* fields
* };
* {{{2
*/
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
struct s_name { s_fields };
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put, \
__is_signed) \
type name;
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, \
__get, __put, __is_signed) \
type name[maxlen]; \
__u32 name ## _len;
#include GENL_MAGIC_INCLUDE_FILE
#undef GENL_struct
#define GENL_struct(tag_name, tag_number, s_name, s_fields) \
enum { \
s_fields \
};
#undef __field
#define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put, \
is_signed) \
F_ ## name ## _IS_SIGNED = is_signed,
#undef __array
#define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, \
__get, __put, is_signed) \
F_ ## name ## _IS_SIGNED = is_signed,
#include GENL_MAGIC_INCLUDE_FILE
/* }}}1 */
#endif /* GENL_MAGIC_STRUCT_H */
/* vim: set foldmethod=marker nofoldenable : */
drbd-utils-8.9.6/drbd-headers/linux/drbd.h 0000644 0001750 0001750 00000026345 12654447447 020305 0 ustar apoikos apoikos /*
drbd.h
Kernel module for 2.6.x Kernels
This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
Copyright (C) 2001-2008, LINBIT Information Technologies GmbH.
Copyright (C) 2001-2008, Philipp Reisner .
Copyright (C) 2001-2008, Lars Ellenberg .
drbd is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
drbd is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with drbd; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef DRBD_H
#define DRBD_H
#include
#ifdef __KERNEL__
#include
#include
#else
#include
#include
#include
/* Although the Linux source code makes a difference between
generic endianness and the bitfields' endianness, there is no
architecture as of Linux-2.6.24-rc4 where the bitfields' endianness
does not match the generic endianness. */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __LITTLE_ENDIAN_BITFIELD
#elif __BYTE_ORDER == __BIG_ENDIAN
#define __BIG_ENDIAN_BITFIELD
#else
# error "sorry, weird endianness on this box"
#endif
#endif
enum drbd_io_error_p {
EP_PASS_ON, /* FIXME should the better be named "Ignore"? */
EP_CALL_HELPER,
EP_DETACH
};
enum drbd_fencing_policy {
FP_DONT_CARE = 0,
FP_RESOURCE,
FP_STONITH
};
enum drbd_disconnect_p {
DP_RECONNECT,
DP_DROP_NET_CONF,
DP_FREEZE_IO
};
enum drbd_after_sb_p {
ASB_DISCONNECT,
ASB_DISCARD_YOUNGER_PRI,
ASB_DISCARD_OLDER_PRI,
ASB_DISCARD_ZERO_CHG,
ASB_DISCARD_LEAST_CHG,
ASB_DISCARD_LOCAL,
ASB_DISCARD_REMOTE,
ASB_CONSENSUS,
ASB_DISCARD_SECONDARY,
ASB_CALL_HELPER,
ASB_VIOLENTLY
};
enum drbd_on_no_data {
OND_IO_ERROR,
OND_SUSPEND_IO
};
enum drbd_on_congestion {
OC_BLOCK,
OC_PULL_AHEAD,
OC_DISCONNECT,
};
enum drbd_read_balancing {
RB_PREFER_LOCAL,
RB_PREFER_REMOTE,
RB_ROUND_ROBIN,
RB_LEAST_PENDING,
RB_CONGESTED_REMOTE,
RB_32K_STRIPING,
RB_64K_STRIPING,
RB_128K_STRIPING,
RB_256K_STRIPING,
RB_512K_STRIPING,
RB_1M_STRIPING,
};
/* KEEP the order, do not delete or insert. Only append. */
enum drbd_ret_code {
ERR_CODE_BASE = 100,
NO_ERROR = 101,
ERR_LOCAL_ADDR = 102,
ERR_PEER_ADDR = 103,
ERR_OPEN_DISK = 104,
ERR_OPEN_MD_DISK = 105,
ERR_DISK_NOT_BDEV = 107,
ERR_MD_NOT_BDEV = 108,
ERR_DISK_TOO_SMALL = 111,
ERR_MD_DISK_TOO_SMALL = 112,
ERR_BDCLAIM_DISK = 114,
ERR_BDCLAIM_MD_DISK = 115,
ERR_MD_IDX_INVALID = 116,
ERR_IO_MD_DISK = 118,
ERR_MD_INVALID = 119,
ERR_AUTH_ALG = 120,
ERR_AUTH_ALG_ND = 121,
ERR_NOMEM = 122,
ERR_DISCARD_IMPOSSIBLE = 123,
ERR_DISK_CONFIGURED = 124,
ERR_NET_CONFIGURED = 125,
ERR_MANDATORY_TAG = 126,
ERR_MINOR_INVALID = 127,
ERR_INTR = 129, /* EINTR */
ERR_RESIZE_RESYNC = 130,
ERR_NO_PRIMARY = 131,
ERR_RESYNC_AFTER = 132,
ERR_RESYNC_AFTER_CYCLE = 133,
ERR_PAUSE_IS_SET = 134,
ERR_PAUSE_IS_CLEAR = 135,
ERR_PACKET_NR = 137,
ERR_NO_DISK = 138,
ERR_NOT_PROTO_C = 139,
ERR_NOMEM_BITMAP = 140,
ERR_INTEGRITY_ALG = 141, /* DRBD 8.2 only */
ERR_INTEGRITY_ALG_ND = 142, /* DRBD 8.2 only */
ERR_CPU_MASK_PARSE = 143, /* DRBD 8.2 only */
ERR_CSUMS_ALG = 144, /* DRBD 8.2 only */
ERR_CSUMS_ALG_ND = 145, /* DRBD 8.2 only */
ERR_VERIFY_ALG = 146, /* DRBD 8.2 only */
ERR_VERIFY_ALG_ND = 147, /* DRBD 8.2 only */
ERR_CSUMS_RESYNC_RUNNING= 148, /* DRBD 8.2 only */
ERR_VERIFY_RUNNING = 149, /* DRBD 8.2 only */
ERR_DATA_NOT_CURRENT = 150,
ERR_CONNECTED = 151, /* DRBD 8.3 only */
ERR_PERM = 152,
ERR_NEED_APV_93 = 153,
ERR_STONITH_AND_PROT_A = 154,
ERR_CONG_NOT_PROTO_A = 155,
ERR_PIC_AFTER_DEP = 156,
ERR_PIC_PEER_DEP = 157,
ERR_RES_NOT_KNOWN = 158,
ERR_RES_IN_USE = 159,
ERR_MINOR_CONFIGURED = 160,
ERR_MINOR_OR_VOLUME_EXISTS = 161,
ERR_INVALID_REQUEST = 162,
ERR_NEED_APV_100 = 163,
ERR_NEED_ALLOW_TWO_PRI = 164,
ERR_MD_UNCLEAN = 165,
ERR_MD_LAYOUT_CONNECTED = 166,
ERR_MD_LAYOUT_TOO_BIG = 167,
ERR_MD_LAYOUT_TOO_SMALL = 168,
ERR_MD_LAYOUT_NO_FIT = 169,
ERR_IMPLICIT_SHRINK = 170,
ERR_INVALID_PEER_NODE_ID = 171,
ERR_CREATE_TRANSPORT = 172,
ERR_LOCAL_AND_PEER_ADDR = 173,
/* insert new ones above this line */
AFTER_LAST_ERR_CODE
};
#define DRBD_PROT_A 1
#define DRBD_PROT_B 2
#define DRBD_PROT_C 3
enum drbd_role {
R_UNKNOWN = 0,
R_PRIMARY = 1, /* role */
R_SECONDARY = 2, /* role */
R_MASK = 3,
};
/* The order of these constants is important.
* The lower ones (< C_CONNECTED) indicate
* that there is no socket!
* >= C_CONNECTED ==> There is a socket
*/
enum drbd_conn_state {
C_STANDALONE,
C_DISCONNECTING, /* Temporary state on the way to C_STANDALONE. */
C_UNCONNECTED, /* >= C_UNCONNECTED -> inc_net() succeeds */
/* These temporary states are used on the way
* from C_CONNECTED to C_UNCONNECTED.
* The 'disconnect reason' states
* I do not allow to change between them. */
C_TIMEOUT,
C_BROKEN_PIPE,
C_NETWORK_FAILURE,
C_PROTOCOL_ERROR,
C_TEAR_DOWN,
C_CONNECTING,
C_CONNECTED, /* we have a socket */
C_MASK = 31,
};
enum drbd_repl_state {
L_NEGOTIATING = C_CONNECTED, /* used for peer_device->negotiation_result only */
L_OFF = C_CONNECTED,
L_ESTABLISHED, /* we have introduced each other */
L_STARTING_SYNC_S, /* starting full sync by admin request. */
L_STARTING_SYNC_T, /* starting full sync by admin request. */
L_WF_BITMAP_S,
L_WF_BITMAP_T,
L_WF_SYNC_UUID,
/* All SyncStates are tested with this comparison
* xx >= L_SYNC_SOURCE && xx <= L_PAUSED_SYNC_T */
L_SYNC_SOURCE,
L_SYNC_TARGET,
L_VERIFY_S,
L_VERIFY_T,
L_PAUSED_SYNC_S,
L_PAUSED_SYNC_T,
L_AHEAD,
L_BEHIND,
L_NEG_NO_RESULT = L_BEHIND, /* used for peer_device->negotiation_result only */
};
enum drbd_disk_state {
D_DISKLESS,
D_ATTACHING, /* In the process of reading the meta-data */
D_DETACHING, /* Added in protocol version 110 */
D_FAILED, /* Becomes D_DISKLESS as soon as we told it the peer */
/* when >= D_FAILED it is legal to access device->ldev */
D_NEGOTIATING, /* Late attaching state, we need to talk to the peer */
D_INCONSISTENT,
D_OUTDATED,
D_UNKNOWN, /* Only used for the peer, never for myself */
D_CONSISTENT, /* Might be D_OUTDATED, might be D_UP_TO_DATE ... */
D_UP_TO_DATE, /* Only this disk state allows applications' IO ! */
D_MASK = 15
};
union drbd_state {
/* According to gcc's docs is the ...
* The order of allocation of bit-fields within a unit (C90 6.5.2.1, C99 6.7.2.1).
* Determined by ABI.
* pointed out by Maxim Uvarov q
* even though we transmit as "cpu_to_be32(state)",
* the offsets of the bitfields still need to be swapped
* on different endianness.
*/
struct {
#if defined(__LITTLE_ENDIAN_BITFIELD)
unsigned role:2 ; /* 3/4 primary/secondary/unknown */
unsigned peer:2 ; /* 3/4 primary/secondary/unknown */
unsigned conn:5 ; /* 17/32 cstates */
unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
unsigned susp:1 ; /* 2/2 IO suspended no/yes (by user) */
unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
unsigned peer_isp:1 ;
unsigned user_isp:1 ;
unsigned susp_nod:1 ; /* IO suspended because no data */
unsigned susp_fen:1 ; /* IO suspended because fence peer handler runs*/
unsigned _pad:9; /* 0 unused */
#elif defined(__BIG_ENDIAN_BITFIELD)
unsigned _pad:9;
unsigned susp_fen:1 ;
unsigned susp_nod:1 ;
unsigned user_isp:1 ;
unsigned peer_isp:1 ;
unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
unsigned susp:1 ; /* 2/2 IO suspended no/yes */
unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
unsigned conn:5 ; /* 17/32 cstates */
unsigned peer:2 ; /* 3/4 primary/secondary/unknown */
unsigned role:2 ; /* 3/4 primary/secondary/unknown */
#else
# error "this endianness is not supported"
#endif
};
unsigned int i;
};
enum drbd_state_rv {
SS_CW_NO_NEED = 4,
SS_CW_SUCCESS = 3,
SS_NOTHING_TO_DO = 2,
SS_SUCCESS = 1,
SS_UNKNOWN_ERROR = 0, /* Used to sleep longer in _drbd_request_state */
SS_TWO_PRIMARIES = -1,
SS_NO_UP_TO_DATE_DISK = -2,
SS_NO_LOCAL_DISK = -4,
SS_NO_REMOTE_DISK = -5,
SS_CONNECTED_OUTDATES = -6,
SS_PRIMARY_NOP = -7,
SS_RESYNC_RUNNING = -8,
SS_ALREADY_STANDALONE = -9,
SS_CW_FAILED_BY_PEER = -10,
SS_IS_DISKLESS = -11,
SS_DEVICE_IN_USE = -12,
SS_NO_NET_CONFIG = -13,
SS_NO_VERIFY_ALG = -14, /* drbd-8.2 only */
SS_NEED_CONNECTION = -15,
SS_LOWER_THAN_OUTDATED = -16,
SS_NOT_SUPPORTED = -17,
SS_IN_TRANSIENT_STATE = -18, /* Retry after the next state change */
SS_CONCURRENT_ST_CHG = -19, /* Concurrent cluster side state change! */
SS_O_VOL_PEER_PRI = -20,
SS_INTERRUPTED = -21, /* interrupted in stable_state_change() */
SS_PRIMARY_READER = -22,
SS_TIMEOUT = -23,
SS_WEAKLY_CONNECTED = -24,
SS_AFTER_LAST_ERROR = -25, /* Keep this at bottom */
};
#define SHARED_SECRET_MAX 64
enum mdf_flag {
MDF_CONSISTENT = 1 << 0,
MDF_PRIMARY_IND = 1 << 1,
MDF_WAS_UP_TO_DATE = 1 << 4,
MDF_CRASHED_PRIMARY = 1 << 6,
MDF_AL_CLEAN = 1 << 7,
MDF_AL_DISABLED = 1 << 8,
};
enum mdf_peer_flag {
MDF_PEER_CONNECTED = 1 << 0,
MDF_PEER_OUTDATED = 1 << 1,
MDF_PEER_FENCING = 1 << 2,
MDF_PEER_FULL_SYNC = 1 << 3,
MDF_NODE_EXISTS = 1 << 16, /* */
};
#define DRBD_PEERS_MAX 32
#define DRBD_NODE_ID_MAX DRBD_PEERS_MAX
enum drbd_uuid_index {
UI_CURRENT,
UI_BITMAP,
UI_HISTORY_START,
UI_HISTORY_END,
UI_SIZE, /* nl-packet: number of dirty bits */
UI_FLAGS, /* nl-packet: flags */
UI_EXTENDED_SIZE /* Everything. */
};
#define HISTORY_UUIDS_V08 (UI_HISTORY_END - UI_HISTORY_START + 1)
#define HISTORY_UUIDS DRBD_PEERS_MAX
enum drbd_timeout_flag {
UT_DEFAULT = 0,
UT_DEGRADED = 1,
UT_PEER_OUTDATED = 2,
};
#define UUID_JUST_CREATED ((__u64)4)
#define UUID_PRIMARY ((__u64)1)
enum write_ordering_e {
WO_NONE,
WO_DRAIN_IO,
WO_BDEV_FLUSH,
WO_BIO_BARRIER
};
enum drbd_notification_type {
NOTIFY_EXISTS,
NOTIFY_CREATE,
NOTIFY_CHANGE,
NOTIFY_DESTROY,
NOTIFY_CALL,
NOTIFY_RESPONSE,
NOTIFY_CONTINUES = 0x8000,
NOTIFY_FLAGS = NOTIFY_CONTINUES,
};
/* These values are part of the ABI! */
enum drbd_peer_state {
P_INCONSISTENT = 3,
P_OUTDATED = 4,
P_DOWN = 5,
P_PRIMARY = 6,
P_FENCING = 7,
};
/* magic numbers used in meta data and network packets */
#define DRBD_MAGIC 0x83740267
#define DRBD_MAGIC_BIG 0x835a
#define DRBD_MAGIC_100 0x8620ec20
#define DRBD_MD_MAGIC_07 (DRBD_MAGIC+3)
#define DRBD_MD_MAGIC_08 (DRBD_MAGIC+4)
#define DRBD_MD_MAGIC_84_UNCLEAN (DRBD_MAGIC+5)
#define DRBD_MD_MAGIC_09 (DRBD_MAGIC+6)
/* how I came up with this magic?
* base64 decode "actlog==" ;) */
#define DRBD_AL_MAGIC 0x69cb65a2
/* these are of type "int" */
#define DRBD_MD_INDEX_INTERNAL -1
#define DRBD_MD_INDEX_FLEX_EXT -2
#define DRBD_MD_INDEX_FLEX_INT -3
#define DRBD_CPU_MASK_SIZE 32
#define DRBD_MAX_BIO_SIZE (1U << 20)
#endif
drbd-utils-8.9.6/drbd-headers/linux/drbd_limits.h 0000644 0001750 0001750 00000022216 12634301741 021637 0 ustar apoikos apoikos /*
drbd_limits.h
This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
*/
/*
* Our current limitations.
* Some of them are hard limits,
* some of them are arbitrary range limits, that make it easier to provide
* feedback about nonsense settings for certain configurable values.
*/
#ifndef DRBD_LIMITS_H
#define DRBD_LIMITS_H 1
#define DEBUG_RANGE_CHECK 0
#define DRBD_MINOR_COUNT_MIN 1
#define DRBD_MINOR_COUNT_MAX 255
#define DRBD_MINOR_COUNT_DEF 32
#define DRBD_MINOR_COUNT_SCALE '1'
#define DRBD_VOLUME_MAX 65535
#define DRBD_DIALOG_REFRESH_MIN 0
#define DRBD_DIALOG_REFRESH_MAX 600
#define DRBD_DIALOG_REFRESH_SCALE '1'
/* valid port number */
#define DRBD_PORT_MIN 1
#define DRBD_PORT_MAX 0xffff
#define DRBD_PORT_SCALE '1'
/* startup { */
/* if you want more than 3.4 days, disable */
#define DRBD_WFC_TIMEOUT_MIN 0
#define DRBD_WFC_TIMEOUT_MAX 300000
#define DRBD_WFC_TIMEOUT_DEF 0
#define DRBD_WFC_TIMEOUT_SCALE '1'
#define DRBD_DEGR_WFC_TIMEOUT_MIN 0
#define DRBD_DEGR_WFC_TIMEOUT_MAX 300000
#define DRBD_DEGR_WFC_TIMEOUT_DEF 0
#define DRBD_DEGR_WFC_TIMEOUT_SCALE '1'
#define DRBD_OUTDATED_WFC_TIMEOUT_MIN 0
#define DRBD_OUTDATED_WFC_TIMEOUT_MAX 300000
#define DRBD_OUTDATED_WFC_TIMEOUT_DEF 0
#define DRBD_OUTDATED_WFC_TIMEOUT_SCALE '1'
/* }*/
/* net { */
/* timeout, unit centi seconds
* more than one minute timeout is not useful */
#define DRBD_TIMEOUT_MIN 1
#define DRBD_TIMEOUT_MAX 600
#define DRBD_TIMEOUT_DEF 60 /* 6 seconds */
#define DRBD_TIMEOUT_SCALE '1'
/* If backing disk takes longer than disk_timeout, mark the disk as failed */
#define DRBD_DISK_TIMEOUT_MIN 0 /* 0 = disabled */
#define DRBD_DISK_TIMEOUT_MAX 6000 /* 10 Minutes */
#define DRBD_DISK_TIMEOUT_DEF 0 /* disabled */
#define DRBD_DISK_TIMEOUT_SCALE '1'
/* active connection retries when C_CONNECTING */
#define DRBD_CONNECT_INT_MIN 1
#define DRBD_CONNECT_INT_MAX 120
#define DRBD_CONNECT_INT_DEF 10 /* seconds */
#define DRBD_CONNECT_INT_SCALE '1'
/* keep-alive probes when idle */
#define DRBD_PING_INT_MIN 1
#define DRBD_PING_INT_MAX 120
#define DRBD_PING_INT_DEF 10
#define DRBD_PING_INT_SCALE '1'
/* timeout for the ping packets.*/
#define DRBD_PING_TIMEO_MIN 1
#define DRBD_PING_TIMEO_MAX 300
#define DRBD_PING_TIMEO_DEF 5
#define DRBD_PING_TIMEO_SCALE '1'
/* max number of write requests between write barriers */
#define DRBD_MAX_EPOCH_SIZE_MIN 1
#define DRBD_MAX_EPOCH_SIZE_MAX 20000
#define DRBD_MAX_EPOCH_SIZE_DEF 2048
#define DRBD_MAX_EPOCH_SIZE_SCALE '1'
/* I don't think that a tcp send buffer of more than 10M is useful */
#define DRBD_SNDBUF_SIZE_MIN 0
#define DRBD_SNDBUF_SIZE_MAX (10<<20)
#define DRBD_SNDBUF_SIZE_DEF 0
#define DRBD_SNDBUF_SIZE_SCALE '1'
#define DRBD_RCVBUF_SIZE_MIN 0
#define DRBD_RCVBUF_SIZE_MAX (10<<20)
#define DRBD_RCVBUF_SIZE_DEF 0
#define DRBD_RCVBUF_SIZE_SCALE '1'
/* @4k PageSize -> 128kB - 512MB */
#define DRBD_MAX_BUFFERS_MIN 32
#define DRBD_MAX_BUFFERS_MAX 131072
#define DRBD_MAX_BUFFERS_DEF 2048
#define DRBD_MAX_BUFFERS_SCALE '1'
/* @4k PageSize -> 4kB - 512MB */
#define DRBD_UNPLUG_WATERMARK_MIN 1
#define DRBD_UNPLUG_WATERMARK_MAX 131072
#define DRBD_UNPLUG_WATERMARK_DEF (DRBD_MAX_BUFFERS_DEF/16)
#define DRBD_UNPLUG_WATERMARK_SCALE '1'
/* 0 is disabled.
* 200 should be more than enough even for very short timeouts */
#define DRBD_KO_COUNT_MIN 0
#define DRBD_KO_COUNT_MAX 200
#define DRBD_KO_COUNT_DEF 7
#define DRBD_KO_COUNT_SCALE '1'
/* } */
/* syncer { */
/* FIXME allow rate to be zero? */
#define DRBD_RESYNC_RATE_MIN 1
/* channel bonding 10 GbE, or other hardware */
#define DRBD_RESYNC_RATE_MAX (4 << 20)
#define DRBD_RESYNC_RATE_DEF 250
#define DRBD_RESYNC_RATE_SCALE 'k' /* kilobytes */
/* less than 67 would hit performance unnecessarily. */
#define DRBD_AL_EXTENTS_MIN 67
/* we use u16 as "slot number", (u16)~0 is "FREE".
* If you use >= 292 kB on-disk ring buffer,
* this is the maximum you can use: */
#define DRBD_AL_EXTENTS_MAX 0xfffe
#define DRBD_AL_EXTENTS_DEF 1237
#define DRBD_AL_EXTENTS_SCALE '1'
#define DRBD_MINOR_NUMBER_MIN -1
#define DRBD_MINOR_NUMBER_MAX ((1 << 20) - 1)
#define DRBD_MINOR_NUMBER_DEF -1
#define DRBD_MINOR_NUMBER_SCALE '1'
/* } */
/* drbdsetup XY resize -d Z
* you are free to reduce the device size to nothing, if you want to.
* the upper limit with 64bit kernel, enough ram and flexible meta data
* is 1 PiB, currently. */
/* DRBD_MAX_SECTORS */
#define DRBD_DISK_SIZE_MIN 0
#define DRBD_DISK_SIZE_MAX (1 * (2LLU << 40))
#define DRBD_DISK_SIZE_DEF 0 /* = disabled = no user size... */
#define DRBD_DISK_SIZE_SCALE 's' /* sectors */
#define DRBD_ON_IO_ERROR_DEF EP_DETACH
#define DRBD_FENCING_DEF FP_DONT_CARE
#define DRBD_AFTER_SB_0P_DEF ASB_DISCONNECT
#define DRBD_AFTER_SB_1P_DEF ASB_DISCONNECT
#define DRBD_AFTER_SB_2P_DEF ASB_DISCONNECT
#define DRBD_RR_CONFLICT_DEF ASB_DISCONNECT
#define DRBD_ON_NO_DATA_DEF OND_IO_ERROR
#define DRBD_ON_CONGESTION_DEF OC_BLOCK
#define DRBD_READ_BALANCING_DEF RB_PREFER_LOCAL
#define DRBD_MAX_BIO_BVECS_MIN 0
#define DRBD_MAX_BIO_BVECS_MAX 128
#define DRBD_MAX_BIO_BVECS_DEF 0
#define DRBD_MAX_BIO_BVECS_SCALE '1'
#define DRBD_C_PLAN_AHEAD_MIN 0
#define DRBD_C_PLAN_AHEAD_MAX 300
#define DRBD_C_PLAN_AHEAD_DEF 20
#define DRBD_C_PLAN_AHEAD_SCALE '1'
#define DRBD_C_DELAY_TARGET_MIN 1
#define DRBD_C_DELAY_TARGET_MAX 100
#define DRBD_C_DELAY_TARGET_DEF 10
#define DRBD_C_DELAY_TARGET_SCALE '1'
#define DRBD_C_FILL_TARGET_MIN 0
#define DRBD_C_FILL_TARGET_MAX (1<<20) /* 500MByte in sec */
#define DRBD_C_FILL_TARGET_DEF 100 /* Try to place 50KiB in socket send buffer during resync */
#define DRBD_C_FILL_TARGET_SCALE 's' /* sectors */
#define DRBD_C_MAX_RATE_MIN 250
#define DRBD_C_MAX_RATE_MAX (4 << 20)
#define DRBD_C_MAX_RATE_DEF 102400
#define DRBD_C_MAX_RATE_SCALE 'k' /* kilobytes */
#define DRBD_C_MIN_RATE_MIN 0
#define DRBD_C_MIN_RATE_MAX (4 << 20)
#define DRBD_C_MIN_RATE_DEF 250
#define DRBD_C_MIN_RATE_SCALE 'k' /* kilobytes */
#define DRBD_CONG_FILL_MIN 0
#define DRBD_CONG_FILL_MAX (10<<21) /* 10GByte in sectors */
#define DRBD_CONG_FILL_DEF 0
#define DRBD_CONG_FILL_SCALE 's' /* sectors */
#define DRBD_CONG_EXTENTS_MIN DRBD_AL_EXTENTS_MIN
#define DRBD_CONG_EXTENTS_MAX DRBD_AL_EXTENTS_MAX
#define DRBD_CONG_EXTENTS_DEF DRBD_AL_EXTENTS_DEF
#define DRBD_CONG_EXTENTS_SCALE DRBD_AL_EXTENTS_SCALE
#define DRBD_PROTOCOL_DEF DRBD_PROT_C
#define DRBD_DISK_BARRIER_DEF 0
#define DRBD_DISK_FLUSHES_DEF 1
#define DRBD_DISK_DRAIN_DEF 1
#define DRBD_MD_FLUSHES_DEF 1
#define DRBD_TCP_CORK_DEF 1
#define DRBD_AL_UPDATES_DEF 1
/* We used to ignore the discard_zeroes_data setting.
* To not change established (and expected) behaviour,
* by default assume that, for discard_zeroes_data=0,
* we can make that an effective discard_zeroes_data=1,
* if we only explicitly zero-out unaligned partial chunks. */
#define DRBD_DISCARD_ZEROES_IF_ALIGNED_DEF 1
#define DRBD_ALLOW_TWO_PRIMARIES_DEF 0
#define DRBD_ALWAYS_ASBP_DEF 0
#define DRBD_USE_RLE_DEF 1
#define DRBD_CSUMS_AFTER_CRASH_ONLY_DEF 0
#define DRBD_AUTO_PROMOTE_DEF 1
#define DRBD_MAX_BIO_SIZE_DEF DRBD_MAX_BIO_SIZE
#define DRBD_MAX_BIO_SIZE_MIN (1 << 9)
#define DRBD_MAX_BIO_SIZE_MAX DRBD_MAX_BIO_SIZE
#define DRBD_MAX_BIO_SIZE_SCALE '1'
#define DRBD_NODE_ID_DEF 0
#define DRBD_NODE_ID_MIN 0
#ifndef DRBD_NODE_ID_MAX /* Is also defined in drbd.h */
#define DRBD_NODE_ID_MAX DRBD_PEERS_MAX
#endif
#define DRBD_NODE_ID_SCALE '1'
#define DRBD_PEER_ACK_WINDOW_DEF 4096 /* 2 MiByte */
#define DRBD_PEER_ACK_WINDOW_MIN 2048 /* 1 MiByte */
#define DRBD_PEER_ACK_WINDOW_MAX 204800 /* 100 MiByte */
#define DRBD_PEER_ACK_WINDOW_SCALE 's' /* sectors*/
#define DRBD_PEER_ACK_DELAY_DEF 100 /* 100ms */
#define DRBD_PEER_ACK_DELAY_MIN 1
#define DRBD_PEER_ACK_DELAY_MAX 10000 /* 10 seconds */
#define DRBD_PEER_ACK_DELAY_SCALE '1' /* milliseconds */
/* Two-phase commit timeout (1/10 seconds). */
#define DRBD_TWOPC_TIMEOUT_MIN 50
#define DRBD_TWOPC_TIMEOUT_MAX 600
#define DRBD_TWOPC_TIMEOUT_DEF 300
#define DRBD_TWOPC_TIMEOUT_SCALE '1'
#define DRBD_TWOPC_RETRY_TIMEOUT_MIN 1
#define DRBD_TWOPC_RETRY_TIMEOUT_MAX 50
#define DRBD_TWOPC_RETRY_TIMEOUT_DEF 1
#define DRBD_TWOPC_RETRY_TIMEOUT_SCALE '1'
#define DRBD_SYNC_FROM_NID_DEF -1
#define DRBD_SYNC_FROM_NID_MIN -1
#define DRBD_SYNC_FROM_NID_MAX DRBD_PEERS_MAX
#define DRBD_SYNC_FROM_NID_SCALE '1'
#define DRBD_AL_STRIPES_MIN 1
#define DRBD_AL_STRIPES_MAX 1024
#define DRBD_AL_STRIPES_DEF 1
#define DRBD_AL_STRIPES_SCALE '1'
#define DRBD_AL_STRIPE_SIZE_MIN 4
#define DRBD_AL_STRIPE_SIZE_MAX 16777216
#define DRBD_AL_STRIPE_SIZE_DEF 32
#define DRBD_AL_STRIPE_SIZE_SCALE 'k' /* kilobytes */
#define DRBD_SOCKET_CHECK_TIMEO_MIN 0
#define DRBD_SOCKET_CHECK_TIMEO_MAX DRBD_PING_TIMEO_MAX
#define DRBD_SOCKET_CHECK_TIMEO_DEF 0
#define DRBD_SOCKET_CHECK_TIMEO_SCALE '1'
/* Auto promote timeout (1/10 seconds). */
#define DRBD_AUTO_PROMOTE_TIMEOUT_MIN 0
#define DRBD_AUTO_PROMOTE_TIMEOUT_MAX 600
#define DRBD_AUTO_PROMOTE_TIMEOUT_DEF 20
#define DRBD_AUTO_PROMOTE_TIMEOUT_SCALE '1'
#define DRBD_RS_DISCARD_GRANULARITY_MIN 0
#define DRBD_RS_DISCARD_GRANULARITY_MAX (1<<20) /* 1MiByte */
#define DRBD_RS_DISCARD_GRANULARITY_DEF 0 /* disabled by default */
#define DRBD_RS_DISCARD_GRANULARITY_SCALE '1' /* bytes */
#endif
drbd-utils-8.9.6/drbd-headers/linux/drbd_genl_api.h 0000644 0001750 0001750 00000002346 12540016517 022116 0 ustar apoikos apoikos #ifndef DRBD_GENL_STRUCT_H
#define DRBD_GENL_STRUCT_H
/**
* struct drbd_genlmsghdr - DRBD specific header used in NETLINK_GENERIC requests
* @minor:
* For admin requests (user -> kernel): which minor device to operate on.
* For (unicast) replies or informational (broadcast) messages
* (kernel -> user): which minor device the information is about.
* If we do not operate on minors, but on connections or resources,
* the minor value shall be (~0), and the attribute DRBD_NLA_CFG_CONTEXT
* is used instead.
* @flags: possible operation modifiers (relevant only for user->kernel):
* DRBD_GENL_F_SET_DEFAULTS
* @ret_code: kernel->userland unicast cfg reply return code (union with flags);
*/
struct drbd_genlmsghdr {
__u32 minor;
union {
__u32 flags;
__s32 ret_code;
};
};
/* To be used in drbd_genlmsghdr.flags */
enum {
DRBD_GENL_F_SET_DEFAULTS = 1,
};
/* hack around predefined gcc/cpp "linux=1",
* we cannot possibly include <1/drbd_genl.h> */
#undef linux
#include
#define GENL_MAGIC_VERSION 2
#define GENL_MAGIC_FAMILY drbd
#define GENL_MAGIC_FAMILY_HDRSZ sizeof(struct drbd_genlmsghdr)
#define GENL_MAGIC_INCLUDE_FILE
#include
#endif
drbd-utils-8.9.6/drbd-headers/drbd_transport.h 0000644 0001750 0001750 00000027661 12654447447 021264 0 ustar apoikos apoikos #ifndef DRBD_TRANSPORT_H
#define DRBD_TRANSPORT_H
#include
#include
#include
#include
/* Whenever touch this file in a non-trivial way, increase the
DRBD_TRANSPORT_API_VERSION
So that transport compiled against an older version of this
header will no longer load in a module that assumes a newer
version. */
#define DRBD_TRANSPORT_API_VERSION 14
/* MSG_MSG_DONTROUTE and MSG_PROBE are not used by DRBD. I.e.
we can reuse these flags for our purposes */
#define CALLER_BUFFER MSG_DONTROUTE
#define GROW_BUFFER MSG_PROBE
/*
* gfp_mask for allocating memory with no write-out.
*
* When drbd allocates memory on behalf of the peer, we prevent it from causing
* write-out because in a criss-cross setup, the write-out could lead to memory
* pressure on the peer, eventually leading to deadlock.
*/
#define GFP_TRY (__GFP_HIGHMEM | __GFP_NOWARN | __GFP_RECLAIM)
#define tr_printk(level, transport, fmt, args...) ({ \
rcu_read_lock(); \
printk(level "drbd %s %s:%s: " fmt, \
(transport)->log_prefix, \
(transport)->class->name, \
rcu_dereference((transport)->net_conf)->name, \
## args); \
rcu_read_unlock(); \
})
#define tr_err(transport, fmt, args...) \
tr_printk(KERN_ERR, transport, fmt, ## args)
#define tr_warn(transport, fmt, args...) \
tr_printk(KERN_WARNING, transport, fmt, ## args)
#define tr_info(transport, fmt, args...) \
tr_printk(KERN_INFO, transport, fmt, ## args)
#define TR_ASSERT(x, exp) \
do { \
if (!(exp)) \
tr_err(x, "ASSERTION %s FAILED in %s\n", \
#exp, __func__); \
} while (0)
struct drbd_resource;
struct drbd_connection;
struct drbd_peer_device;
enum drbd_stream {
DATA_STREAM,
CONTROL_STREAM
};
enum drbd_tr_hints {
CORK,
UNCORK,
NODELAY,
NOSPACE,
QUICKACK
};
enum { /* bits in the flags word */
NET_CONGESTED, /* The data socket is congested */
RESOLVE_CONFLICTS, /* Set on one node, cleared on the peer! */
};
enum drbd_tr_free_op {
CLOSE_CONNECTION,
DESTROY_TRANSPORT
};
/* A transport might wrap its own data structure around this. Having
this base class as its first member. */
struct drbd_path {
struct sockaddr_storage my_addr;
struct sockaddr_storage peer_addr;
struct kref kref;
int my_addr_len;
int peer_addr_len;
bool established; /* updated by the transport */
struct list_head list;
};
/* Each transport implementation should embed a struct drbd_transport
into it's instance data structure. */
struct drbd_transport {
struct drbd_transport_ops *ops;
struct drbd_transport_class *class;
struct list_head paths;
const char *log_prefix; /* resource name */
struct net_conf *net_conf; /* content protected by rcu */
/* These members are intended to be updated by the transport: */
unsigned int ko_count;
unsigned long flags;
};
struct drbd_transport_stats {
int unread_received;
int unacked_send;
int send_buffer_size;
int send_buffer_used;
};
/* argument to ->recv_pages() */
struct drbd_page_chain_head {
struct page *head;
unsigned int nr_pages;
};
struct drbd_transport_ops {
void (*free)(struct drbd_transport *, enum drbd_tr_free_op free_op);
int (*connect)(struct drbd_transport *);
/**
* recv() - Receive data via the transport
* @transport: The transport to use
* @stream: The stream within the transport to use. Ether DATA_STREAM or CONTROL_STREAM
* @buf: The function will place here the pointer to the data area
* @size: Number of byte to receive
* @msg_flags: Bitmask of CALLER_BUFFER, GROW_BUFFER and MSG_DONTWAIT
*
* recv() returns the requests data in a buffer (owned by the transport).
* You may pass MSG_DONTWAIT as flags. Usually with the next call to recv()
* or recv_pages() on the same stream, the buffer may no longer be accessed
* by the caller. I.e. it is reclaimed by the transport.
*
* If the transport was not capable of fulfilling the complete "wish" of the
* caller (that means it returned a smaller size that size), the caller may
* call recv() again with the flag GROW_BUFFER, and *buf as returned by the
* previous call.
* Note1: This can happen if MSG_DONTWAIT was used, or if a receive timeout
* was we with set_rcvtimeo().
* Note2: recv() is free to re-locate the buffer in such a call. I.e. to
* modify *buf. Then it copies the content received so far to the new
* memory location.
*
* Last not least the caller may also pass an arbitrary pointer in *buf with
* the CALLER_BUFFER flag. This is expected to be used for small amounts
* of data only
*
* Upon success the function returns the bytes read. Upon error the return
* code is negative. A 0 indicates that the socket was closed by the remote
* side.
*/
int (*recv)(struct drbd_transport *, enum drbd_stream, void **buf, size_t size, int flags);
/**
* recv_pages() - Receive bulk data via the transport's DATA_STREAM
* @peer_device: Identify the transport and the device
* @page_chain: Here recv_pages() will place the page chain head and length
* @size: Number of bytes to receive
*
* recv_pages() will return the requested amount of data from DATA_STREAM,
* and place it into pages allocated with drbd_alloc_pages().
*
* Upon success the function returns 0. Upon error the function returns a
* negative value
*/
int (*recv_pages)(struct drbd_transport *, struct drbd_page_chain_head *, size_t size);
void (*stats)(struct drbd_transport *, struct drbd_transport_stats *stats);
void (*set_rcvtimeo)(struct drbd_transport *, enum drbd_stream, long timeout);
long (*get_rcvtimeo)(struct drbd_transport *, enum drbd_stream);
int (*send_page)(struct drbd_transport *, enum drbd_stream, struct page *,
int offset, size_t size, unsigned msg_flags);
int (*send_zc_bio)(struct drbd_transport *, struct bio *bio);
bool (*stream_ok)(struct drbd_transport *, enum drbd_stream);
bool (*hint)(struct drbd_transport *, enum drbd_stream, enum drbd_tr_hints hint);
void (*debugfs_show)(struct drbd_transport *, struct seq_file *m);
int (*add_path)(struct drbd_transport *, struct drbd_path *path);
int (*remove_path)(struct drbd_transport *, struct drbd_path *path);
};
struct drbd_transport_class {
const char *name;
const int instance_size;
const int path_instance_size;
struct module *module;
int (*init)(struct drbd_transport *);
struct list_head list;
};
/* An "abstract base class" for transport implementations. I.e. it
should be embedded into a transport specific representation of a
listening "socket" */
struct drbd_listener {
struct kref kref;
struct drbd_resource *resource;
struct list_head list; /* link for resource->listeners */
struct list_head waiters; /* list head for waiter structs*/
spinlock_t waiters_lock;
int pending_accepts;
struct sockaddr_storage listen_addr;
void (*destroy)(struct drbd_listener *);
};
/* This represents a drbd receiver thread that is waiting for an
incoming connection attempt. Again, should be embedded into a
implementation object */
struct drbd_waiter {
struct drbd_transport *transport;
wait_queue_head_t wait;
struct list_head list;
struct drbd_listener *listener;
};
/* drbd_main.c */
extern void drbd_destroy_path(struct kref *kref);
/* drbd_transport.c */
extern int drbd_register_transport_class(struct drbd_transport_class *transport_class,
int api_version,
int drbd_transport_size);
extern void drbd_unregister_transport_class(struct drbd_transport_class *transport_class);
extern struct drbd_transport_class *drbd_get_transport_class(const char *transport_name);
extern void drbd_put_transport_class(struct drbd_transport_class *);
extern void drbd_print_transports_loaded(struct seq_file *seq);
extern int drbd_get_listener(struct drbd_waiter *waiter,
const struct sockaddr *addr,
int (*create_fn)(struct drbd_transport *, const struct sockaddr *, struct drbd_listener **));
extern void drbd_put_listener(struct drbd_waiter *waiter);
extern struct drbd_waiter *drbd_find_waiter_by_addr(struct drbd_listener *, struct sockaddr_storage *);
extern bool drbd_stream_send_timed_out(struct drbd_transport *transport, enum drbd_stream stream);
extern bool drbd_should_abort_listening(struct drbd_transport *transport);
extern void drbd_path_event(struct drbd_transport *transport, struct drbd_path *path);
/* drbd_receiver.c*/
extern struct page *drbd_alloc_pages(struct drbd_transport *, unsigned int, gfp_t);
extern void drbd_free_pages(struct drbd_transport *transport, struct page *page, int is_net);
static inline void drbd_alloc_page_chain(struct drbd_transport *t,
struct drbd_page_chain_head *chain, unsigned int nr, gfp_t gfp_flags)
{
chain->head = drbd_alloc_pages(t, nr, gfp_flags);
chain->nr_pages = chain->head ? nr : 0;
}
static inline void drbd_free_page_chain(struct drbd_transport *transport, struct drbd_page_chain_head *chain, int is_net)
{
drbd_free_pages(transport, chain->head, is_net);
chain->head = NULL;
chain->nr_pages = 0;
}
/*
* Some helper functions to deal with our page chains.
*/
/* Our transports may sometimes need to only partially use a page.
* We need to express that somehow. Use this struct, and "graft" it into
* struct page at page->lru.
*
* According to include/linux/mm.h:
* | A page may be used by anyone else who does a __get_free_page().
* | In this case, page_count still tracks the references, and should only
* | be used through the normal accessor functions. The top bits of page->flags
* | and page->virtual store page management information, but all other fields
* | are unused and could be used privately, carefully. The management of this
* | page is the responsibility of the one who allocated it, and those who have
* | subsequently been given references to it.
* (we do alloc_page(), that is equivalent).
*
* Red Hat struct page is different from upstream (layout and members) :(
* So I am not too sure about the "all other fields", and it is not as easy to
* find a place where sizeof(struct drbd_page_chain) would fit on all archs and
* distribution-changed layouts.
*
* But (upstream) struct page also says:
* | struct list_head lru; * ...
* | * Can be used as a generic list
* | * by the page owner.
*
* On 32bit, use unsigned short for offset and size,
* to still fit in sizeof(page->lru).
*/
/* grafted over struct page.lru */
struct drbd_page_chain {
struct page *next; /* next page in chain, if any */
#ifdef CONFIG_64BIT
unsigned int offset; /* start offset of data within this page */
unsigned int size; /* number of data bytes within this page */
#else
#if PAGE_SIZE > (1U<<16)
#error "won't work."
#endif
unsigned short offset; /* start offset of data within this page */
unsigned short size; /* number of data bytes within this page */
#endif
};
static inline void dummy_for_buildbug(void)
{
struct page *dummy;
BUILD_BUG_ON(sizeof(struct drbd_page_chain) > sizeof(dummy->lru));
}
#define page_chain_next(page) \
(((struct drbd_page_chain*)&(page)->lru)->next)
#define page_chain_size(page) \
(((struct drbd_page_chain*)&(page)->lru)->size)
#define page_chain_offset(page) \
(((struct drbd_page_chain*)&(page)->lru)->offset)
#define set_page_chain_next(page, v) \
(((struct drbd_page_chain*)&(page)->lru)->next = (v))
#define set_page_chain_size(page, v) \
(((struct drbd_page_chain*)&(page)->lru)->size = (v))
#define set_page_chain_offset(page, v) \
(((struct drbd_page_chain*)&(page)->lru)->offset = (v))
#define set_page_chain_next_offset_size(page, n, o, s) \
*((struct drbd_page_chain*)&(page)->lru) = \
((struct drbd_page_chain) { \
.next = (n), \
.offset = (o), \
.size = (s), \
})
#define page_chain_for_each(page) \
for (; page && ({ prefetch(page_chain_next(page)); 1; }); \
page = page_chain_next(page))
#define page_chain_for_each_safe(page, n) \
for (; page && ({ n = page_chain_next(page); 1; }); page = n)
#ifndef SK_CAN_REUSE
/* This constant was introduced by Pavel Emelyanov on
Thu Apr 19 03:39:36 2012 +0000. Before the release of linux-3.5
commit 4a17fd52 sock: Introduce named constants for sk_reuse */
#define SK_CAN_REUSE 1
#endif
#endif
drbd-utils-8.9.6/drbd-headers/drbd_meta_data.h 0000644 0001750 0001750 00000002613 12477341210 021115 0 ustar apoikos apoikos #ifndef DRBD_META_DATA_H
#define DRBD_META_DATA_H
#ifdef __KERNEL__
#define be_u64 u64
#define be_u32 u32
#define be_s32 s32
#define be_u16 u16
#else
#define be_u64 struct { uint64_t be; }
#define be_u32 struct { uint32_t be; }
#define be_s32 struct { int32_t be; }
#define be_u16 struct { uint16_t be; }
#endif
struct peer_dev_md_on_disk_9 {
be_u64 bitmap_uuid;
be_u64 bitmap_dagtag;
be_u32 flags;
be_s32 bitmap_index;
be_u32 reserved_u32[2];
} __packed;
struct meta_data_on_disk_9 {
be_u64 effective_size; /* last agreed size */
be_u64 current_uuid;
be_u64 reserved_u64[4]; /* to have the magic at the same position as in v07, and v08 */
be_u64 device_uuid;
be_u32 flags; /* MDF */
be_u32 magic;
be_u32 md_size_sect;
be_u32 al_offset; /* offset to this block */
be_u32 al_nr_extents; /* important for restoring the AL */
be_u32 bm_offset; /* offset to the bitmap, from here */
be_u32 bm_bytes_per_bit; /* BM_BLOCK_SIZE */
be_u32 la_peer_max_bio_size; /* last peer max_bio_size */
be_u32 bm_max_peers;
be_s32 node_id;
/* see al_tr_number_to_on_disk_sector() */
be_u32 al_stripes;
be_u32 al_stripe_size_4k;
be_u32 reserved_u32[2];
struct peer_dev_md_on_disk_9 peers[DRBD_PEERS_MAX];
be_u64 history_uuids[HISTORY_UUIDS];
char padding[0] __attribute__((aligned(4096)));
} __packed;
#undef be_u64
#undef be_u32
#undef be_s32
#undef be_u16
#endif
drbd-utils-8.9.6/drbd-headers/drbd_strings.h 0000644 0001750 0001750 00000001361 12654447447 020706 0 ustar apoikos apoikos #ifndef __DRBD_STRINGS_H
#define __DRBD_STRINGS_H
struct state_names {
const char * const *names;
unsigned int size;
};
extern struct state_names drbd_conn_state_names;
extern struct state_names drbd_repl_state_names;
extern struct state_names drbd_role_state_names;
extern struct state_names drbd_disk_state_names;
extern struct state_names drbd_error_messages;
enum drbd_packet;
extern const char *drbd_repl_str(enum drbd_repl_state);
extern const char *drbd_conn_str(enum drbd_conn_state);
extern const char *drbd_role_str(enum drbd_role);
extern const char *drbd_disk_str(enum drbd_disk_state);
extern const char *drbd_set_st_err_str(enum drbd_state_rv);
extern const char *drbd_packet_name(enum drbd_packet);
#endif /* __DRBD_STRINGS_H */
drbd-utils-8.9.6/configure.ac 0000644 0001750 0001750 00000031173 12654447436 016015 0 ustar apoikos apoikos dnl
dnl autoconf for DRBD
dnl
dnl License: GNU General Public License Version 2 (GPLv2)
dnl Minimum autoconf version we require
AC_PREREQ(2.53)
dnl What we are, our version, who to bug in case of problems
AC_INIT(DRBD, 8.9.6, [drbd-dev@lists.linbit.com])
dnl Sanitize $prefix. Autoconf does this by itself, but so late in the
dnl generated configure script that the expansion does not occur until
dnl after our eval magic below.
if test "$prefix" = "NONE"; then
prefix=$ac_default_prefix
fi
exec_prefix=$prefix
dnl Expand autoconf variables so that we dont end up with '${prefix}'
dnl in #defines
dnl Autoconf deliberately leaves them unexpanded to allow make
dnl exec_prefix=/foo install. DRBD supports only DESTDIR, KDIR and
dnl KVER to be invoked with make.
prefix="`eval echo ${prefix}`"
exec_prefix="`eval echo ${exec_prefix}`"
bindir="`eval echo ${bindir}`"
sbindir="`eval echo ${sbindir}`"
libexecdir="`eval echo ${libexecdir}`"
datarootdir="`eval echo ${datarootdir}`"
datadir="`eval echo ${datadir}`"
sysconfdir="`eval echo ${sysconfdir}`"
sharedstatedir="`eval echo ${sharedstatedir}`"
localstatedir="`eval echo ${localstatedir}`"
libdir="`eval echo ${libdir}`"
includedir="`eval echo ${includedir}`"
oldincludedir="`eval echo ${oldincludedir}`"
infodir="`eval echo ${infodir}`"
mandir="`eval echo ${mandir}`"
docdir="`eval echo ${docdir}`"
dnl "--with-" options (all except rgm enabled by default, pass --without- to disable)
WITH_83_SUPPORT=yes
WITH_84_SUPPORT=yes
WITH_UDEV=yes
WITH_XEN=yes
WITH_PACEMAKER=yes
WITH_HEARTBEAT=yes
WITH_RGMANAGER=no
WITH_BASHCOMPLETION=yes
WITH_NOARCH_SUBPACKAGES=no
WITH_MANUAL=yes
AC_ARG_WITH([83support],
[AS_HELP_STRING([--without-83support],
[Do not include support for drbd driver/module <= 8.3])],
[WITH_83_SUPPORT=$withval])
AC_ARG_WITH([84support],
[AS_HELP_STRING([--without-84support],
[Do not include support for drbd driver/module 8.4])],
[WITH_84_SUPPORT=$withval])
AC_ARG_WITH([udev],
[AS_HELP_STRING([--with-udev],
[Enable udev integration])],
[WITH_UDEV=$withval])
AC_ARG_WITH([xen],
[AS_HELP_STRING([--with-xen],
[Enable Xen integration])],
[WITH_XEN=$withval])
AC_ARG_WITH([pacemaker],
[AS_HELP_STRING([--with-pacemaker],
[Enable Pacemaker integration])],
[WITH_PACEMAKER=$withval])
AC_ARG_WITH([heartbeat],
[AS_HELP_STRING([--with-heartbeat],
[Enable Heartbeat v1 haresources integration scripts])],
[WITH_HEARTBEAT=$withval])
AC_ARG_WITH([rgmanager],
[AS_HELP_STRING([--with-rgmanager],
[Enable Red Hat Cluster Suite integration])],
[WITH_RGMANAGER=$withval])
AC_ARG_WITH([bashcompletion],
[AS_HELP_STRING([--with-bashcompletion],
[Enable programmable bash completion])],
[WITH_BASHCOMPLETION=$withval])
AC_ARG_WITH([distro],
[AS_HELP_STRING([--with-distro],
[Configure for a specific distribution (supported values: generic, redhat, suse, debian, gentoo, slackware; default is to autodetect)])],
[DISTRO=$withval])
AC_ARG_WITH([initdir],
[AS_HELP_STRING([--with-initdir],
[Override directory for init scripts (default is distribution-specific)])],
[INITDIR=$withval])
AC_ARG_WITH([noarchsubpkg],
[AS_HELP_STRING([--with-noarchsubpkg],
[Build subpackages that support it for the "noarch" architecture (makes sense only with --enable-spec, supported by RPM from 4.6.0 forward)])],
[WITH_NOARCH_SUBPACKAGES=$withval])
AC_ARG_ENABLE([spec],
[AS_HELP_STRING([--enable-spec],
[Rather than creating Makefiles, create an RPM spec file only])],
[SPECMODE=$enableval],
[SPECMODE=""])
AC_ARG_WITH([manual],
[AS_HELP_STRING([--without-manual],
[Do not include manual pages])],
[WITH_MANUAL=$withval])
AC_SUBST(WITH_83_SUPPORT)
AC_SUBST(WITH_84_SUPPORT)
AC_SUBST(WITH_UDEV)
AC_SUBST(WITH_XEN)
AC_SUBST(WITH_PACEMAKER)
AC_SUBST(WITH_HEARTBEAT)
AC_SUBST(WITH_RGMANAGER)
AC_SUBST(WITH_BASHCOMPLETION)
AC_SUBST(WITH_MANUAL)
dnl Do we know where systemd unit files go?
PKG_PROG_PKG_CONFIG
AC_ARG_WITH([systemdunitdir],
[AC_HELP_STRING([--with-systemdunitdir=DIR],
[Directory for systemd service files [Auto]])],
[WITH_SYSTEMD_UNIT_DIR=$withval])
if test x"$with_systemdunitdir" = x || \
test x"$with_systemdunitdir" = xyes ; then
if test x"$PKG_CONFIG" != x; then
systemdunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
fi
if test x"$systemdunitdir" = x; then
AC_MSG_NOTICE([Could not detect systemd unit directory])
fi
else
systemdunitdir=$with_systemdunitdir
fi
AC_SUBST(systemdunitdir)
AC_MSG_RESULT([Using systemd unit directory: $systemdunitdir])
AC_ARG_WITH(tmpfilesdir,
AC_HELP_STRING([--with-tmpfilesdir=DIR],
[install configuration files for management of volatile files and directories in DIR [[PREFIX/lib/tmpfiles.d]]]),
tmpfilesdir=$withval, tmpfilesdir='${prefix}/lib/tmpfiles.d')
AC_SUBST(tmpfilesdir)
# set default early
default_udevdir=/lib/udev
if test x"$with_udev" = x || \
test x"$with_udev" = xyes ; then
if test x"$PKG_CONFIG" != x; then
udevdir=$($PKG_CONFIG --variable=udevdir udev)
fi
if test x"$udevdir" = x; then
AC_MSG_NOTICE([Could not detect udev rules directory, using default])
udevdir=$default_udevdir
fi
AC_MSG_RESULT([Using udev rules directory: $udevdir])
else
udevdir=$default_udevdir
fi
dnl always replace, even if not used
AC_SUBST(udevdir)
udevrulesdir=$udevdir/rules.d
AC_SUBST(udevrulesdir)
AC_ARG_WITH([initscripttype],
[AS_HELP_STRING([--with-initscripttype=INIT_SCRIPT_TYPE],
[Type of init script to install (sysv|systemd|both). [auto]])
])
case "$with_initscripttype" in
"")
if grep -ql systemd /sbin/init ; then
initscripttype=systemd
else
initscripttype=sysv
fi ;;
sysv|systemd|both)
initscripttype=$with_initscripttype ;;
*)
AC_MSG_ERROR([Illegal value -$with_initscripttype- for option --with-initscripttype]) ;;
esac
AC_SUBST(initscripttype)
dnl Checks for programs
AC_PROG_CC
AC_PROG_LN_S
AC_PATH_PROG(SED, sed)
AC_PATH_PROG(GREP, grep)
AC_PATH_PROG(FLEX, flex)
AC_PATH_PROG(RPMBUILD, rpmbuild)
AC_PATH_PROG(XSLTPROC, xsltproc)
AC_PATH_PROG(TAR, tar)
AC_PATH_PROG(GIT, git)
AC_PATH_PROG(DPKG_BUILDPACKAGE, dpkg-buildpackage)
AC_PATH_PROG(UDEVADM, udevadm, [false], [/sbin$PATH_SEPARATOR$PATH])
AC_PATH_PROG(UDEVINFO, udevinfo, [false], [/sbin$PATH_SEPARATOR$PATH])
if test -z "$CC"; then
AC_MSG_ERROR([Cannot build utils without a C compiler.])
fi
if test -z $FLEX; then
AC_MSG_ERROR([Cannot build utils without flex.])
fi
if test -z $RPMBUILD; then
AC_MSG_WARN([No rpmbuild found, building RPM packages is disabled.])
fi
if test -z $DPKG_BUILDPACKAGE; then
AC_MSG_WARN([No dpkg-buildpackage found, building Debian packages is disabled.])
fi
if test -z $XSLTPROC; then
AC_MSG_WARN([Cannot build man pages without xsltproc. You may safely ignore this warning when building from a tarball.])
dnl default to some sane value at least,
dnl so the error message about command not found makes sense
dnl otherwise you get "--xinclude ... command not found" :-/
XSLTPROC=xsltproc
fi
if test -z $GIT; then
AC_MSG_WARN(Cannot update buildtag without git. You may safely ignore this warning when building from a tarball.)
fi
if test $UDEVADM = false && test $UDEVINFO = false; then
if test "$WITH_UDEV" = "yes"; then
AC_MSG_WARN([udev support enabled, but neither udevadm nor udevinfo found on this system.])
fi
fi
dnl special header checks
AC_LANG(C)
AC_COMPILE_IFELSE([AC_LANG_SOURCE[
#include
static unsigned int dummy = CTRL_CMD_DELMCAST_GRP;
]], [AC_DEFINE([HAVE_CTRL_CMD_DELMCAST_GRP],1,[Does genetlink provide CTRL_CMD_DELMCAST_GRP already])])
dnl Checks for system services
BASH_COMPLETION_SUFFIX=""
UDEV_RULE_SUFFIX=""
RPM_DIST_TAG=""
RPM_BUILDREQ_DEFAULT="gcc flex glibc-devel make"
RPM_SUBPACKAGE_NOARCH=""
RPM_REQ_PACEMAKER=""
RPM_REQ_HEARTBEAT=""
RPM_REQ_BASH_COMPLETION=""
RPM_REQ_XEN=""
RPM_REQ_CHKCONFIG_POST=""
RPM_REQ_CHKCONFIG_PREUN=""
dnl figure out the distribution we're running on, and set some variables accordingly
if test -z $DISTRO; then
AC_CHECK_FILE(/etc/gentoo-release, [DISTRO="gentoo"])
AC_CHECK_FILE(/etc/redhat-release, [DISTRO="redhat"])
AC_CHECK_FILE(/etc/slackware-version, [DISTRO="slackware"])
AC_CHECK_FILE(/etc/debian_version, [DISTRO="debian"])
AC_CHECK_FILE(/etc/SuSE-release, [DISTRO="suse"])
fi
case "$DISTRO" in
gentoo)
AC_MSG_NOTICE([configured for Gentoo.])
;;
redhat)
test -z $INITDIR && INITDIR="$sysconfdir/rc.d/init.d"
RPM_DIST_TAG="%{?dist}"
dnl Fedora/Red Hat packaging guidelines mandate that packages
dnl belonging to the "minimal build system" should not be
dnl listed in BuildRequires
RPM_BUILDREQ_DEFAULT="flex"
RPM_REQ_CHKCONFIG_POST="Requires(post): chkconfig"
RPM_REQ_CHKCONFIG_PREUN="Requires(preun): chkconfig"
AC_MSG_NOTICE([configured for Red Hat (includes Fedora, RHEL, CentOS).])
AC_CHECK_FILE(/etc/fedora-release, [SUB_DISTRO="fedora"], [SUB_DISTRO="RHEL"])
if test "$SUB_DISTRO" = "fedora"; then
# pacemaker, heartbeat and bash-completion are not available in RHEL
# Xen: Be relaxed on RHEL (hassle free update). Be strict on Fedora
RPM_REQ_PACEMAKER="Requires: pacemaker"
RPM_REQ_HEARTBEAT="Requires: heartbeat"
RPM_REQ_BASH_COMPLETION="Requires: bash-completion"
RPM_REQ_XEN="Requires: xen"
fi
;;
slackware)
test -z $INITDIR && INITDIR="$sysconfdir/rc.d"
AC_MSG_NOTICE([configured for Slackware.])
;;
debian)
AC_MSG_NOTICE([configured for Debian (includes Ubuntu).])
;;
suse)
BASH_COMPLETION_SUFFIX=".sh"
# RPM_REQ_CHKCONFIG_POST="" chkconfig is part of aaa_base on suse
# RPM_REQ_CHKCONFIG_PREUN="" chkconfig is part of aaa_base on suse
AC_MSG_NOTICE([configured for SUSE (includes openSUSE, SLES).])
RPM_REQ_BASH_COMPLETION="Requires: bash"
# The following are disabled for hassle free updates:
# RPM_REQ_XEN="Requires: xen"
# RPM_REQ_PACEMAKER="Requires: pacemaker"
# RPM_REQ_HEARTBEAT="Requires: heartbeat"
# Unfortunately gcc on SLES9 is broken with -O2. Works with -O1
if grep -q 'VERSION = 9' /etc/SuSE-release; then
CFLAGS="-g -O1"
fi
;;
"")
AC_MSG_WARN([Unable to determine what distribution we are running on. Distribution-specific features will be disabled.])
;;
esac
dnl INITDIR may be set with --with-initdir, or set in the distro
dnl detection magic above. If unset down to here, use a sensible
dnl default.
test -z $INITDIR && INITDIR="$sysconfdir/init.d"
dnl Our udev rules file is known to work only with udev >= 85
if test "$WITH_UDEV" = "yes"; then
udev_version=`$UDEVADM version 2>/dev/null` || udev_version=`$UDEVINFO -V | cut -d " " -f 3`
if test -z $udev_version || test $udev_version -lt 85; then
UDEV_RULE_SUFFIX=".disabled"
AC_MSG_WARN([Obsolete or unknown udev version. Installing disabled udev rules.])
fi
fi
dnl Our sub-packages can be built for noarch, but RPM only supports
dnl this from version 4.6.0 forward
if test "$WITH_NOARCH_SUBPACKAGES" = "yes"; then
RPM_SUBPACKAGE_NOARCH="BuildArch: noarch"
fi
AC_SUBST(DISTRO)
AC_SUBST(INITDIR)
AC_SUBST(BASH_COMPLETION_SUFFIX)
AC_SUBST(UDEV_RULE_SUFFIX)
AC_SUBST(RPM_DIST_TAG)
AC_SUBST(RPM_BUILDREQ_DEFAULT)
AC_SUBST(RPM_SUBPACKAGE_NOARCH)
AC_SUBST(RPM_REQ_PACEMAKER)
AC_SUBST(RPM_REQ_HEARTBEAT)
AC_SUBST(RPM_REQ_BASH_COMPLETION)
AC_SUBST(RPM_REQ_XEN)
AC_SUBST(RPM_REQ_CHKCONFIG_POST)
AC_SUBST(RPM_REQ_CHKCONFIG_PREUN)
AH_TEMPLATE(DRBD_LIB_DIR, [Local state directory. Commonly
/var/lib/drbd or /usr/local/var/lib/drbd])
AH_TEMPLATE(DRBD_RUN_DIR, [Runtime state directory. Commonly
/var/run/drbd or /usr/local/var/run/drbd])
AH_TEMPLATE(DRBD_LOCK_DIR, [Local lock directory. Commonly
/var/lock or
/usr/local/var/lock])
AH_TEMPLATE(DRBD_CONFIG_DIR, [Local configuration directory. Commonly
/etc or
/usr/local/etc])
AH_TEMPLATE(DRBD_LEGACY_83, [Include support for drbd-8.3 kernel code])
AH_TEMPLATE(DRBD_LEGACY_84, [Include support for drbd-8.4 kernel code])
AC_SUBST(DRBD_LIB_DIR, [$localstatedir/lib/$PACKAGE_TARNAME])
AC_SUBST(DRBD_RUN_DIR, [$localstatedir/run/$PACKAGE_TARNAME])
AC_SUBST(DRBD_LOCK_DIR, [$localstatedir/lock])
AC_SUBST(DRBD_CONFIG_DIR, [$sysconfdir])
AC_DEFINE_UNQUOTED(DRBD_LIB_DIR, ["$DRBD_LIB_DIR"])
AC_DEFINE_UNQUOTED(DRBD_RUN_DIR, ["$DRBD_RUN_DIR"])
AC_DEFINE_UNQUOTED(DRBD_LOCK_DIR, ["$DRBD_LOCK_DIR"])
AC_DEFINE_UNQUOTED(DRBD_CONFIG_DIR, ["$DRBD_CONFIG_DIR"])
if test "$WITH_83_SUPPORT" = "yes"; then
AC_DEFINE(DRBD_LEGACY_83, [1])
fi
if test "$WITH_84_SUPPORT" = "yes"; then
AC_DEFINE(DRBD_LEGACY_84, [1])
fi
dnl The configuration files we create (from their .in template)
if test -z $SPECMODE; then
AC_CONFIG_FILES(Makefile user/shared/Makefile user/v9/Makefile user/v83/Makefile user/v84/Makefile scripts/Makefile documentation/v9/Makefile documentation/v83/Makefile documentation/v84/Makefile scripts/drbd.rules)
AC_CONFIG_HEADERS(user/shared/config.h)
else
AC_CONFIG_FILES(drbd.spec)
fi
dnl output
AC_OUTPUT
drbd-utils-8.9.6/README 0000644 0001750 0001750 00000000651 12466702073 014374 0 ustar apoikos apoikos
DRBD
======
by Philipp Reisner
and Lars Ellenberg
LINBIT Information Technologies
Reference documentation is included in the documentation directory.
Please refer to the web pages at
http://www.drbd.org/
http://www.drbd.org/docs/introduction/
to find maintained information.
drbd-utils-8.9.6/drbd.spec.in 0000644 0001750 0001750 00000031632 12654447436 015723 0 ustar apoikos apoikos # Define init script directory. %{_initddir} is available from Fedora
# 9 forward; CentOS knows 5 only %{_initrddir}. Neither are known to
# autoconf...
%{!?_initddir: %{expand: %%global _initddir %{_initrddir}}}
# Compatibility macro wrappers for legacy RPM versions that do not
# support conditional builds
%{!?bcond_without: %{expand: %%global bcond_without() %%{expand:%%%%{!?_without_%%{1}:%%%%global with_%%{1} 1}}}}
%{!?bcond_with: %{expand: %%global bcond_with() %%{expand:%%%%{?_with_%%{1}:%%%%global with_%%{1} 1}}}}
%{!?with: %{expand: %%global with() %%{expand:%%%%{?with_%%{1}:1}%%%%{!?with_%%{1}:0}}}}
%{!?without: %{expand: %%global without() %%{expand:%%%%{?with_%%{1}:0}%%%%{!?with_%%{1}:1}}}}
%if 0%{!?initscripttype:1}
# initscripttype not explicitly defined in some macro file or on commandline
# use presence of systemd_post macro to determine the initscripttype
%if %{?systemd_post:1}%{!?systemd_post:0}
%global initscripttype systemd
%else
%global initscripttype sysv
%endif
%endif
# Conditionals
# Invoke "rpmbuild --without " or "rpmbuild --with "
# to disable or enable specific features
%bcond_without manual
%bcond_without udev
%bcond_without pacemaker
%bcond_with rgmanager
%bcond_without heartbeat
# conditionals may not contain "-" nor "_", hence "bashcompletion"
%bcond_without bashcompletion
%bcond_without sbinsymlinks
# --with xen is ignored on any non-x86 architecture
%bcond_without xen
%bcond_without 83support
%bcond_without 84support
%ifnarch %{ix86} x86_64
%global _without_xen --without-xen
%endif
Name: drbd
Summary: DRBD driver for Linux
Version: @PACKAGE_VERSION@
Release: 1@RPM_DIST_TAG@
Source: http://oss.linbit.com/drbd/drbd-utils-%{version}.tar.gz
License: GPLv2+
ExclusiveOS: linux
Group: System Environment/Kernel
URL: http://www.drbd.org/
BuildRoot: %(mktemp -ud %{_tmppath}/drbd-utils-%{version}-%{release}-XXXXXX)
BuildRequires: @RPM_BUILDREQ_DEFAULT@
Requires: drbd-utils = %{version}
%ifarch %{ix86} x86_64
%if %{with xen}
Requires: drbd-xen = %{version}
%endif
%endif
%if %{with udev}
Requires: drbd-udev = %{version}
BuildRequires: udev
%endif
%if %{with pacemaker}
Requires: drbd-pacemaker = %{version}
%endif
## %if %{with rgmanager}
## ## No.
## ## We don't want to annoy the majority of our userbase on pacemaker
## ## by pulling in the full rgmanager stack via drbd-rgmanager as well.
## Requires: drbd-rgmanager = %{version}
## %endif
##
## ## Neither do we want to force anyone to install heartbeat
## ## Usually they use corosync meanwhile.
## ## No need to pull in heartbeat via the drbd-heartbeat scripts
## ## meant for haresources mode
## %if %{with heartbeat}
## Requires: %{name}-heartbeat = %{version}
## %endif
%if %{with bashcompletion}
Requires: drbd-bash-completion = %{version}
%endif
%description
DRBD mirrors a block device over the network to another machine.
Think of it as networked raid 1. It is a building block for
setting up high availability (HA) clusters.
This is a virtual package, installing the full DRBD userland suite.
# Just a few docs go into the "drbd" package. Everything else is part
# of one of the drbd-* packages.
%files
%defattr(-,root,root,-)
%doc COPYING
%doc ChangeLog
%doc README
%package utils
Summary: Management utilities for DRBD
Group: System Environment/Kernel
# Our kernel modules "require" specific drbd-utils versions, not ranges.
# Which was natural as long as userland and module shared the same repo
# and source tarball, and would be build together.
#
# Now we split the userland part, we "provide" a list of versions here,
# to be able to use this package with existing module packages.
#
%if %{with 84support}
# which 8.4 version equivalent this package provides
Provides: drbd-utils = 8.4.5
Provides: drbd-utils = 8.4.4
Provides: drbd-utils = 8.4.3
Provides: drbd-utils = 8.4.2
Provides: drbd-utils = 8.4.1
Provides: drbd-utils = 8.4.0
%endif
%if %{with 83support}
# which 8.3 version equivalent this package provides
Provides: drbd-utils = 8.3.16
%endif
# We used to have one monolithic userland package.
# Since all other packages require drbd-utils,
# it should be sufficient to add the conflict here.
Conflicts: drbd < 8.3.6
# These exist in centos extras:
Conflicts: drbd82 drbd83
@RPM_REQ_CHKCONFIG_POST@
@RPM_REQ_CHKCONFIG_PREUN@
%description utils
DRBD mirrors a block device over the network to another machine.
Think of it as networked raid 1. It is a building block for
setting up high availability (HA) clusters.
This packages includes the DRBD administration tools.
%files utils
%defattr(755,root,root,-)
%if %{with sbinsymlinks}
/sbin/drbdsetup
/sbin/drbdadm
/sbin/drbdmeta
%endif
%{_sbindir}/drbdsetup
%{_sbindir}/drbdadm
%{_sbindir}/drbdmeta
%if %{with 83support}
%dir /lib/drbd/
/lib/drbd/drbdsetup-83
/lib/drbd/drbdadm-83
%endif
%if %{with 84support}
/lib/drbd/drbdsetup-84
/lib/drbd/drbdadm-84
%endif
%if %{initscripttype} == "systemd"
%{_unitdir}/drbd.service
%{_tmpfilesdir}/drbd.conf
/lib/drbd/drbd
%else
%{_initddir}/drbd
%endif
%{_sbindir}/drbd-overview
%dir %{_prefix}/lib/drbd
%{_prefix}/lib/drbd/outdate-peer.sh
%{_prefix}/lib/drbd/snapshot-resync-target-lvm.sh
%{_prefix}/lib/drbd/unsnapshot-resync-target-lvm.sh
%{_prefix}/lib/drbd/notify-out-of-sync.sh
%{_prefix}/lib/drbd/notify-split-brain.sh
%{_prefix}/lib/drbd/notify-emergency-reboot.sh
%{_prefix}/lib/drbd/notify-emergency-shutdown.sh
%{_prefix}/lib/drbd/notify-io-error.sh
%{_prefix}/lib/drbd/notify-pri-lost-after-sb.sh
%{_prefix}/lib/drbd/notify-pri-lost.sh
%{_prefix}/lib/drbd/notify-pri-on-incon-degr.sh
%{_prefix}/lib/drbd/notify.sh
%dir %{_var}/lib/drbd
%ghost %dir %{_var}/run/drbd
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/drbd.conf
%dir %{_sysconfdir}/drbd.d
%config(noreplace) %{_sysconfdir}/drbd.d/global_common.conf
%if %{without manual}
%else
%{_mandir}/man8/drbd-*
%{_mandir}/man8/drbdsetup-*
%{_mandir}/man8/drbdadm-*
%{_mandir}/man5/drbd.conf-*
%{_mandir}/man8/drbdmeta-*
%endif
%doc scripts/drbd.conf.example
%doc COPYING
%doc ChangeLog
%doc README
%ifarch %{ix86} x86_64
%if %{with xen}
%package xen
Summary: Xen block device management script for DRBD
Group: System Environment/Kernel
Requires: drbd-utils = %{version}-%{release}
@RPM_REQ_XEN@
@RPM_SUBPACKAGE_NOARCH@
%description xen
This package contains a Xen block device helper script for DRBD, capable of
promoting and demoting DRBD resources as necessary.
%files xen
%defattr(755,root,root,-)
%{_sysconfdir}/xen/scripts/block-drbd
%endif # with xen
%endif # arch %{ix86} x86_64
%if %{with udev}
%package udev
Summary: udev integration scripts for DRBD
Group: System Environment/Kernel
Requires: drbd-utils = %{version}-%{release}, udev
@RPM_SUBPACKAGE_NOARCH@
%description udev
This package contains udev helper scripts for DRBD, managing symlinks to
DRBD devices in /dev/drbd/by-res and /dev/drbd/by-disk.
%files udev
%defattr(-,root,root,-)
%config @udevrulesdir@/65-drbd.rules*
%endif # with udev
%if %{with pacemaker}
%package pacemaker
Summary: Pacemaker resource agent for DRBD
Group: System Environment/Base
Requires: drbd-utils = %{version}-%{release}
@RPM_REQ_PACEMAKER@
License: GPLv2
@RPM_SUBPACKAGE_NOARCH@
%description pacemaker
This package contains the master/slave DRBD resource agent for the
Pacemaker High Availability cluster manager.
%files pacemaker
%defattr(755,root,root,-)
%{_prefix}/lib/drbd/crm-fence-peer.sh
%{_prefix}/lib/drbd/crm-unfence-peer.sh
%{_prefix}/lib/drbd/stonith_admin-fence-peer.sh
%{_prefix}/lib/ocf/resource.d/linbit/drbd
%endif # with pacemaker
# Dependencies for drbd-rgmanager are particularly awful. On RHEL 5
# and prior (and corresponding Fedora releases), %{_datadir}/cluster
# was owned by rgmanager version 2, so we have to depend on that.
#
# With Red Hat Cluster 3.0.1 (around Fedora 12), the DRBD resource
# agent was merged in, and it became part of the resource-agents 3
# package (which of course is different from resource-agents on all
# other platforms -- go figure). So for resource-agents >= 3, we must
# generally conflict.
#
# Then for RHEL 6, Red Hat in all their glory decided to keep the
# packaging scheme, but kicked DRBD out of the resource-agents
# package. Thus, for RHEL 6 specifically, we must not conflict with
# resource-agents >=3, but instead require it.
#
# The saga continues:
# In RHEL 6.1 they have listed the drbd resource agent as valid agent,
# but do not include it in their resource-agents package. -> So we
# drop any dependency regarding rgmanager's version.
#
# All of this for exactly two (2) files.
%if %{with rgmanager}
%package rgmanager
Summary: Red Hat Cluster Suite agent for DRBD
Group: System Environment/Base
Requires: drbd-utils = %{version}-%{release}
@RPM_SUBPACKAGE_NOARCH@
%description rgmanager
This package contains the DRBD resource agent for the Red Hat Cluster Suite
resource manager.
As of Red Hat Cluster Suite 3.0.1, the DRBD resource agent is included
in the Cluster distribution.
%files rgmanager
%defattr(755,root,root,-)
%{_datadir}/cluster/drbd.sh
%{_prefix}/lib/drbd/rhcs_fence
%defattr(-,root,root,-)
%{_datadir}/cluster/drbd.metadata
%endif # with rgmanager
%if %{with heartbeat}
%package heartbeat
Summary: Heartbeat resource agent for DRBD
Group: System Environment/Base
Requires: %{name}-utils = %{version}-%{release}
@RPM_REQ_HEARTBEAT@
License: GPLv2
@RPM_SUBPACKAGE_NOARCH@
%description heartbeat
This package contains the DRBD resource agents for the Heartbeat cluster
resource manager (in v1 compatibility mode).
%files heartbeat
%defattr(755,root,root,-)
%{_sysconfdir}/ha.d/resource.d/drbddisk
%{_sysconfdir}/ha.d/resource.d/drbdupper
%defattr(-,root,root,-)
%if %{without manual}
%else
%{_mandir}/man8/drbddisk-*
%endif
%endif # with heartbeat
%if %{with bashcompletion}
%package bash-completion
Summary: Programmable bash completion support for drbdadm
Group: System Environment/Base
Requires: drbd-utils = %{version}-%{release}
@RPM_REQ_BASH_COMPLETION@
@RPM_SUBPACKAGE_NOARCH@
%description bash-completion
This package contains programmable bash completion support for the drbdadm
management utility.
%files bash-completion
%defattr(-,root,root,-)
%config %{_sysconfdir}/bash_completion.d/drbdadm*
%endif # with bashcompletion
%prep
%setup -q -n drbd-utils-%{version}
%build
# rebuild configure...
aclocal
autoheader
autoconf
%configure \
%{?_without_udev} \
%{?_without_xen} \
%{?_without_pacemaker} \
%{?_without_heartbeat} \
%{?_with_rgmanager} \
%{?_without_bashcompletion} \
%{?_without_83support} \
%{?_without_84support} \
%{?_without_manual} \
--with-initdir=%{_initddir} \
%{?_tmpfilesdir:--with-tmpfilesdir=%{_tmpfilesdir}} \
--with-initscripttype=%{initscripttype}
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} CREATE_MAN_LINK=no
%if %{with sbinsymlinks}
# Don't do this if you are already on a /sbin -=> /usr/sbin distro
# compat: we used to live in /sbin/
# there may be many hardcoded /sbin/drbd* out there,
# including variants of our own scripts.
mkdir -p %{buildroot}/var/run/drbd
mkdir %{buildroot}/sbin/
cd %{buildroot}/sbin/
ln -sv ..%{_sbindir}/drbdadm .
ln -sv ..%{_sbindir}/drbdmeta .
ln -sv ..%{_sbindir}/drbdsetup .
%endif
%clean
rm -rf %{buildroot}
%post utils
%if %{initscripttype} == "systemd"
%systemd_post drbd.service
%else
chkconfig --add drbd
%endif
%if %{without manual}
%else
for f in drbd drbdadm drbdmeta drbdsetup; do
ln -sf $f-8.4.8.gz %{_mandir}/man8/$f.8.gz
done
ln -sf drbd.conf-8.4.5.gz %{_mandir}/man5/drbd.conf.5.gz
%endif
%if %{without udev}
for i in `seq 0 15` ; do
test -b /dev/drbd$i || mknod -m 0660 /dev/drbd$i b 147 $i;
done
%endif #without udev
%preun utils
for f in drbd drbdadm drbdmeta drbdsetup; do
rm -f %{_mandir}/man8/$f.8.gz
done
rm -f %{_mandir}/man5/drbd.conf.5.gz
%if %{initscripttype} == "systemd"
%systemd_preun drbd.service
%else
if [ $1 -eq 0 ]; then
%{_initrddir}/drbd stop >/dev/null 2>&1
/sbin/chkconfig --del drbd
fi
%endif
%if %{initscripttype} == "systemd"
%postun utils
%systemd_postun
%endif
%changelog
* Wed Feb 3 2016 Roland Kammerer - 8.9.6-1
- New upstream release.
* Wed Dec 16 2015 Philipp Reisner - 8.9.5-1
- New upstream release.
* Fri Sep 18 2015 Philipp Reisner - 8.9.4-1
- New upstream release.
* Wed Jul 29 2015 Lars Ellenberg - 8.9.3-2
- fixes for regression of drbd-8.4 pacemaker integration
* Tue Jun 16 2015 Philipp Reisner - 8.9.3-1
- New upstream release.
* Fri Apr 03 2015 Philipp Reisner - 8.9.2-1
- New upstream release.
* Fri Aug 08 2014 Lars Ellenberg - 8.9.1-3
- some more patches had been only merged into the "9" tools,
but unfortunately not the 8.4 tool compat tools
- place udev rules into $udevdir/*rules.d*
- rebuild: fixed default in case pkg-config does not know about udevdir
- fixed udev generated "by-disk" symlinks for drbd 8.4
* Tue Aug 05 2014 Lars Ellenberg - 8.9.1-1
- New upstream release.
* Tue Jun 10 2014 Philipp Reisner - 8.9.0-1
- New upstream release.
drbd-utils-8.9.6/scripts/ 0000755 0001750 0001750 00000000000 12654475367 015215 5 ustar apoikos apoikos drbd-utils-8.9.6/scripts/drbd.sh.rhcs 0000755 0001750 0001750 00000006576 12466702073 017427 0 ustar apoikos apoikos #!/bin/bash
#
# Copyright LINBIT, 2008
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
# MA 02139, USA.
#
#
# DRBD resource management using the drbdadm utility.
#
LC_ALL=C
LANG=C
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export LC_ALL LANG PATH
. $(dirname $0)/ocf-shellfuncs
drbd_verify_all()
{
# Do we have the drbdadm utility?
if ! which drbdadm >/dev/null 2>&1 ; then
ocf_log error "drbdadm not installed, not found in PATH ($PATH), or not executable."
return $OCF_ERR_INSTALLED
fi
# Is drbd loaded?
if ! grep drbd /proc/modules >/dev/null 2>&1; then
ocf_log error "drbd not found in /proc/modules. Do you need to modprobe?"
return $OCF_ERR_INSTALLED
fi
# Do we have the "resource" parameter?
if [ -n "$OCF_RESKEY_resource" ]; then
# Can drbdadm parse the resource name?
if ! drbdadm sh-dev $OCF_RESKEY_resource >/dev/null 2>&1; then
ocf_log error "DRBD resource \"$OCF_RESKEY_resource\" not found."
return $OCF_ERR_CONFIGURED
fi
# Is the backing device a locally available block device?
backing_dev=$(drbdadm sh-ll-dev $OCF_RESKEY_resource)
for dev in $backing_dev ; do
[ -b $dev ] && continue;
ocf_log error "Backing device for DRBD resource \"$OCF_RESKEY_resource\" ($dev) not found or not a block device."
return $OCF_ERR_INSTALLED
done
fi
return 0
}
drbd_status() {
local all_primary=true
for role in $(drbdadm role $OCF_RESKEY_resource); do
case $role in
Primary/*)
;;
Secondary/*)
all_primary=false
;;
*)
return $OCF_ERR_GENERIC
;;
esac
done
$all_primary && return $OCF_SUCCESS
return $OCF_NOT_RUNNING
}
drbd_promote() {
drbdadm primary $OCF_RESKEY_resource || return $?
}
drbd_demote() {
drbdadm secondary $OCF_RESKEY_resource || return $?
}
if [ -z "$OCF_CHECK_LEVEL" ]; then
OCF_CHECK_LEVEL=0
fi
# This one doesn't need to pass the verify check
case $1 in
meta-data)
cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'` && exit 0
exit $OCF_ERR_GENERIC
;;
esac
# Everything else does
drbd_verify_all || exit $?
case $1 in
start)
if drbd_status; then
ocf_log debug "DRBD resource ${OCF_RESKEY_resource} already configured"
exit 0
fi
drbd_promote
if [ $? -ne 0 ]; then
exit $OCF_ERR_GENERIC
fi
exit $?
;;
stop)
if drbd_status; then
drbd_demote
if [ $? -ne 0 ]; then
exit $OCF_ERR_GENERIC
fi
else
ocf_log debug "DRBD resource ${OCF_RESKEY_resource} is not configured"
fi
exit 0
;;
status|monitor)
drbd_status
exit $?
;;
restart)
$0 stop || exit $OCF_ERR_GENERIC
$0 start || exit $OCF_ERR_GENERIC
exit 0
;;
verify-all)
exit 0
;;
*)
echo "usage: $0 {start|stop|status|monitor|restart|meta-data|verify-all}"
exit $OCF_ERR_GENERIC
;;
esac
drbd-utils-8.9.6/scripts/drbd-overview.pl 0000755 0001750 0001750 00000030735 12634271674 020335 0 ustar apoikos apoikos #!/usr/bin/perl
# vim: set sw=4 ts=4 et :
use strict;
use warnings;
## MAYBE set 'sane' PATH ??
$ENV{LANG} = 'C';
$ENV{LC_ALL} = 'C';
$ENV{LANGUAGE} = 'C';
#use Data::Dumper;
# globals
my $PROC_DRBD = "/proc/drbd";
my ($HOSTNAME) = (`uname -n` =~ /(\S+)/);
my $stderr_to_dev_null = 1;
my $watch = 0;
my %drbd;
my %minor_of_name;
my $DRBD_VERSION;
my @DRBD_VERSION;
our $use_colors = (-t STDOUT) + 0;
my %xen_info;
my %virsh_info;
# sets $drbd{minor}->{name} (and possibly ->{ll_dev})
sub map_minor_to_resource_names()
{
my @drbdadm_sh_status = `drbdadm sh-status`;
my ($ll_res, $ll_dev, $ll_minor, $conf_res, $conf_vnr, $minor, $name, $vnr);
for (@drbdadm_sh_status) {
# volumes only present in >= 8.4
# some things generated by drbdadm
/^_conf_res_name=(.*)\n/ and $conf_res = $1, $name = $conf_res;
/^_conf_volume=(\d+)\n/ and $conf_vnr = $1;
/^_stacked_on=(.*?)\n/ and $ll_res = $1;
# not always present:
/^_stacked_on_device=(.*)\n/ and $ll_dev = $1;
/^_stacked_on_minor=(\d+)\n/ and $ll_minor = $1;
# rest generated by drbdsetup
/^_minor=(.*?)\n/ and $minor = $1;
/^_res_name=(.+?)\n/ and $name = $1;
/^_volume=(\d+)\n/ and $vnr = $1;
/^_sh_status_process/ or next;
$drbd{$minor}{name} = $name;
if (defined $conf_vnr) {
# >= 8.4, append /volume to resource name.
# If both are present, they should be the same. But
# just in case, prefer the kernel volume number, if it
# is present and positive. Else, use the volume number
# from the config.
$drbd{$minor}{name} .= defined $vnr ? "/$vnr" : "/$conf_vnr";
}
$minor_of_name{$name} = $minor;
$drbd{$minor}{ll_dev} = defined($ll_dev) ? $ll_minor : $ll_res
if $ll_res;
}
# fix up hack for git versions 8.3.1 > x > 8.3.0:
# _stacked_on_minor information is missing,
# _stacked_on is resource name
# may be defined (and reported) out of order.
for my $i (keys %drbd) {
next unless exists $drbd{$i}->{ll_dev};
my $lower = $drbd{$i}->{ll_dev};
next if $lower =~ /^\d+$/;
next unless exists $minor_of_name{$lower};
$drbd{$i}->{ll_dev} = $minor_of_name{$lower};
}
# fix up to be able to report "lower dev of:"
for my $i (keys %drbd) {
next unless exists $drbd{$i}->{ll_dev};
my $lower = $drbd{$i}->{ll_dev};
$drbd{$lower}->{ll_dev_of} = $i;
}
}
sub ll_dev_info {
my $i = shift;
( "ll-dev of:", $i, $drbd{$i}{name} )
}
# sets $drbd{minor}->{state} and (and possibly ->{sync})
sub slurp_proc_drbd_or_exit() {
$_=;
my ($DRBD_VERSION) = /version: ([\d\.]+)/;
@DRBD_VERSION = split(/\./, $DRBD_VERSION);
my $minor;
while (defined($_ = )) {
chomp;
/^ *(\d+):/ and do {
# skip unconfigured devices
$minor = $1;
if (/^ *(\d+): cs:Unconfigured/) {
next
unless exists $drbd{$minor}
and exists $drbd{$minor}{name};
}
my $uc = /Unconfigured/ ? "." : undef;
($drbd{$minor}{conn}) = $uc || m{\bcs:(\w+)\b};
($drbd{$minor}{role}) = $uc || m{\bro:(\w+/\w+)\b};
($drbd{$minor}{dstate}) = $uc || m{\bds:(\w+/\w+)\b};
};
/^\t\[.*sync.ed:/ and do {
$drbd{$minor}{sync} = $_;
};
/^\t[0-9 %]+oos:/ and do {
$drbd{$minor}{sync} = $_;
};
}
close PD;
for (values %drbd) {
$_->{conn} ||= "Unconfigured";
$_->{role} ||= ".";
$_->{dstate} ||= ".";
}
}
our $ansi_color_re = qr{(\033\[[\d;]+?m)};
sub abbreviate {
my($w, $max) = @_;
$max ||= 15;
my $col_pre = ($w =~ s/^$ansi_color_re//o ) ? $1 : "";
my $col_post = ($w =~ s/$ansi_color_re$//o) ? $1 : "";
# keep UPPERCase and a few lowercase characters.
# Make "Connecting" to "C'ing", to get it distinct from "Connected"
1 while length($w) > $max &&
( $w =~ s/^(C)(onnecting)$/"$1'" . substr($2, 2-$max)/eg || # needs to cut 2 characters, because one is inserted again.
$w =~ s/([a-z]+)[a-z]/$1/g );
return $col_pre . substr($w, 0, $max) . $col_post;
}
# taking a sorted list of keys and a hash, produce a short output.
# eg. Connected(*)/WFConnection(alice)
sub shorten_list {
my ($keys, $hash, $max) = @_;
my %vals;
my %vl;
for my $k (@$keys) {
$vals{ $hash->{$k} }{ $k }++;
$vl{ $hash->{$k} }++;
}
# only a single value? Fine!
# return abbreviate($hash->{$keys->[0]}, 6) . "(*)"
return $hash->{$keys->[0]} . "(" . (values %vl)[0] . "*)"
if 1 == (keys %vals);
# only 1 or 2 keys, ie. 2 values? Fine, done.
return join("/", map { abbreviate($hash->{$_}, 6); } @$keys)
if (@$keys <= 2);
# get sorted counts.
my @v = sort { $b <=> $a; } values %vl;
#print "=========", Dumper(\@v);
# use a wildcard if one element is 3 or more times used, and more often than every other.
my ($wc_data) =
(($v[0] >= 3) && ($v[0] != $v[1])) ?
grep($vl{$_} == $v[0], keys %vl) : ();
my @stg;
my %done;
push(@stg, abbreviate($wc_data, 4) . "(" . $v[0] . "*)"),
$done{$wc_data}++
if ($wc_data);
for my $k2 (@$keys) {
my $v = $hash->{$k2};
next if $done{$v}++;
push @stg, abbreviate($v, 4) .
"(" . join(",", keys %{$vals{$v}} ) . ")";
}
return join("/", @stg);
}
sub slurp_drbdsetup() {
unless (open(DS,"drbdsetup events2 --now --statistics " .
($use_colors ? "--color=always " : "") .
" |")) {
print "drbdsetup not started\n";
exit 0;
}
my(%later, $my_role);
while () {
chomp;
next unless s/^exists //;
last if /^-$/; # EOD
s/^([\w.-]+) name:([\w.-]+) //;
my $what = $1;
my $res = $2;
my %f = map { split(/:/, $_, 2); } split(/ +/, $_);
if ($what eq "resource" &&
($my_role = $f{'role'})) {
$later{$res}{peers}{states}{$HOSTNAME} = $my_role;
# local node is always connected
$later{$res}{peers}{conns}{$HOSTNAME} = "Connected";
} elsif ($what eq "connection") {
my $p = $f{'conn-name'};
my $cs= $f{'connection'};
my $r = $f{'role'};
# Increase difference between "Connecting" and "Connected"
$cs =~ s/^Connecting/'ing/;
$later{$res}{peers}{states}{$p} = $r;
$later{$res}{peers}{conns}{$p} = $cs;
$later{$res}{hosts}{$p}++;
} elsif ($what eq "device") {
my $minor = $f{minor};
my $vol = $f{volume};
$later{$res}{vol_minor}{$vol} = $minor;
$later{$res}{peers}{dstates}{$HOSTNAME} = $f{disk};
} elsif ($what eq "peer-device") {
my $n = $f{"conn-name"};
$later{$res}{peers}{dstates}{$n} = $f{"peer-disk"};
} else {
warn("unknown key $what\n");
}
}
for my $res2 (keys %later) {
my @h = sort keys %{$later{$res2}{hosts}};
my @h_incl = ($HOSTNAME, @h);
my $vol_minor = $later{$res2}{vol_minor};
my $peers = $later{$res2}{peers};
for my $vol2 (keys %$vol_minor) {
my $minor2 = $vol_minor->{$vol2};
my $name = length($vol2) ? "$res2/$vol2" : $res2;
# create hash
$drbd{$minor2}{name} = $name;
my $v = $drbd{$minor2};
# role with local=first
$v->{role} = join("/", $my_role,
shorten_list(\@h, $peers->{states}));
# role with all mixed together
$v->{role} = shorten_list(\@h_incl, $peers->{states});
$v->{dstate} = shorten_list(\@h_incl, $peers->{dstates});
$v->{conn} = shorten_list(\@h_incl, $peers->{conns});
}
}
close DS;
}
# sets $drbd{minor}->{pv_info}
sub get_pv_info()
{
for (`pvs --noheadings --units g -o pv_name,vg_name,pv_size,pv_used`) {
m{^\s*/dev/drbd(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s*$} or next;
# PV VG PSize Used
$drbd{$1}{pv_info} = { vg => $2, size => $3, used => $4 };
}
}
sub pv_info
{
my $t = shift;
"lvm-pv:", @{$t}{qw(vg size used)};
}
# sets $drbd{minor}->{df_info}
sub get_df_info()
{
for (`df -TPhl -x tmpfs --local`) {
# Filesystem Type Size Used Avail Use% Mounted on
m{^/dev/drbd(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)} or next;
$drbd{$1}{df_info} = { type => $2, size => $3, used => $4,
avail => $5, use_percent => $6, mountpoint => $7 };
}
}
sub df_info
{
my $t = shift;
@{$t}{qw(mountpoint type size used avail use_percent)};
}
sub get_swap_info()
{
open(my $fd, "< /proc/swaps") or return;
while (<$fd>) {
# Filename Type Size Used Priority
# /dev/drbd100 partition 262140 0 -1
m{^/dev/drbd(\d+)\s+(\S+)\s+(\d+)\s+(\d+)} or next;
$drbd{$1}{df_info} = { type => 'swap', size => $3, used => $4, };
}
}
# sets $drbd{minor}->{xen_info}
sub get_xen_info()
{
my $dom;
my $running = 0;
my %i;
for (`xm list --long`) {
/^\s+\(name ([^)\n]+)\)/ and $dom = $1;
/drbd:([^)\n]+)/ and $i{$minor_of_name{$1}}++;
m{phy:/dev/drbd(\d+)} and $i{$1}++;
/^\s+\(state r/ and $running = 1;
if (/^\)$/) {
for (keys %i) {
$drbd{$_}{xen_info} =
$running ?
"\*$dom" : "_$dom";
}
$running = 0;
%i = ();
}
}
}
# set $drbd{minor}->{virsh_info}
sub get_virsh_info()
{
local $/ = undef;
my $virsh_list = `virsh list --all`;
# Id Name State
# ----------------------------------
# 1 mail running
# 2 support running
# - debian-master shut off
# - www shut off
my %info;
my $virsh_dumpxml;
my $pid;
$virsh_list =~ s/^\s+Id\s+Name\s+?State\s*-+\n//;
while ($virsh_list =~ m{^\s*(\S+)\s+(\S+)\s+(\S.*?)\n}gm) {
$info{$2} = { id => $1, name => $2, state => $3 };
# print STDERR "$1, $2, $3\n";
}
for my $dom (keys %info) {
# add error processing as above
$pid = open(V, "-|");
return unless defined $pid;
if ($pid == 0) { # child
exec("virsh", "dumpxml", $dom)
or die "can't exec program: $!";
# NOTREACHED
}
# parent
$_ = ;
close(V) or warn "virsh dumpxml exit code: $?\n";
for (m{]*>.*?}gs) {
m{} or next;
my $dev = $1;
if ($dev !~ /^\d+$/) {
my @stat = stat("/dev/drbd$dev") or next;
$dev = $stat[6] & 0xff;
}
m{
$info{$dom}->{state} eq 'running' ?
"\*$dom" : "_$dom",
vdev => $1,
bus => $2,
};
}
}
}
sub virsh_info
{
my $t = shift;
@{$t}{qw(domname vdev bus)};
}
# first, for debugging of this script and its regex'es,
# allow reading from a prepared file instead of /proc/drbd
# Getopt::Long is standard since quite some time, but in case it's not available somewhere we'll fail soft.
eval {
use Getopt::Long;
GetOptions(
"proc-drbd=s" => \$PROC_DRBD,
"stderr-to-dev-null|d" => \$stderr_to_dev_null,
"color|colors|c:s" => \$use_colors) or
die "Unknown command line argument.\n";
$use_colors = 0 if $use_colors =~ m/^(never|no|off)$/;
$use_colors = 1 if $use_colors =~ m/^(always|yes|on)$/;
warn "unrecognized value for --color" unless $use_colors =~ /^[01]$/;
};
open STDERR, "/dev/null"
if $stderr_to_dev_null;
unless (open(PD,$PROC_DRBD)) {
print "drbd not loaded\n";
exit 0;
}
map_minor_to_resource_names;
slurp_proc_drbd_or_exit;
slurp_drbdsetup if $DRBD_VERSION[0] >= 9;
get_pv_info;
get_df_info;
get_swap_info;
get_xen_info;
get_virsh_info;
# generate output, adjust columns
my @out = [];
my @out_plain = [];
my @maxw = ();
my $line = 0;
my @minors_sorted = sort { $a <=> $b } keys %drbd;
my $max_minor = $minors_sorted[-1];
my $minor_width = $max_minor > 10 ? 1+int(log($max_minor)/log(10)) : 2;
for my $m (@minors_sorted) {
my $t = $drbd{$m};
my @used_by = exists $t->{xen_info} ? "xen-vbd: $t->{xen_info}"
: exists $t->{pv_info} ? pv_info $t->{pv_info}
: exists $t->{df_info} ? df_info $t->{df_info}
: exists $t->{virsh_info} ? virsh_info $t->{virsh_info}
: exists $t->{ll_dev_of} ? ll_dev_info $t->{ll_dev_of}
: ();
$out[$line] = [
sprintf("%*u:%s", $minor_width, $m, $t->{name} || "??not-found??"),
defined($t->{ll_dev}) ? "^^$t->{ll_dev}" : "",
$t->{conn},
$t->{role},
$t->{dstate},
@used_by
];
for (my $c = 0; $c < @{$out[$line]}; $c++) {
# strip color codes for column width calculation
my $w = $out[$line][$c];
$w =~ s/$ansi_color_re//og;
my $l = length($w) + 1;
$out_plain[$line][$c] = $w;
$maxw[$c] = $l unless $maxw[$c] and $l < $maxw[$c];
}
++$line;
if (defined $t->{sync}) {
$out[$line++] = [ $t->{sync} ];
}
}
for my $l (0 .. $#out) {
$_ = $out[$l];
for (my $c2 = 0; $c2 < @$_; $c2++) {
# printf columns don't know about escape codes, need to pad manually.
print $_->[$c2], ' ' x ($maxw[$c2] - length($out_plain[$l][$c2]));
}
print "\n";
}
drbd-utils-8.9.6/scripts/drbd.service 0000644 0001750 0001750 00000000556 12477305373 017510 0 ustar apoikos apoikos [Unit]
Description=DRBD -- please disable. Unless you are NOT using a cluster manager.
Wants=network.target sshd.service
After=network.target sshd.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/lib/drbd/drbd start
ExecStop=/lib/drbd/drbd stop
# Re-adjust everything on reload
ExecReload=/lib/drbd/drbd reload
[Install]
WantedBy=multi-user.target
drbd-utils-8.9.6/scripts/global_common.conf 0000644 0001750 0001750 00000004016 12477305373 020665 0 ustar apoikos apoikos # DRBD is the result of over a decade of development by LINBIT.
# In case you need professional services for DRBD or have
# feature requests visit http://www.linbit.com
global {
usage-count yes;
# minor-count dialog-refresh disable-ip-verification
# cmd-timeout-short 5; cmd-timeout-medium 121; cmd-timeout-long 600;
}
common {
handlers {
# These are EXAMPLE handlers only.
# They may have severe implications,
# like hard resetting the node under certain circumstances.
# Be careful when chosing your poison.
# pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
# pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
# local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";
# fence-peer "/usr/lib/drbd/crm-fence-peer.sh";
# split-brain "/usr/lib/drbd/notify-split-brain.sh root";
# out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh root";
# before-resync-target "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k";
# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;
}
startup {
# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb
}
options {
# cpu-mask on-no-data-accessible
}
disk {
# size on-io-error fencing disk-barrier disk-flushes
# disk-drain md-flushes resync-rate resync-after al-extents
# c-plan-ahead c-delay-target c-fill-target c-max-rate
# c-min-rate disk-timeout
}
net {
# protocol timeout max-epoch-size max-buffers unplug-watermark
# connect-int ping-int sndbuf-size rcvbuf-size ko-count
# allow-two-primaries cram-hmac-alg shared-secret after-sb-0pri
# after-sb-1pri after-sb-2pri always-asbp rr-conflict
# ping-timeout data-integrity-alg tcp-cork on-congestion
# congestion-fill congestion-extents csums-alg verify-alg
# use-rle
}
}
drbd-utils-8.9.6/scripts/crm-fence-peer.sh 0000755 0001750 0001750 00000101735 12615625471 020341 0 ustar apoikos apoikos #!/bin/bash
#
sed_rsc_location_suitable_for_string_compare()
{
# expected input: exactly one tag per line: "^[[:space:]]*<.*/?>$"
sed -ne '
# within the rsc_location constraint with that id,
// {
/<\/rsc_location>/q # done, if closing tag is found
s/^[[:space:]]*// # trim spaces
s/ *\bid="[^"]*"// # remove id tag
# print each attribute on its own line, by
: attr
h # remember the current (tail of the) line
# remove all but the first attribute, and print,
s/^\([^[:space:]]*[[:space:]][^= ]*="[^"]*"\).*$/\1/p
g # then restore the remembered line,
# and remove the first attribute.
s/^\([^[:space:]]*\)[[:space:]][^= ]*="[^"]*"\(.*\)$/\1\2/
# then repeat, until no more attributes are left
t attr
}' | sort
}
cibadmin_invocations=0
set_constraint()
{
cibadmin_invocations=$(( $cibadmin_invocations + 1 ))
cibadmin -C -o constraints -X "$new_constraint"
}
remove_constraint()
{
cibadmin_invocations=$(( $cibadmin_invocations + 1 ))
cibadmin -D -X ""
}
cib_xml=""
get_cib_xml() {
cibadmin_invocations=$(( $cibadmin_invocations + 1 ))
cib_xml=$( set +x; cibadmin "$@" )
}
# if not passed in, try to "guess" it from the cib
# we only know the DRBD_RESOURCE.
fence_peer_init()
{
# we know which instance we are: $OCF_RESOURCE_INSTANCE.
# but we do not know the xml ID of the :(
# cibadmin -Ql --xpath \
# '//master[primitive[@type="drbd" and instance_attributes/nvpair[@name = "drbd_resource" and @value="r0"]]]/@id'
# but I'd have to pipe that through sed anyways, because @attribute
# xpath queries are not supported.
# and I'd be incompatible with older cibadmin not supporting --xpath.
# be cool, sed it out:
: ${master_id=$(set +x; echo "$cib_xml" |
sed -ne '// {
/= deadtime, dc-timeout > timeout
# Intended use case: fencing resource-and-stonith, STONITH configured.
#
# Difference to a)
#
# If peer is still reachable according to the cib,
# we first poll the cib/try to confirm with crmadmin,
# until either crmadmin confirms reachability, timeout has elapsed,
# or the peer becomes definitely unreachable.
#
# This gives STONITH the chance to kill us.
# With "fencing resource-and-stontith;" this protects us against
# completing transactions to userland which might otherwise be lost.
#
# We then place the constraint (if we are UpToDate), as explained below,
# and return reachable/unreachable according to our last cib status poll
# or crmadmin -S result.
#
#
# replication link loss, current Primary calls this handler:
# We are UpToDate, but we potentially need to wait for a DC election.
# Once we have contacted the DC, we poll the cib until the peer is
# confirmed unreachable, or crmadmin -S confirms it as reachable,
# or timeout expired.
# Then we place the constraint, and are done.
#
# If it is complete communications loss, one will stonith the other.
# For two-node clusters with no-quorum-policy=ignore, we will have a
# deathmatch shoot-out, which the former DC is likely to win.
#
# In dual-primary setups, if it is only replication link loss, both nodes
# will call this handler, but only one will succeed to place the
# constraint. The other will then typically need to "commit suicide".
# With stonith enabled, and --suicide-on-failure-if-primary,
# we will trigger a node level fencing, telling
# pacemaker to "terminate" that node,
# and scheduling a reboot -f just in case.
#
# Primary crash, promotion of former Secondary:
# DC-election, if any, will have taken place already.
# We are UpToDate, we place the constraint, done.
#
# node or cluster crash, promotion of Secondary with replication link down:
# We are "Only" Consistent. Usually any "init-dead-time" or similar has
# expired already, and the cib node states are already authoritative
# without doing additional waiting. If the peer is still reachable, we
# place the constraint - if the peer had better data, it should have a
# higher master score, and we should not have been asked to become
# primary. If the peer is not reachable, we don't do anything, and DRBD
# will refuse to be promoted. This is necessary to avoid problems
# With data diversion, in case this "crash" was due to a STONITH operation,
# maybe the reboot did not fix our cluster communications!
#
# Note that typically, if STONITH is in use, it has been done on any
# unreachable node _before_ we are promoted, so the cib should already
# know that the peer is dead - if it is.
#
# slightly different logic than crm_is_true
crm_is_not_false()
{
case $1 in
no|n|false|0|off)
false ;;
*)
true ;;
esac
}
check_cluster_properties()
{
local x properties=$(set +x; echo "$cib_xml" |
sed -n -e '/ $SECONDS )) || break
sleep $(( net_hickup_time - SECONDS ))
done
set_states_from_proc_drbd
: == DEBUG == DRBD_peer=${DRBD_peer[*]} ===
: == DEBUG == DRBD_pdsk=${DRBD_pdsk[*]} ===
if $DRBD_pdsk_all_uptodate ; then
echo WARNING "All peer disks are UpToDate! Did not place the constraint."
rc=0
return
fi
: == DEBUG == CTS_mode=$CTS_mode ==
: == DEBUG == DRBD_disk_all_consistent=$DRBD_disk_all_consistent ==
: == DEBUG == DRBD_disk_all_uptodate=$DRBD_disk_all_uptodate ==
: == DEBUG == $peer_state/${DRBD_disk[*]}/$unreachable_peer_is ==
if [[ ${#DRBD_disk[*]} = 0 ]]; then
# Someone called this script, without the corresponding drbd
# resource being configured. That's not very useful.
echo WARNING "could not determine my disk state: did not place the constraint!"
rc=0
# keep drbd_fence_peer_exit_code at "generic error",
# which will cause a "script is broken" message in case it was
# indeed called as handler from within drbd
# No, NOT fenced/Consistent:
# just because we have been able to shoot him
# does not make our data any better.
elif [[ $peer_state = reachable ]] && $DRBD_disk_all_consistent; then
# = reachable ]] && $DRBD_disk_all_uptodate
# is implicitly handled here as well.
set_constraint &&
drbd_fence_peer_exit_code=4 rc=0 &&
echo INFO "peer is $peer_state, my disk is ${DRBD_disk[*]}: placed constraint '$id_prefix-$master_id'"
elif [[ $peer_state = fenced ]] && $DRBD_disk_all_uptodate ; then
set_constraint &&
drbd_fence_peer_exit_code=7 rc=0 &&
echo INFO "peer is $peer_state, my disk is $DRBD_disk: placed constraint '$id_prefix-$master_id'"
# Peer is neither "reachable" nor "fenced" (above would have matched)
# So we just hit some timeout.
# As long as we are UpToDate, place the constraint and continue.
# If you don't like that, use a ridiculously high timeout,
# or patch this script.
elif $DRBD_disk_all_uptodate ; then
# We could differentiate between unreachable,
# and DC-unreachable. In the latter case, placing the
# constraint will fail anyways, and drbd_fence_peer_exit_code
# will stay at "generic error".
set_constraint &&
drbd_fence_peer_exit_code=5 rc=0 &&
echo INFO "peer is not reachable, my disk is UpToDate: placed constraint '$id_prefix-$master_id'"
# This block is reachable by operator intervention only
# (unless you are hacking this script and know what you are doing)
elif [[ $peer_state != reachable ]] && [[ $unreachable_peer_is = outdated ]] && $DRBD_disk_all_consistent; then
# If the peer is not reachable, but we are only Consistent, we
# may need some way to still allow promotion.
# Easy way out: --force primary with drbdsetup.
# But that would not place the constraint, nor outdate the
# peer. With this --unreachable-peer-is-outdated, we still try
# to set the constraint. Next promotion attempt will find the
# "correct" constraint, consider the peer as successfully
# fenced, and continue.
set_constraint &&
drbd_fence_peer_exit_code=5 rc=0 &&
echo WARNING "peer is unreachable, my disk is only Consistent: --unreachable-peer-is-outdated FORCED constraint '$id_prefix-$master_id'" &&
echo WARNING "This MAY RISK DATA INTEGRITY"
# So I'm not UpToDate, and peer is not reachable.
# Tell the module about "not reachable", and don't do anything else.
else
echo WARNING "peer is $peer_state, my disk is ${DRBD_disk[*]}: did not place the constraint!"
drbd_fence_peer_exit_code=5 rc=0
# I'd like to return 6 here, otherwise pacemaker will retry
# forever to promote, even though 6 is not strictly correct.
fi
return $rc
}
commit_suicide()
{
local reboot_timeout=20
local extra_msg
if $stonith_enabled ; then
# avoid double fence, tell pacemaker to kill me
echo WARNING "trying to have pacemaker kill me now!"
crm_attribute -t status -N $HOSTNAME -n terminate -v 1
echo WARNING "told pacemaker to kill me, but scheduling reboot -f in 300 seconds just in case"
# -------------------------
echo WARNING $'\n'" told pacemaker to kill me,"\
$'\n'" but scheduling reboot -f in 300 seconds just in case."\
$'\n'" kill $$ # to cancel" | wall
# -------------------------
reboot_timeout=300
extra_msg="Pacemaker terminate pending. If that fails, I'm "
else
# -------------------------
echo WARNING $'\n'" going to reboot -f in $reboot_timeout seconds"\
$'\n'" kill $$ # to cancel!" | wall
# -------------------------
fi
reboot_timeout=$(( reboot_timeout + SECONDS ))
# pacemaker apparently cannot kill me.
while (( $SECONDS < $reboot_timeout )); do
echo WARNING "${extra_msg}going to reboot -f in $(( reboot_timeout - SECONDS )) seconds! To cancel: kill $$"
sleep 2
done
echo WARNING "going to reboot -f now!"
reboot -f
sleep 864000
}
# drbd_peer_fencing fence|unfence
drbd_peer_fencing()
{
local rc
# input to fence_peer_init:
# $DRBD_RESOURCE is set by command line of from environment.
# $id_prefix is set by command line or default.
# $master_id is set by command line or will be parsed from the cib.
# output of fence_peer_init:
local have_constraint new_constraint
# if I cannot query the local cib, give up
get_cib_xml -Ql || return
fence_peer_init || return
if [[ $1 = fence ]] || $unfence_only_if_owner_match ; then
if [[ $fencing_attribute = "#uname" ]]; then
fencing_value=$HOSTNAME
elif ! fencing_value=$(crm_attribute -Q -t nodes -n $fencing_attribute 2>/dev/null); then
fencing_attribute="#uname"
fencing_value=$HOSTNAME
fi
# double negation: do not run but with my data.
new_constraint="\
"
fi
case $1 in
fence)
local startup_fencing stonith_enabled
check_cluster_properties
if [[ -z $have_constraint ]] ; then
# try to place it.
try_place_constraint && return
# maybe callback and operator raced for the same constraint?
# before we potentially trigger node level fencing
# or keep IO frozen, double check.
# try_place_constraint has updated cib_xml from DC
have_constraint=$(set +x; echo "$cib_xml" |
sed_rsc_location_suitable_for_string_compare "$id_prefix-$master_id")
fi
if [[ "$have_constraint" = "$(set +x; echo "$new_constraint" |
sed_rsc_location_suitable_for_string_compare "$id_prefix-$master_id")" ]]; then
echo INFO "suitable constraint already placed: '$id_prefix-$master_id'"
drbd_fence_peer_exit_code=4
rc=0
elif [[ -n "$have_constraint" ]] ; then
# if this id already exists, but looks different, we may have lost a shootout
echo WARNING "constraint "$have_constraint" already exists"
# anything != 0 will do;
# 21 happend to be "The object already exists" with my cibadmin
rc=21
# maybe: drbd_fence_peer_exit_code=6
# as this is not the constraint we'd like to set,
# it is likely the inverse, so we probably can assume
# that the peer is active primary, or at least has
# better data than us, and wants us outdated.
fi
if [[ $rc != 0 ]]; then
# at least we tried.
# maybe it was already in place?
echo WARNING "DATA INTEGRITY at RISK: could not place the fencing constraint!"
fi
# XXX policy decision:
if $suicide_on_failure_if_primary && [[ $drbd_fence_peer_exit_code != [3457] ]]; then
set_states_from_proc_drbd
[[ "${DRBD_role[*]}" = *Primary* ]] && commit_suicide
fi
return $rc
;;
unfence)
if [[ -n $have_constraint ]]; then
set_states_from_proc_drbd
if $DRBD_disk_all_uptodate && $DRBD_pdsk_all_uptodate; then
if $unfence_only_if_owner_match && [[ "$have_constraint" != "$(set +x; echo "$new_constraint" |
sed_rsc_location_suitable_for_string_compare "$id_prefix-$master_id")" ]]
then
echo WARNING "Constraint owner does not match, leaving constraint in place."
else
# try to remove it based on that xml-id
remove_constraint && echo INFO "Removed constraint '$id_prefix-$master_id'"
fi
else
local w="My"
$DRBD_disk_all_uptodate && w="Peer's"
echo WARNING "$w disk(s) are NOT all UpToDate, leaving constraint in place."
return 1
fi
else
$quiet || echo "No constraint in place, nothing to do."
return 0
fi
esac
}
double_check_after_fencing()
{
set_states_from_proc_drbd
: == DEBUG == DRBD_peer=${DRBD_peer[*]} ===
: == DEBUG == DRBD_pdsk=${DRBD_pdsk[*]} ===
if $DRBD_pdsk_all_uptodate ; then
echo WARNING "All peer disks are UpToDate (again), trying to remove the constraint again."
remove_constraint && drbd_fence_peer_exit_code=1 rc=0
return
fi
}
guess_if_pacemaker_will_fence()
{
# try to guess whether it is useful to wait and poll again,
# (node fencing in progress...),
# or if pacemaker thinks the node is "clean" dead.
local x
# "return values:"
crmd= in_ccm= expected= join= will_fence=false
# Older pacemaker has an "ha" attribute, too.
# For stonith-enabled=false, the "crmd" attribute may stay "online",
# but once ha="dead", we can stop waiting for changes.
ha_dead=false
node_state=${node_state%>}
node_state=${node_state%/}
for x in ${node_state} ; do
case $x in
in_ccm=\"*\") x=${x#*=\"}; x=${x%\"}; in_ccm=$x ;;
crmd=\"*\") x=${x#*=\"}; x=${x%\"}; crmd=$x ;;
expected=\"*\") x=${x#*=\"}; x=${x%\"}; expected=$x ;;
join=\"*\") x=${x#*=\"}; x=${x%\"}; join=$x ;;
ha=\"dead\") ha_dead=true ;;
esac
done
# if it is not enabled, no point in waiting for it.
if ! $stonith_enabled ; then
# "normalize" the rest of the logic
# where this is called.
# for stonith-enabled=false, and ha="dead",
# reset crmd="offline".
# Then we stop polling the cib for changes.
$ha_dead && crmd="offline"
return
fi
if [[ -z $node_state ]] ; then
# if we don't know nothing about the peer,
# and startup_fencing is explicitly disabled,
# no fencing will take place.
$startup_fencing || return
fi
# for further inspiration, see pacemaker:lib/pengine/unpack.c, determine_online_status_fencing()
[[ -z $in_ccm ]] && will_fence=true
[[ $crmd = "banned" ]] && will_fence=true
if [[ ${expected-down} = "down" && $in_ccm = "false" && $crmd != "online" ]]; then
: "pacemaker considers this as clean down"
elif [[ $in_ccm = false ]] || [[ $crmd != "online" ]]; then
will_fence=true
fi
}
# return value in $peer_state:
# DC-unreachable
# We have not been able to contact the DC.
# fenced
# According to the node_state recorded in the cib,
# the peer is offline and expected down
# (which means successfully fenced, if stonith is enabled)
# reachable
# cib says it's online, and crmadmin -S says peer state is "ok"
# unreachable
# cib says it's offline (but does not yet say "expected" down)
# and we reached the timeout
# unknown
# cib does not say it was offline (or we don't know who the peer is)
# and we reached the timeout
#
check_peer_node_reachable()
{
# we are going to increase the cib timeout with every timeout (see below).
# for the actual invocation, we use int(cibtimeout/10).
# scaled by 5 / 4 with each iteration,
# this results in a timeout sequence of 1 2 2 3 4 5 6 7 9 ... seconds
local cibtimeout=18
local full_timeout
local nr_other_nodes
local other_node_uname_attrs
# we have a cibadmin -Ql in cib_xml already
# filter out $/\1/' |
grep -v -F uname=\"$HOSTNAME\")
set -- $other_node_uname_attrs
nr_other_nodes=$#
while :; do
local state_lines= node_state=
local crmd= in_ccm= expected= join= will_fence= ha_dead=
while :; do
local t=$SECONDS
#
# Update our view of the cib, ask the DC this time.
# Timeout, in case no DC is available.
# Caution, some cibadmin (pacemaker 0.6 and earlier)
# apparently use -t use milliseconds, so will timeout
# many times until a suitably long timeout is reached
# by increasing below.
#
# Why not use the default timeout?
# Because that would unecessarily wait for 30 seconds
# or longer, even if the DC is re-elected right now,
# and available within the next second.
#
get_cib_xml -Q -t $(( cibtimeout/10 )) && break
# bash magic $SECONDS is seconds since shell invocation.
if (( $SECONDS > $dc_timeout )) ; then
# unreachable: cannot even reach the DC
peer_state="DC-unreachable"
return
fi
# avoid busy loop
[[ $t = $SECONDS ]] && sleep 1
# try again, longer timeout.
let "cibtimeout = cibtimeout * 5 / 4"
done
state_lines=$( set +x; echo "$cib_xml" | grep ' 2 cluster.
# (yes, I've seen such beasts in the wild!)
# As we don't know the peer,
# we could only safely return here if *all*
# potential peers are confirmed down.
# Don't try to be smart, just wait for the full
# timeout, which should allow STONITH to
# complete.
full_timeout=$(( $timeout - $SECONDS ))
if (( $full_timeout > 0 )) ; then
echo WARNING "don't know who my peer is; sleep $full_timeout seconds just in case"
sleep $full_timeout
fi
# In the unlikely case that we don't know our DRBD peer,
# there is no point in polling the cib again,
# that won't teach us who our DRBD peer is.
#
# We waited $full_timeout seconds already,
# to allow for node level fencing to shoot us.
#
# So if we are still alive, then obviously no-one has shot us.
#
peer_state="unknown"
return
fi
#
# we know the peer or/and are a two node cluster
#
node_state=$(set +x; echo "$state_lines" | grep -F uname=\"$DRBD_PEER\")
# populates in_ccm, crmd, exxpected, join, will_fence=[false|true]
guess_if_pacemaker_will_fence
if ! $will_fence && [[ $crmd != "online" ]] ; then
# "legacy" cman + pacemaker clusters older than 1.1.10
# may "forget" about startup fencing.
# We can detect this because the "expected" attribute is missing.
# Does not make much difference for our logic, though.
[[ $expected/$in_ccm = "down/false" ]] && peer_state="fenced" || peer_state="unreachable"
return
fi
# So the cib does still indicate the peer was reachable.
#
# try crmadmin; if we can sucessfully query the state of the remote crmd,
# it is obviously reachable.
#
# Do this only after we have been able to reach a DC above.
# Note: crmadmin timeout is in milli-seconds, and defaults to 30000 (30 seconds).
# Our variable $cibtimeout should be in deci-seconds (see above)
# (unless you use a very old version of pacemaker, so don't do that).
# Convert deci-seconds to milli-seconds, and double it.
if [[ $crmd = "online" ]] ; then
local out
if out=$( crmadmin -t $(( cibtimeout * 200 )) -S $DRBD_PEER ) \
&& [[ $out = *"(ok)" ]]; then
peer_state="reachable"
return
fi
fi
# We know our DRBD peer.
# We are still not sure about its status, though.
#
# It is not (yet) "expected down" per the cib, but it is not
# reliably reachable via crmadmin -S either.
#
# If we already polled for longer than timeout, give up.
#
# For a resource-and-stonith setup, or dual-primaries (which
# you should only use with resource-and-stonith, anyways),
# the recommended timeout is larger than the deadtime or
# stonith timeout, and according to beekhof maybe should be
# tuned up to the election-timeout (which, btw, defaults to 2
# minutes!).
#
if (( $SECONDS >= $timeout )) ; then
[[ $crmd = offline ]] && peer_state="unreachable" || peer_state="unknown"
return
fi
# wait a bit before we poll the DC again
sleep 2
done
# NOT REACHED
}
set_states_from_proc_drbd()
{
local IFS line lines i disk pdsk
# DRBD_MINOR exported by drbdadm since 8.3.3
[[ $DRBD_MINOR ]] || DRBD_MINOR=$(drbdadm ${DRBD_CONF:+ -c "$DRBD_CONF"} sh-minor $DRBD_RESOURCE) || return
# if we have more than one minor, do a word split, ...
set -- $DRBD_MINOR
# ... and convert into regex:
IFS="|$IFS"; DRBD_MINOR="($*)"; IFS=${IFS#?}
# We must not recurse into netlink,
# this may be a callback triggered by "drbdsetup primary".
# grep /proc/drbd instead
DRBD_peer=()
DRBD_role=()
DRBD_disk=()
DRBD_pdsk=()
DRBD_disk_all_uptodate=true
DRBD_disk_all_consistent=true
DRBD_pdsk_all_uptodate=true
IFS=$'\n'
lines=($(sed -nre "/^ *$DRBD_MINOR: cs:/ { s/:/ /g; p; }" /proc/drbd))
IFS=$' \t\n'
i=0
for line in "${lines[@]}"; do
set -- $line
DRBD_peer[i]=${5#*/}
DRBD_role[i]=${5%/*}
pdsk=${7#*/}
disk=${7%/*}
DRBD_disk[i]=${disk:-Unconfigured}
DRBD_pdsk[i]=${pdsk:-DUnknown}
case $disk in
UpToDate) ;;
Consistent)
DRBD_disk_all_uptodate=false ;;
*)
DRBD_disk_all_uptodate=false
DRBD_disk_all_consistent=false ;;
esac
[[ $pdsk != UpToDate ]] && DRBD_pdsk_all_uptodate=false
let i++
done
if (( i = 0 )) ; then
DRBD_pdsk_all_uptodate=false
DRBD_disk_all_uptodate=false
DRBD_disk_all_consistent=false
fi
}
############################################################
# try to get possible output on stdout/err to syslog
PROG=${0##*/}
redirect_to_logger()
{
local lf=${1:-local5}
case $lf in
# do we want to exclude some?
auth|authpriv|cron|daemon|ftp|kern|lpr|mail|news|syslog|user|uucp|local[0-7])
: OK ;;
*)
echo >&2 "invalid logfacility: $lf"
return
;;
esac
# Funky redirection to avoid logger feeding its own output to itself accidentally.
# Funky double exec to avoid an intermediate sub-shell.
# Sometimes, the sub-shell lingers around, keeps file descriptors open,
# and logger then won't notice the main script has finished,
# forever waiting for further input.
# The second exec replaces the subshell, and logger will notice directly
# when its stdin is closed once the main script exits.
# This avoids the spurious logger processes.
exec > >( exec 1>&- 2>&- logger -t "$PROG[$$]" -p $lf.info ) 2>&1
}
if [[ $- != *x* ]]; then
# you may override with --logfacility below
redirect_to_logger local5
fi
# clean environment just in case.
unset fencing_attribute id_prefix timeout dc_timeout unreachable_peer_is
unset flock_timeout flock_required lock_dir lock_file
quiet=false
unfence_only_if_owner_match=false
CTS_mode=false
suicide_on_failure_if_primary=false
# poor mans command line argument parsing,
# allow for command line overrides
set -- "$@" $OCF_RESKEY_unfence_extra_args
while [[ $# != 0 ]]; do
case $1 in
--logfacility=*)
redirect_to_logger ${1#*=}
;;
--logfacility)
redirect_to_logger $2
shift
;;
--resource=*)
DRBD_RESOURCE=${1#*=}
;;
-r|--resource)
DRBD_RESOURCE=$2
shift
;;
--master-id=*)
master_id=${1#*=}
;;
-i|--master-id)
master_id=$2
shift
;;
--role=*)
role=${1#*=}
;;
-l|--role)
role=${2}
shift
;;
--fencing-attribute=*)
fencing_attribute=${1#*=}
;;
-a|--fencing-attribute)
fencing_attribute=$2
shift
;;
--id-prefix=*)
id_prefix=${1#*=}
;;
-p|--id-prefix)
id_prefix=$2
shift
;;
--timeout=*)
timeout=${1#*=}
;;
-t|--timeout)
timeout=$2
shift
;;
--dc-timeout=*)
dc_timeout=${1#*=}
;;
-d|--dc-timeout)
dc_timeout=$2
shift
;;
--quiet)
quiet=true
;;
--unfence-only-if-owner-match)
unfence_only_if_owner_match=true
;;
--flock-required)
flock_required=true
;;
--flock-timeout=*)
flock_timeout=${1#*=}
;;
--flock-timeout)
flock_timeout=$2
shift
;;
--lock-dir=*)
lock_dir=${1#*=}
;;
--lock-dir)
lock_dir=$2
shift
;;
--lock-file=*)
lock_file=${1#*=}
;;
--lock-file)
lock_file=$2
shift
;;
--net-hickup=*|--network-hickup=*)
net_hickup_time=${1#*=}
;;
--net-hickup|--network-hickup)
net_hickup_time=$2
shift
;;
--CTS-mode)
CTS_mode=true
;;
--unreachable-peer-is-outdated)
# This is NOT to be scripted.
# Or people will put this into the handler definition in
# drbd.conf, and all this nice work was useless.
test -t 0 &&
unreachable_peer_is=outdated
;;
--suicide-on-failure-if-primary)
suicide_on_failure_if_primary=true
;;
-*)
echo >&2 "ignoring unknown option $1"
;;
*)
echo >&2 "ignoring unexpected argument $1"
;;
esac
shift
done
#
# Sanitize lock_file and lock_dir
#
if [[ ${lock_dir:=/var/lock/drbd} != /* ]] ; then
echo WARNING "lock_dir needs to be an absolute path, not [$lock_dir]; using default."
lock_dir=/var/lock/drbd
fi
case $lock_file in
"") lock_file=$lock_dir/fence.${DRBD_RESOURCE//\//_} ;;
NONE) : ;;
/*) : ;;
*) lock_file=$lock_dir/$lock_file ;;
esac
if [[ $lock_file != NONE && $lock_file != $lock_dir/* ]]; then
lock_dir=${lock_file%/*}; : ${lock_dir:=/}
: == DEBUG == "override: lock_dir=$lock_dir to match lock_file=$lock_file"
fi
# DRBD_RESOURCE: from environment
# master_id: parsed from cib
: "== unreachable_peer_is == ${unreachable_peer_is:=unknown}"
# apply defaults:
: "== fencing_attribute == ${fencing_attribute:="#uname"}"
: "== id_prefix == ${id_prefix:="drbd-fence-by-handler"}"
: "== role == ${role:="Master"}"
# defaults suitable for most cases
: "== net_hickup_time == ${net_hickup_time:=0}"
: "== timeout == ${timeout:=90}"
: "== dc_timeout == ${dc_timeout:=20}"
: "== flock_timeout == ${flock_timeout:=120}"
: "== flock_required == ${flock_required:=false}"
: "== lock_file == ${lock_file}"
: "== lock_dir == ${lock_dir}"
# check envars normally passed in by drbdadm
# TODO DRBD_CONF is also passed in. we may need to use it in the
# xpath query, in case someone is crazy enough to use different
# conf files with the _same_ resource name.
# for now: do not do that, or hardcode the cib id of the master
# in the handler section of your drbd conf file.
for var in DRBD_RESOURCE; do
if [ -z "${!var}" ]; then
echo "Environment variable \$$var not found (this is normally passed in by drbdadm)." >&2
exit 1
fi
done
# Fixup id-prefix to include the resource name
# There may be multiple drbd instances part of the same M/S Group, pointing to
# the same master-id. Still they need to all have their own constraint, to be
# able to unfence independently when they finish their resync independently.
# Be nice to people who already explicitly configure an id prefix containing
# the resource name.
if [[ $id_prefix != *"-$DRBD_RESOURCE" ]] ; then
id_prefix="$id_prefix-$DRBD_RESOURCE"
: "== id_prefix == ${id_prefix}"
fi
# make sure it contains what we expect
HOSTNAME=$(uname -n)
$quiet || echo "invoked for $DRBD_RESOURCE${master_id:+" (master-id: $master_id)"}"
# to be set by drbd_peer_fencing()
drbd_fence_peer_exit_code=1
got_flock=false
if [[ $lock_file != NONE ]] ; then
test -d "$lock_dir" ||
mkdir -p -m 0700 "$lock_dir" ||
echo WARNING "mkdir -p $lock_dir failed"
if exec 9>"$lock_file" && flock --exclusive --timeout $flock_timeout 9
then
got_flock=true
else
echo WARNING "Could not get flock on $lock_file"
$flock_required && exit 1
# If I cannot get the lock file, I can at least still try to place the constraint
fi
: == DEBUG == $SECONDS seconds, got_flock=$got_flock ==
fi
case $PROG in
crm-fence-peer.sh)
if drbd_peer_fencing fence; then
: == DEBUG == $cibadmin_invocations cibadmin calls ==
: == DEBUG == $SECONDS seconds ==
[[ $drbd_fence_peer_exit_code = [347] ]] && double_check_after_fencing
exit $drbd_fence_peer_exit_code
fi
;;
crm-unfence-peer.sh)
if drbd_peer_fencing unfence; then
: == DEBUG == $cibadmin_invocations cibadmin calls ==
: == DEBUG == $SECONDS seconds ==
exit 0
fi
esac 9>&- # Don't want to "leak" the lock fd to child processes.
# 1: unexpected error
exit 1
drbd-utils-8.9.6/scripts/drbd.gentoo 0000644 0001750 0001750 00000007025 12466702073 017335 0 ustar apoikos apoikos #!/sbin/runscript
# Distributed under the terms of the GNU General Public License v2
# Copright 2001-2008 LINBIT Information Technologies
# Philipp Reisner, Lars Ellenberg
# Original script adapted to gentoo environment
# I so do not see why gentoo would need it's own init script.
# But if you think it does, well, you get to fix it.
# See what we do in the generic one.
echo "FIXME, contributers welcome. This is broken for 8.4" >&2
exit 255
depend() {
use logger
need net
before heartbeat
after sshd
}
opts="${opts} reload"
DEFAULTFILE="/etc/conf.d/drbd"
DRBDADM="/sbin/drbdadm"
PROC_DRBD="/proc/drbd"
MODPROBE="/sbin/modprobe"
RMMOD="/sbin/rmmod"
UDEV_TIMEOUT=10
ADD_MOD_PARAM=""
if [ -f $DEFAULTFILE ]; then
. $DEFAULTFILE
fi
# Just in case drbdadm want to display any errors in the configuration
# file, or we need to ask the user about registering this installation
# at http://usage.drbd.org, we call drbdadm here without any IO
# redirection.
$DRBDADM sh-nop
function assure_module_is_loaded
{
[ -e "$PROC_DRBD" ] && return
ebegin "Loading drbd module"
ret=0
$MODPROBE -s drbd `$DRBDADM sh-mod-parms` $ADD_MOD_PARAM || ret=20
eend $ret
return $ret
}
function adjust_with_progress
{
IFS_O=$IFS
NEWLINE='
'
IFS=$NEWLINE
local D=0
local S=0
local N=0
einfon "Setting drbd parameters "
COMMANDS=`$DRBDADM -d adjust all` || {
eend 20 "Error executing drbdadm"
return 20
}
echo -n "[ "
for CMD in $COMMANDS; do
if echo $CMD | grep -q disk; then echo -n "d$D "; D=$(( D+1 ));
elif echo $CMD | grep -q syncer; then echo -n "s$S "; S=$(( S+1 ));
elif echo $CMD | grep -q net; then echo -n "n$N "; N=$(( N+1 ));
else echo echo -n ".. ";
fi
IFS=$IFS_O
$CMD || {
echo
eend 20 "cmd $CMD failed!"
return 20
}
IFS=$NEWLINE
done
echo "]"
eend 0
IFS=$IFS_O
}
start() {
einfo "Starting DRBD resources:"
eindent
assure_module_is_loaded || return $?
adjust_with_progress || return $?
# make sure udev has time to create the device files
ebegin "Waiting for udev device creation ..."
for RESOURCE in `$DRBDADM sh-resources`; do
for DEVICE in `$DRBDADM sh-dev $RESOURCE`; do
UDEV_TIMEOUT_LOCAL=$UDEV_TIMEOUT
while [ ! -e $DEVICE ] && [ $UDEV_TIMEOUT_LOCAL -gt 0 ] ; do
sleep 1
UDEV_TIMEOUT_LOCAL=$(( $UDEV_TIMEOUT_LOCAL-1 ))
done
done
done
eend 0
einfon "Waiting for connection "
$DRBDADM wait-con-int
echo
ret=$?
eend $ret
return $ret
}
stop() {
ebegin "Stopping all DRBD resources"
# Check for mounted drbd devices
if ! grep -q '^/dev/drbd' /proc/mounts &>/dev/null; then
if [ -e ${PROC_DRBD} ]; then
${DRBDADM} down all
${RMMOD} drbd
fi
ret=$?
eend $ret
return $ret
else
einfo "drbd devices mounted, please umount them before trying to stop drbd!"
eend 1
return 1
fi
}
status() {
# NEEDS to be heartbeat friendly...
# so: put some "OK" in the output.
if [ -e $PROC_DRBD ]; then
ret=0
ebegin "drbd driver loaded OK; device status:"
eend $ret
cat $PROC_DRBD
else
ebegin "drbd not loaded"
ret=3
eend $ret
fi
return $ret
}
reload() {
ebegin "Reloading DRBD"
${DRBDADM} adjust all
ret=$?
eend $ret
return $ret
}
drbd-utils-8.9.6/scripts/pretty-proc-drbd.sh 0000644 0001750 0001750 00000007420 12466702073 020741 0 ustar apoikos apoikos #!/bin/bash
PATH=/sbin:$PATH
DEFAULTS=/etc/defaults/drbd-pretty-status
# for highlighting see console_codes(4)
colorize=false
short=true
# node role: Primary Secondary Unknown
c_pri_1=$'\e[44m' c_pri_0=$'\e[49m'
#c_sec_1=$'\e[7m' c_sec_0=$'\e[27m'
c_sec_1="" c_sec_0=""
c_unk_1=$'\e[43m' c_unk_0=$'\e[49m'
# connection state:
# Unconfigured
#
# StandAlone
c_sta_1=$'\e[34m' c_sta_0=$'\e[39m'
# Disconnecting Unconnected Timeout BrokenPipe NetworkFailure ProtocolError TearDown
c_net_bad_1=$'\e[41m' c_net_bad_0=$'\e[49m'
# WFConnection WFReportParams
c_wfc_1=$'\e[36m' c_wfc_0=$'\e[39m'
# Connected
c_con_1=$'\e[32m' c_con_0=$'\e[39m'
# StartingSyncS StartingSyncT WFBitMapS WFBitMapT WFSyncUUID
c_ssy_1=$'\e[35m' c_ssy_0=$'\e[39m'
# SyncSource PausedSyncS
c_src_1=$'\e[46m' c_src_0=$'\e[49m'
# SyncTarget PausedSyncT
c_tgt_1=$'\e[41m' c_tgt_0=$'\e[49m'
# disk state:
# Attaching Negotiating DUnknown Consistent
# uncolored for now
#
# Diskless Failed Inconsistent
c_dsk_bad_1=$'\e[41m' c_dsk_bad_0=$'\e[49m'
# Outdated
c_out_1=$'\e[43m' c_out_0=$'\e[44m'
# UpToDate
c_u2d_1=$'\e[32m' c_u2d_0=$'\e[39m'
while true; do
case "$1" in
-c) colorize=true; shift;;
-v) short=false; shift;;
*) break;;
esac
done
drbd_pretty_status()
{
if ! $short ||
! type column &> /dev/null ||
! type paste &> /dev/null ||
! type join &> /dev/null ||
! type sed &> /dev/null ||
! type tr &> /dev/null
then
cat /proc/drbd
else
sed -e '2q' < /proc/drbd
sed_script=$(
i=0;
_sh_status_process() {
let i++ ;
stacked=${_stacked_on:+"^^${_stacked_on_minor:-${_stacked_on//[!a-zA-Z0-9_ -]/_}}"}
printf "s|^ *%u:|%6u\t&%s%s|\n" \
$_minor $i \
"${_res_name//[!a-zA-Z0-9_ -]/_}" "$stacked"
};
eval "$(drbdadm sh-status)" )
p() {
sed -e "1,2d" \
-e "$sed_script" \
-e '/^ *[0-9]\+: cs:Unconfigured/d;' \
-e 's/^\(.* cs:.*[^ ]\) \([rs]...\)$/\1 - \2/g' \
-e 's/^\(.* \)cs:\([^ ]* \)st:\([^ ]* \)ds:\([^ ]*\)/\1\2\3\4/' \
-e 's/^\(.* \)cs:\([^ ]* \)ro:\([^ ]* \)ds:\([^ ]*\)/\1\2\3\4/' \
-e 's/^\(.* \)cs:\([^ ]*\)$/\1\2/' \
-e 's/^ *[0-9]\+:/ x &??not-found??/;' \
-e '/^$/d;/ns:.*nr:.*dw:/d;/resync:/d;/act_log:/d;' \
-e 's/^\(.\[.*\)\(sync.ed:\)/... ... \2/;/^.finish:/d;' \
-e 's/^\(.[0-9 %]*oos:\)/... ... \1/' \
< "/proc/drbd" | tr -s '\t ' ' '
}
m() {
join -1 2 -2 1 -o 1.1,2.2,2.3 \
<( ( drbdadm sh-dev all ; drbdadm -S sh-dev all ) | cat -n | sort -k2,2) \
<(sort < /proc/mounts ) |
sort -n | tr -s '\t ' ' ' | sed -e 's/^ *//'
}
# echo "=== p ==="
# p
# echo "=== m ==="
# m
# echo "========="
# join -a1 <(p|sort) <(m|sort)
# echo "========="
(
echo m:res cs ro ds p mounted fstype
join -a1 <(p|sort) <(m|sort) | cut -d' ' -f2-6,8- | sort -k1,1n -k2,2
) | column -t
fi |
if [[ $colorize != true ]]; then
cat
else
c_bold=$'\e[1m' c_norm=$'\e[0m'
sed -e "
s/^??not-found??/$c_dsk_bad_1&$c_dsk_bad_0/g;
s/^[^\t ]\+/$c_bold&$c_norm/;
s/Primary/$c_pri_1&$c_pri_0/g;
s/Secondary/$c_sec_1&$c_sec_0/g;
s/\