1DRBDSETUP(8) System Administration DRBDSETUP(8)
2
3
4
6 drbdsetup - Setup tool for DRBD
7
9 drbdsetup new-resource resource [--cpu-mask {val}]
10 [--on-no-data-accessible {io-error | suspend-io}]
11
12 drbdsetup new-minor resource minor volume
13
14 drbdsetup del-resource resource
15
16 drbdsetup del-minor minor
17
18 drbdsetup attach minor lower_dev meta_data_dev meta_data_index
19 [--size {val}] [--max-bio-bvecs {val}]
20 [--on-io-error {pass_on | call-local-io-error | detach}]
21 [--fencing {dont-care | resource-only | resource-and-stonith}]
22 [--disk-barrier] [--disk-flushes] [--disk-drain]
23 [--md-flushes] [--resync-rate {val}] [--resync-after {val}]
24 [--al-extents {val}] [--al-updates]
25 [--discard-zeroes-if-aligned] [--disable-write-same]
26 [--c-plan-ahead {val}] [--c-delay-target {val}]
27 [--c-fill-target {val}] [--c-max-rate {val}]
28 [--c-min-rate {val}] [--disk-timeout {val}]
29 [--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}]
30 [--rs-discard-granularity {val}]
31
32 drbdsetup connect resource local_addr remote_addr [--tentative]
33 [--discard-my-data] [--protocol {A | B | C}]
34 [--timeout {val}] [--max-epoch-size {val}]
35 [--max-buffers {val}] [--unplug-watermark {val}]
36 [--connect-int {val}] [--ping-int {val}]
37 [--sndbuf-size {val}] [--rcvbuf-size {val}]
38 [--ko-count {val}] [--allow-two-primaries]
39 [--cram-hmac-alg {val}] [--shared-secret {val}]
40 [--after-sb-0pri {disconnect | discard-younger-primary | discard-older-primary | discard-zero-changes | discard-least-changes | discard-local | discard-remote}]
41 [--after-sb-1pri {disconnect | consensus | discard-secondary | call-pri-lost-after-sb | violently-as0p}]
42 [--after-sb-2pri {disconnect | call-pri-lost-after-sb | violently-as0p}]
43 [--always-asbp]
44 [--rr-conflict {disconnect | call-pri-lost | violently}]
45 [--ping-timeout {val}] [--data-integrity-alg {val}]
46 [--tcp-cork]
47 [--on-congestion {block | pull-ahead | disconnect}]
48 [--congestion-fill {val}] [--congestion-extents {val}]
49 [--csums-alg {val}] [--csums-after-crash-only]
50 [--verify-alg {val}] [--use-rle]
51 [--socket-check-timeout {val}]
52
53 drbdsetup disk-options minor
54 [--on-io-error {pass_on | call-local-io-error | detach}]
55 [--fencing {dont-care | resource-only | resource-and-stonith}]
56 [--disk-barrier] [--disk-flushes] [--disk-drain]
57 [--md-flushes] [--resync-rate {val}] [--resync-after {val}]
58 [--al-extents {val}] [--al-updates]
59 [--discard-zeroes-if-aligned] [--disable-write-same]
60 [--c-plan-ahead {val}] [--c-delay-target {val}]
61 [--c-fill-target {val}] [--c-max-rate {val}]
62 [--c-min-rate {val}] [--disk-timeout {val}]
63 [--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}]
64 [--rs-discard-granularity {val}]
65
66 drbdsetup net-options local_addr remote_addr [--protocol {A | B | C}]
67 [--timeout {val}] [--max-epoch-size {val}]
68 [--max-buffers {val}] [--unplug-watermark {val}]
69 [--connect-int {val}] [--ping-int {val}]
70 [--sndbuf-size {val}] [--rcvbuf-size {val}]
71 [--ko-count {val}] [--allow-two-primaries]
72 [--cram-hmac-alg {val}] [--shared-secret {val}]
73 [--after-sb-0pri {disconnect | discard-younger-primary | discard-older-primary | discard-zero-changes | discard-least-changes | discard-local | discard-remote}]
74 [--after-sb-1pri {disconnect | consensus | discard-secondary | call-pri-lost-after-sb | violently-as0p}]
75 [--after-sb-2pri {disconnect | call-pri-lost-after-sb | violently-as0p}]
76 [--always-asbp]
77 [--rr-conflict {disconnect | call-pri-lost | violently}]
78 [--ping-timeout {val}] [--data-integrity-alg {val}]
79 [--tcp-cork]
80 [--on-congestion {block | pull-ahead | disconnect}]
81 [--congestion-fill {val}] [--congestion-extents {val}]
82 [--csums-alg {val}] [--csums-after-crash-only]
83 [--verify-alg {val}] [--use-rle]
84 [--socket-check-timeout {val}]
85
86 drbdsetup resource-options resource [--cpu-mask {val}]
87 [--on-no-data-accessible {io-error | suspend-io}]
88
89 drbdsetup disconnect local_addr remote_addr [--force]
90
91 drbdsetup detach minor [--force]
92
93 drbdsetup primary minor [--force]
94
95 drbdsetup secondary minor
96
97 drbdsetup down resource
98
99 drbdsetup verify minor [--start {val}] [--stop {val}]
100
101 drbdsetup invalidate minor
102
103 drbdsetup invalidate-remote minor
104
105 drbdsetup wait-connect minor [--wfc-timeout {val}]
106 [--degr-wfc-timeout {val}] [--outdated-wfc-timeout {val}]
107 [--wait-after-sb {val}]
108
109 drbdsetup wait-sync minor [--wfc-timeout {val}]
110 [--degr-wfc-timeout {val}] [--outdated-wfc-timeout {val}]
111 [--wait-after-sb {val}]
112
113 drbdsetup role minor
114
115 drbdsetup cstate minor
116
117 drbdsetup dstate minor
118
119 drbdsetup resize minor [--size {val}] [--assume-peer-has-space]
120 [--assume-clean] [--al-stripes {val}]
121 [--al-stripe-size-kB {val}]
122
123 drbdsetup check-resize minor
124
125 drbdsetup pause-sync minor
126
127 drbdsetup resume-sync minor
128
129 drbdsetup outdate minor
130
131 drbdsetup show-gi minor
132
133 drbdsetup get-gi minor
134
135 drbdsetup show {resource | minor | all}
136
137 drbdsetup suspend-io minor
138
139 drbdsetup resume-io minor
140
141 drbdsetup status {resource | all} [--color {val}]
142
143 drbdsetup events2 {resource | all}
144
145 drbdsetup events {resource | minor | all}
146
147 drbdsetup new-current-uuid minor [--clear-bitmap]
148
150 drbdsetup is used to associate DRBD devices with their backing block
151 devices, to set up DRBD device pairs to mirror their backing block
152 devices, and to inspect the configuration of running DRBD devices.
153
155 drbdsetup is a low level tool of the DRBD program suite. It is used by
156 the data disk and drbd scripts to communicate with the device driver.
157
159 Each drbdsetup sub-command might require arguments and bring its own
160 set of options. All values have default units which might be overruled
161 by K, M or G. These units are defined in the usual way (e.g. K = 2^10 =
162 1024).
163
164 Common options
165 All drbdsetup sub-commands accept these two options
166
167 --create-device
168 In case the specified DRBD device (minor number) does not exist
169 yet, create it implicitly.
170
171 new-resource
172 Resources are the primary objects of any DRBD configuration. A resource
173 must be created with the new-resource command before any volumes or
174 minor devices can be created. Connections are referenced by name.
175
176 new-minor
177 A minor is used as a synonym for replicated block device. It is
178 represented in the /dev/ directory by a block device. It is the
179 application's interface to the DRBD-replicated block devices. These
180 block devices get addressed by their minor numbers on the drbdsetup
181 commandline.
182
183 A pair of replicated block devices may have different minor numbers on
184 the two machines. They are associated by a common volume-number. Volume
185 numbers are local to each connection. Minor numbers are global on one
186 node.
187
188 del-resource
189 Destroys a resource object. This is only possible if the resource has
190 no volumes.
191
192 del-minor
193 Minors can only be destroyed if its disk is detached.
194
195 attach, disk-options
196 Attach associates device with lower_device to store its data blocks on.
197 The -d (or --disk-size) should only be used if you wish not to use as
198 much as possible from the backing block devices. If you do not use -d,
199 the device is only ready for use as soon as it was connected to its
200 peer once. (See the net command.)
201
202 With the disk-options command it is possible to change the options of a
203 minor while it is attached.
204
205 --disk-size size
206 You can override DRBD's size determination method with this option.
207 If you need to use the device before it was ever connected to its
208 peer, use this option to pass the size of the DRBD device to the
209 driver. Default unit is sectors (1s = 512 bytes).
210
211 If you use the size parameter in drbd.conf, we strongly recommend
212 to add an explicit unit postfix. drbdadm and drbdsetup used to have
213 mismatching default units.
214
215 --on-io-error err_handler
216 If the driver of the lower_device reports an error to DRBD, DRBD
217 will mark the disk as inconsistent, call a helper program, or
218 detach the device from its backing storage and perform all further
219 IO by requesting it from the peer. The valid err_handlers are:
220 pass_on, call-local-io-error and detach.
221
222 --fencing fencing_policy
223 Under fencing we understand preventive measures to avoid situations
224 where both nodes are primary and disconnected (AKA split brain).
225
226 Valid fencing policies are:
227
228 dont-care
229 This is the default policy. No fencing actions are done.
230
231 resource-only
232 If a node becomes a disconnected primary, it tries to outdate
233 the peer's disk. This is done by calling the fence-peer
234 handler. The handler is supposed to reach the other node over
235 alternative communication paths and call 'drbdadm outdate res'
236 there.
237
238 resource-and-stonith
239 If a node becomes a disconnected primary, it freezes all its IO
240 operations and calls its fence-peer handler. The fence-peer
241 handler is supposed to reach the peer over alternative
242 communication paths and call 'drbdadm outdate res' there. In
243 case it cannot reach the peer, it should stonith the peer. IO
244 is resumed as soon as the situation is resolved. In case your
245 handler fails, you can resume IO with the resume-io command.
246
247 --disk-barrier,
248 --disk-flushes,
249 --disk-drain
250 DRBD has four implementations to express write-after-write
251 dependencies to its backing storage device. DRBD will use the first
252 method that is supported by the backing storage device and that is
253 not disabled. By default the flush method is used.
254
255 Since drbd-8.4.2 disk-barrier is disabled by default because since
256 linux-2.6.36 (or 2.6.32 RHEL6) there is no reliable way to
257 determine if queuing of IO-barriers works. Dangerous only enable
258 if you are told so by one that knows for sure.
259
260 When selecting the method you should not only base your decision on
261 the measurable performance. In case your backing storage device has
262 a volatile write cache (plain disks, RAID of plain disks) you
263 should use one of the first two. In case your backing storage
264 device has battery-backed write cache you may go with option 3.
265 Option 4 (disable everything, use "none") is dangerous on most IO
266 stacks, may result in write-reordering, and if so, can
267 theoretically be the reason for data corruption, or disturb the
268 DRBD protocol, causing spurious disconnect/reconnect cycles. Do
269 not use no-disk-drain.
270
271 Unfortunately device mapper (LVM) might not support barriers.
272
273 The letter after "wo:" in /proc/drbd indicates with method is
274 currently in use for a device: b, f, d, n. The implementations:
275
276 barrier
277 The first requires that the driver of the backing storage
278 device support barriers (called 'tagged command queuing' in
279 SCSI and 'native command queuing' in SATA speak). The use of
280 this method can be enabled by setting the disk-barrier options
281 to yes.
282
283 flush
284 The second requires that the backing device support disk
285 flushes (called 'force unit access' in the drive vendors
286 speak). The use of this method can be disabled setting
287 disk-flushes to no.
288
289 drain
290 The third method is simply to let write requests drain before
291 write requests of a new reordering domain are issued. That was
292 the only implementation before 8.0.9.
293
294 none
295 The fourth method is to not express write-after-write
296 dependencies to the backing store at all, by also specifying
297 --no-disk-drain. This is dangerous on most IO stacks, may
298 result in write-reordering, and if so, can theoretically be the
299 reason for data corruption, or disturb the DRBD protocol,
300 causing spurious disconnect/reconnect cycles. Do not use
301 --no-disk-drain.
302
303 --md-flushes
304 Disables the use of disk flushes and barrier BIOs when accessing
305 the meta data device. See the notes on --disk-flushes.
306
307 --max-bio-bvecs
308 In some special circumstances the device mapper stack manages to
309 pass BIOs to DRBD that violate the constraints that are set forth
310 by DRBD's merge_bvec() function and which have more than one bvec.
311 A known example is: phys-disk -> DRBD -> LVM -> Xen -> misaligned
312 partition (63) -> DomU FS. Then you might see "bio would need to,
313 but cannot, be split:" in the Dom0's kernel log.
314
315 The best workaround is to proper align the partition within the VM
316 (E.g. start it at sector 1024). That costs 480 KiB of storage.
317 Unfortunately the default of most Linux partitioning tools is to
318 start the first partition at an odd number (63). Therefore most
319 distributions install helpers for virtual linux machines will end
320 up with misaligned partitions. The second best workaround is to
321 limit DRBD's max bvecs per BIO (i.e., the max-bio-bvecs option) to
322 1, but that might cost performance.
323
324 The default value of max-bio-bvecs is 0, which means that there is
325 no user imposed limitation.
326
327 --resync-rate rate
328 To ensure smooth operation of the application on top of DRBD, it is
329 possible to limit the bandwidth that may be used by background
330 synchronization. The default is 250 KiB/sec, the default unit is
331 KiB/sec.
332
333 --resync-after minor
334 Start resync on this device only if the device with minor is
335 already in connected state. Otherwise this device waits in
336 SyncPause state.
337
338 --al-extents extents
339 DRBD automatically performs hot area detection. With this parameter
340 you control how big the hot area (=active set) can get. Each extent
341 marks 4M of the backing storage. In case a primary node leaves the
342 cluster unexpectedly, the areas covered by the active set must be
343 resynced upon rejoining of the failed node. The data structure is
344 stored in the meta-data area, therefore each change of the active
345 set is a write operation to the meta-data device. A higher number
346 of extents gives longer resync times but less updates to the
347 meta-data. The default number of extents is 1237. (Minimum: 7,
348 Maximum: 65534)
349
350 See also drbd.conf(5) and drbdmeta(8) for additional limitations
351 and necessary preparation.
352
353 --al-updates {yes | no}
354 DRBD's activity log transaction writing makes it possible, that
355 after the crash of a primary node a partial (bit-map based) resync
356 is sufficient to bring the node back to up-to-date. Setting
357 al-updates to no might increase normal operation performance but
358 causes DRBD to do a full resync when a crashed primary gets
359 reconnected. The default value is yes.
360
361 --c-plan-ahead plan_time,
362 --c-fill-target fill_target,
363 --c-delay-target delay_target,
364 --c-max-rate max_rate
365 The dynamic resync speed controller gets enabled with setting
366 plan_time to a positive value. It aims to fill the buffers along
367 the data path with either a constant amount of data fill_target, or
368 aims to have a constant delay time of delay_target along the path.
369 The controller has an upper bound of max_rate.
370
371 By plan_time the agility of the controller is configured. Higher
372 values yield for slower/lower responses of the controller to
373 deviation from the target value. It should be at least 5 times RTT.
374 For regular data paths a fill_target in the area of 4k to 100k is
375 appropriate. For a setup that contains drbd-proxy it is advisable
376 to use delay_target instead. Only when fill_target is set to 0 the
377 controller will use delay_target. 5 times RTT is a reasonable
378 starting value. Max_rate should be set to the bandwidth available
379 between the DRBD-hosts and the machines hosting DRBD-proxy, or to
380 the available disk-bandwidth.
381
382 The default value of plan_time is 0, the default unit is 0.1
383 seconds. Fill_target has 0 and sectors as default unit.
384 Delay_target has 1 (100ms) and 0.1 as default unit. Max_rate has
385 10240 (100MiB/s) and KiB/s as default unit.
386
387 --c-min-rate min_rate
388 We track the disk IO rate caused by the resync, so we can detect
389 non-resync IO on the lower level device. If the lower level device
390 seems to be busy, and the current resync rate is above min_rate, we
391 throttle the resync.
392
393 The default value of min_rate is 4M, the default unit is k. If you
394 want to not throttle at all, set it to zero, if you want to
395 throttle always, set it to one.
396
397 -t, --disk-timeout disk_timeout
398 If the lower-level device on which a DRBD device stores its data
399 does not finish an I/O request within the defined disk-timeout,
400 DRBD treats this as a failure. The lower-level device is detached,
401 and the device's disk state advances to Diskless. If DRBD is
402 connected to one or more peers, the failed request is passed on to
403 one of them.
404
405 This option is dangerous and may lead to kernel panic!
406
407 "Aborting" requests, or force-detaching the disk, is intended for
408 completely blocked/hung local backing devices which do no longer
409 complete requests at all, not even do error completions. In this
410 situation, usually a hard-reset and failover is the only way out.
411
412 By "aborting", basically faking a local error-completion, we allow
413 for a more graceful swichover by cleanly migrating services. Still
414 the affected node has to be rebooted "soon".
415
416 By completing these requests, we allow the upper layers to re-use
417 the associated data pages.
418
419 If later the local backing device "recovers", and now DMAs some
420 data from disk into the original request pages, in the best case it
421 will just put random data into unused pages; but typically it will
422 corrupt meanwhile completely unrelated data, causing all sorts of
423 damage.
424
425 Which means delayed successful completion, especially for READ
426 requests, is a reason to panic(). We assume that a delayed *error*
427 completion is OK, though we still will complain noisily about it.
428
429 The default value of disk-timeout is 0, which stands for an
430 infinite timeout. Timeouts are specified in units of 0.1 seconds.
431 This option is available since DRBD 8.3.12.
432
433 --discard-zeroes-if-aligned {yes | no}
434 Setting discard-zeroes-if-aligned to no will cause DRBD to always
435 fall-back to zero-out on the receiving side, and to not even
436 announce discard capabilities on the Primary, if the respective
437 backend announces discard_zeroes_data=false.
438
439 Setting discards-zeroes-if-aligned to yes will allow DRBD to use
440 discards, and to announce discard_zeroes=true, even on backends
441 that announce discard_zeroes_data=false.
442
443 We used to ignore the discard_zeroes_data setting completely. To
444 not break established and expected behaviour, the default value is
445 yes.
446
447 This option is available since 8.4.7. See also drbd.conf(5).
448
449 --disable-write-same {yes | no}
450
451 Some disks announce WRITE_SAME support to the kernel but fail with
452 an I/O error upon actually receiving such a request. This mostly
453 happens when using virtualized disks -- notably, this behavior has
454 been observed with VMware's virtual disks.
455
456 When disable-write-same is set to yes, WRITE_SAME detection is
457 manually overriden and support is disabled.
458
459 The default value of disable-write-same is no. This option is
460 available since 8.4.7.
461
462 --read-balancing method
463 The supported methods for load balancing of read requests are
464 prefer-local, prefer-remote, round-robin, least-pending and
465 when-congested-remote, 32K-striping, 64K-striping, 128K-striping,
466 256K-striping, 512K-striping and 1M-striping.
467
468 The default value of read-balancing is prefer-local. This option is
469 available since 8.4.1.
470
471 --rs-discard-granularity bytes
472 When rs-discard-granularity is set to a non zero, positive value
473 then DRBD tries to do a resync operation in requests of this size.
474 In case such a block contains only zero bytes on the sync source
475 node, the sync target node will issue a discard/trim/unmap command
476 for the area.
477
478 The value is constrained by the discard granularity of the backing
479 block device. In case rs-discard-granularity is not a multiplier of
480 the discard granularity of the backing block device DRBD rounds it
481 up. The feature only gets active if the backing block device reads
482 back zeroes after a discard command.
483
484 The default value of rs-discard-granularity is 0. This option is
485 available since 8.4.7.
486
487 connect, net-options
488 Connect sets up the device to listen on af:local_addr:port for incoming
489 connections and to try to connect to af:remote_addr:port. If port is
490 omitted, 7788 is used as default. If af is omitted ipv4 gets used.
491 Other supported address families are ipv6, ssocks for Dolphin
492 Interconnect Solutions' "super sockets" and sdp for Sockets Direct
493 Protocol (Infiniband).
494
495 The net-options command allows you to change options while the
496 connection is established.
497
498 --protocol protocol
499 On the TCP/IP link the specified protocol is used. Valid protocol
500 specifiers are A, B, and C.
501
502 Protocol A: write IO is reported as completed, if it has reached
503 local disk and local TCP send buffer.
504
505 Protocol B: write IO is reported as completed, if it has reached
506 local disk and remote buffer cache.
507
508 Protocol C: write IO is reported as completed, if it has reached
509 both local and remote disk.
510
511 --connect-int time
512 In case it is not possible to connect to the remote DRBD device
513 immediately, DRBD keeps on trying to connect. With this option you
514 can set the time between two retries. The default value is 10. The
515 unit is seconds.
516
517 --ping-int time
518 If the TCP/IP connection linking a DRBD device pair is idle for
519 more than time seconds, DRBD will generate a keep-alive packet to
520 check if its partner is still alive. The default value is 10. The
521 unit is seconds.
522
523 --timeout val
524 If the partner node fails to send an expected response packet
525 within val tenths of a second, the partner node is considered dead
526 and therefore the TCP/IP connection is abandoned. The default value
527 is 60 (= 6 seconds).
528
529 --sndbuf-size size
530 The socket send buffer is used to store packets sent to the
531 secondary node, which are not yet acknowledged (from a network
532 point of view) by the secondary node. When using protocol A, it
533 might be necessary to increase the size of this data structure in
534 order to increase asynchronicity between primary and secondary
535 nodes. But keep in mind that more asynchronicity is synonymous with
536 more data loss in the case of a primary node failure. Since 8.0.13
537 resp. 8.2.7 setting the size value to 0 means that the kernel
538 should autotune this. The default size is 0, i.e. autotune.
539
540 --rcvbuf-size size
541 Packets received from the network are stored in the socket receive
542 buffer first. From there they are consumed by DRBD. Before 8.3.2
543 the receive buffer's size was always set to the size of the socket
544 send buffer. Since 8.3.2 they can be tuned independently. A value
545 of 0 means that the kernel should autotune this. The default size
546 is 0, i.e. autotune.
547
548 --ko-count count
549 In case the secondary node fails to complete a single write request
550 for count times the timeout, it is expelled from the cluster, i.e.
551 the primary node goes into StandAlone mode. To disable this
552 feature, you should explicitly set it to 0; defaults may change
553 between versions.
554
555 --max-epoch-size val
556 With this option the maximal number of write requests between two
557 barriers is limited. Typically set to the same as --max-buffers, or
558 the allowed maximum. Values smaller than 10 can lead to degraded
559 performance. The default value is 2048.
560
561 --max-buffers val
562 With this option the maximal number of buffer pages allocated by
563 DRBD's receiver thread is limited. Typically set to the same as
564 --max-epoch-size. Small values could lead to degraded performance.
565 The default value is 2048, the minimum 32. Increase this if you
566 cannot saturate the IO backend of the receiving side during linear
567 write or during resync while otherwise idle.
568
569 See also drbd.conf(5)
570
571 --unplug-watermark val
572 This setting has no effect with recent kernels that use explicit
573 on-stack plugging (upstream Linux kernel 2.6.39, distributions may
574 have backported).
575
576 When the number of pending write requests on the standby
577 (secondary) node exceeds the unplug-watermark, we trigger the
578 request processing of our backing storage device. Some storage
579 controllers deliver better performance with small values, others
580 deliver best performance when the value is set to the same value as
581 max-buffers, yet others don't feel much effect at all. Minimum 16,
582 default 128, maximum 131072.
583
584 --allow-two-primaries
585 With this option set you may assign primary role to both nodes. You
586 only should use this option if you use a shared storage file system
587 on top of DRBD. At the time of writing the only ones are: OCFS2 and
588 GFS. If you use this option with any other file system, you are
589 going to crash your nodes and to corrupt your data!
590
591 --cram-hmac-alg alg
592 You need to specify the HMAC algorithm to enable peer
593 authentication at all. You are strongly encouraged to use peer
594 authentication. The HMAC algorithm will be used for the challenge
595 response authentication of the peer. You may specify any digest
596 algorithm that is named in /proc/crypto.
597
598 --shared-secret secret
599 The shared secret used in peer authentication. May be up to 64
600 characters.
601
602 --after-sb-0pri asb-0p-policy
603 possible policies are:
604
605 disconnect
606 No automatic resynchronization, simply disconnect.
607
608 discard-younger-primary
609 Auto sync from the node that was primary before the split-brain
610 situation occurred.
611
612 discard-older-primary
613 Auto sync from the node that became primary as second during
614 the split-brain situation.
615
616 discard-zero-changes
617 In case one node did not write anything since the split brain
618 became evident, sync from the node that wrote something to the
619 node that did not write anything. In case none wrote anything
620 this policy uses a random decision to perform a "resync" of 0
621 blocks. In case both have written something this policy
622 disconnects the nodes.
623
624 discard-least-changes
625 Auto sync from the node that touched more blocks during the
626 split brain situation.
627
628 discard-node-NODENAME
629 Auto sync to the named node.
630
631 --after-sb-1pri asb-1p-policy
632 possible policies are:
633
634 disconnect
635 No automatic resynchronization, simply disconnect.
636
637 consensus
638 Discard the version of the secondary if the outcome of the
639 after-sb-0pri algorithm would also destroy the current
640 secondary's data. Otherwise disconnect.
641
642 discard-secondary
643 Discard the secondary's version.
644
645 call-pri-lost-after-sb
646 Always honor the outcome of the after-sb-0pri algorithm. In
647 case it decides the current secondary has the correct data,
648 call the pri-lost-after-sb on the current primary.
649
650 violently-as0p
651 Always honor the outcome of the after-sb-0pri algorithm. In
652 case it decides the current secondary has the correct data,
653 accept a possible instantaneous change of the primary's data.
654
655 --after-sb-2pri asb-2p-policy
656 possible policies are:
657
658 disconnect
659 No automatic resynchronization, simply disconnect.
660
661 call-pri-lost-after-sb
662 Always honor the outcome of the after-sb-0pri algorithm. In
663 case it decides the current secondary has the right data, call
664 the pri-lost-after-sb on the current primary.
665
666 violently-as0p
667 Always honor the outcome of the after-sb-0pri algorithm. In
668 case it decides the current secondary has the right data,
669 accept a possible instantaneous change of the primary's data.
670
671 --always-asbp
672 Normally the automatic after-split-brain policies are only used if
673 current states of the UUIDs do not indicate the presence of a third
674 node.
675
676 With this option you request that the automatic after-split-brain
677 policies are used as long as the data sets of the nodes are somehow
678 related. This might cause a full sync, if the UUIDs indicate the
679 presence of a third node. (Or double faults have led to strange
680 UUID sets.)
681
682 --rr-conflict role-resync-conflict-policy
683 This option sets DRBD's behavior when DRBD deduces from its meta
684 data that a resynchronization is needed, and the SyncTarget node is
685 already primary. The possible settings are: disconnect,
686 call-pri-lost and violently. While disconnect speaks for itself,
687 with the call-pri-lost setting the pri-lost handler is called which
688 is expected to either change the role of the node to secondary, or
689 remove the node from the cluster. The default is disconnect.
690
691 With the violently setting you allow DRBD to force a primary node
692 into SyncTarget state. This means that the data exposed by DRBD
693 changes to the SyncSource's version of the data instantaneously.
694 USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.
695
696 --data-integrity-alg hash_alg
697 DRBD can ensure the data integrity of the user's data on the
698 network by comparing hash values. Normally this is ensured by the
699 16 bit checksums in the headers of TCP/IP packets. This option can
700 be set to any of the kernel's data digest algorithms. In a typical
701 kernel configuration you should have at least one of md5, sha1, and
702 crc32c available. By default this is not enabled.
703
704 See also the notes on data integrity on the drbd.conf manpage.
705
706 --no-tcp-cork
707 DRBD usually uses the TCP socket option TCP_CORK to hint to the
708 network stack when it can expect more data, and when it should
709 flush out what it has in its send queue. There is at least one
710 network stack that performs worse when one uses this hinting
711 method. Therefore we introduced this option, which disable the
712 setting and clearing of the TCP_CORK socket option by DRBD.
713
714 --ping-timeout ping_timeout
715 The time the peer has to answer to a keep-alive packet. In case the
716 peer's reply is not received within this time period, it is
717 considered dead. The default unit is tenths of a second, the
718 default value is 5 (for half a second).
719
720 --discard-my-data
721 Use this option to manually recover from a split-brain situation.
722 In case you do not have any automatic after-split-brain policies
723 selected, the nodes refuse to connect. By passing this option you
724 make this node a sync target immediately after successful connect.
725
726 --tentative
727 Causes DRBD to abort the connection process after the resync
728 handshake, i.e. no resync gets performed. You can find out which
729 resync DRBD would perform by looking at the kernel's log file.
730
731 --on-congestion congestion_policy,
732 --congestion-fill fill_threshold,
733 --congestion-extents active_extents_threshold
734 By default DRBD blocks when the available TCP send queue becomes
735 full. That means it will slow down the application that generates
736 the write requests that cause DRBD to send more data down that TCP
737 connection.
738
739 When DRBD is deployed with DRBD-proxy it might be more desirable
740 that DRBD goes into AHEAD/BEHIND mode shortly before the send queue
741 becomes full. In AHEAD/BEHIND mode DRBD does no longer replicate
742 data, but still keeps the connection open.
743
744 The advantage of the AHEAD/BEHIND mode is that the application is
745 not slowed down, even if DRBD-proxy's buffer is not sufficient to
746 buffer all write requests. The downside is that the peer node falls
747 behind, and that a resync will be necessary to bring it back into
748 sync. During that resync the peer node will have an inconsistent
749 disk.
750
751 Available congestion_policys are block and pull-ahead. The default
752 is block. Fill_threshold might be in the range of 0 to 10GiBytes.
753 The default is 0 which disables the check.
754 Active_extents_threshold has the same limits as al-extents.
755
756 The AHEAD/BEHIND mode and its settings are available since DRBD
757 8.3.10.
758
759 --verify-alg hash-alg
760 During online verification (as initiated by the verify
761 sub-command), rather than doing a bit-wise comparison, DRBD applies
762 a hash function to the contents of every block being verified, and
763 compares that hash with the peer. This option defines the hash
764 algorithm being used for that purpose. It can be set to any of the
765 kernel's data digest algorithms. In a typical kernel configuration
766 you should have at least one of md5, sha1, and crc32c available. By
767 default this is not enabled; you must set this option explicitly in
768 order to be able to use on-line device verification.
769
770 See also the notes on data integrity on the drbd.conf manpage.
771
772 --csums-alg hash-alg
773 A resync process sends all marked data blocks from the source to
774 the destination node, as long as no csums-alg is given. When one is
775 specified the resync process exchanges hash values of all marked
776 blocks first, and sends only those data blocks over, that have
777 different hash values.
778
779 This setting is useful for DRBD setups with low bandwidth links.
780 During the restart of a crashed primary node, all blocks covered by
781 the activity log are marked for resync. But a large part of those
782 will actually be still in sync, therefore using csums-alg will
783 lower the required bandwidth in exchange for CPU cycles.
784
785 --use-rle
786 During resync-handshake, the dirty-bitmaps of the nodes are
787 exchanged and merged (using bit-or), so the nodes will have the
788 same understanding of which blocks are dirty. On large devices, the
789 fine grained dirty-bitmap can become large as well, and the bitmap
790 exchange can take quite some time on low-bandwidth links.
791
792 Because the bitmap typically contains compact areas where all bits
793 are unset (clean) or set (dirty), a simple run-length encoding
794 scheme can considerably reduce the network traffic necessary for
795 the bitmap exchange.
796
797 For backward compatibility reasons, and because on fast links this
798 possibly does not improve transfer time but consumes cpu cycles,
799 this defaults to off.
800
801 Introduced in 8.3.2.
802
803 --socket-check-timeout
804 In setups involving a DRBD-proxy and connections that experience a
805 lot of buffer-bloat it might be necessary to set ping-timeout to an
806 unusual high value. By default DRBD uses the same value to wait if
807 a newly established TCP-connection is stable. Since the DRBD-proxy
808 is usually located in the same data center such a long wait time
809 may hinder DRBD's connect process.
810
811 In such setups socket-check-timeout should be set to at least to
812 the round trip time between DRBD and DRBD-proxy. I.e. in most cases
813 to 1.
814
815 The default unit is tenths of a second, the default value is 0
816 (which causes DRBD to use the value of ping-timeout instead).
817 Introduced in 8.4.5.
818
819 resource-options
820 Changes the options of the resource at runtime.
821
822 --cpu-mask cpu-mask
823 Sets the cpu-affinity-mask for DRBD's kernel threads of this
824 device. The default value of cpu-mask is 0, which means that DRBD's
825 kernel threads should be spread over all CPUs of the machine. This
826 value must be given in hexadecimal notation. If it is too big it
827 will be truncated.
828
829 --on-no-data-accessible ond-policy
830 This setting controls what happens to IO requests on a degraded,
831 disk less node (I.e. no data store is reachable). The available
832 policies are io-error and suspend-io.
833
834 If ond-policy is set to suspend-io you can either resume IO by
835 attaching/connecting the last lost data storage, or by the drbdadm
836 resume-io res command. The latter will result in IO errors of
837 course.
838
839 The default is io-error. This setting is available since DRBD
840 8.3.9.
841
842 primary
843 Sets the device into primary role. This means that applications (e.g. a
844 file system) may open the device for read and write access. Data
845 written to the device in primary role are mirrored to the device in
846 secondary role.
847
848 Normally it is not possible to set both devices of a connected DRBD
849 device pair to primary role. By using the --allow-two-primaries option,
850 you override this behavior and instruct DRBD to allow two primaries.
851
852 --overwrite-data-of-peer
853 Alias for --force.
854
855 --force
856 Becoming primary fails if the local replica is not up-to-date. I.e.
857 when it is inconsistent, outdated of consistent. By using this
858 option you can force it into primary role anyway. USE THIS OPTION
859 ONLY IF YOU KNOW WHAT YOU ARE DOING.
860
861 secondary
862 Brings the device into secondary role. This operation fails as long as
863 at least one application (or file system) has opened the device.
864
865 It is possible that both devices of a connected DRBD device pair are
866 secondary.
867
868 verify
869 This initiates on-line device verification. During on-line
870 verification, the contents of every block on the local node are
871 compared to those on the peer node. Device verification progress can be
872 monitored via /proc/drbd. Any blocks whose content differs from that of
873 the corresponding block on the peer node will be marked out-of-sync in
874 DRBD's on-disk bitmap; they are not brought back in sync automatically.
875 To do that, simply disconnect and reconnect the resource.
876
877 If on-line verification is already in progress (and this node is
878 "VerifyS"), this command silently "succeeds". In this case, any
879 start-sector (see below) will be ignored, and any stop-sector (see
880 below) will be honored. This can be used to stop a running verify, or
881 to update/shorten/extend the coverage of the currently running verify.
882
883 This command will fail if the device is not part of a connected device
884 pair.
885
886 See also the notes on data integrity on the drbd.conf manpage.
887
888 --start start-sector
889 Since version 8.3.2, on-line verification should resume from the
890 last position after connection loss. It may also be started from an
891 arbitrary position by setting this option. If you had reached some
892 stop-sector before, and you do not specify an explicit
893 start-sector, verify should resume from the previous stop-sector.
894
895 Default unit is sectors. You may also specify a unit explicitly.
896 The start-sector will be rounded down to a multiple of 8 sectors
897 (4kB).
898
899 -S, --stop stop-sector
900 Since version 8.3.14, on-line verification can be stopped before it
901 reaches end-of-device.
902
903 Default unit is sectors. You may also specify a unit explicitly.
904 The stop-sector may be updated by issuing an additional drbdsetup
905 verify command on the same node while the verify is running. This
906 can be used to stop a running verify, or to update/shorten/extend
907 the coverage of the currently running verify.
908
909 invalidate
910 This forces the local device of a pair of connected DRBD devices into
911 SyncTarget state, which means that all data blocks of the device are
912 copied over from the peer.
913
914 This command will fail if the device is not either part of a connected
915 device pair, or disconnected Secondary.
916
917 invalidate-remote
918 This forces the local device of a pair of connected DRBD devices into
919 SyncSource state, which means that all data blocks of the device are
920 copied to the peer.
921
922 On a disconnected Primary device, this will set all bits in the out of
923 sync bitmap. As a side affect this suspends updates to the on disk
924 activity log. Updates to the on disk activity log resume automatically
925 when necessary.
926
927 wait-connect
928 Returns as soon as the device can communicate with its partner device.
929
930 --wfc-timeout wfc_timeout,
931 --degr-wfc-timeout degr_wfc_timeout,
932 --outdated-wfc-timeout outdated_wfc_timeout,
933 --wait-after-sb
934 This command will fail if the device cannot communicate with its
935 partner for timeout seconds. If the peer was working before this
936 node was rebooted, the wfc_timeout is used. If the peer was already
937 down before this node was rebooted, the degr_wfc_timeout is used.
938 If the peer was successfully outdated before this node was rebooted
939 the outdated_wfc_timeout is used. The default value for all those
940 timeout values is 0 which means to wait forever. The unit is
941 seconds. In case the connection status goes down to StandAlone
942 because the peer appeared but the devices had a split brain
943 situation, the default for the command is to terminate. You can
944 change this behavior with the --wait-after-sb option.
945
946 wait-sync
947 Returns as soon as the device leaves any synchronization into connected
948 state. The options are the same as with the wait-connect command.
949
950 disconnect
951 Removes the information set by the net command from the device. This
952 means that the device goes into unconnected state and will no longer
953 listen for incoming connections.
954
955 detach
956 Removes the information set by the disk command from the device. This
957 means that the device is detached from its backing storage device.
958
959 -f, --force
960 A regular detach returns after the disk state finally reached
961 diskless. As a consequence detaching from a frozen backing block
962 device never terminates.
963
964 On the other hand A forced detach returns immediately. It allows
965 you to detach DRBD from a frozen backing block device. Please note
966 that the disk will be marked as failed until all pending IO
967 requests where finished by the backing block device.
968
969 down
970 Removes all configuration information from the device and forces it
971 back to unconfigured state.
972
973 role
974 Shows the current roles of the device and its peer, as local/peer.
975
976 state
977 Deprecated alias for "role"
978
979 cstate
980 Shows the current connection state of the device.
981
982 dstate
983 Shows the current states of the backing storage devices, as local/peer.
984
985 resize
986 This causes DRBD to reexamine the size of the device's backing storage
987 device. To actually do online growing you need to extend the backing
988 storages on both devices and call the resize command on one of your
989 nodes.
990
991 The --size option can be used to online shrink the usable size of a
992 drbd device. It's the users responsibility to make sure that a file
993 system on the device is not truncated by that operation.
994
995 The --assume-peer-has-space allows you to resize a device which is
996 currently not connected to the peer. Use with care, since if you do not
997 resize the peer's disk as well, further connect attempts of the two
998 will fail.
999
1000 When the --assume-clean option is given DRBD will skip the resync of
1001 the new storage. Only do this if you know that the new storage was
1002 initialized to the same content by other means.
1003
1004 The options --al-stripes and --al-stripe-size-kB may be used to change
1005 the layout of the activity log online. In case of internal meta data
1006 this may invovle shrinking the user visible size at the same time
1007 (unsing the --size) or increasing the avalable space on the backing
1008 devices.
1009
1010 check-resize
1011 To enable DRBD to detect offline resizing of backing devices this
1012 command may be used to record the current size of backing devices. The
1013 size is stored in files in /var/lib/drbd/ named drbd-minor-??.lkbd
1014
1015 This command is called by drbdadm resize res after drbdsetup device
1016 resize returned.
1017
1018 pause-sync
1019 Temporarily suspend an ongoing resynchronization by setting the local
1020 pause flag. Resync only progresses if neither the local nor the remote
1021 pause flag is set. It might be desirable to postpone DRBD's
1022 resynchronization after eventual resynchronization of the backing
1023 storage's RAID setup.
1024
1025 resume-sync
1026 Unset the local sync pause flag.
1027
1028 outdate
1029 Mark the data on the local backing storage as outdated. An outdated
1030 device refuses to become primary. This is used in conjunction with
1031 fencing and by the peer's fence-peer handler.
1032
1033 show-gi
1034 Displays the device's data generation identifiers verbosely.
1035
1036 get-gi
1037 Displays the device's data generation identifiers.
1038
1039 show
1040 Shows all available configuration information of a resource, or of all
1041 resources. Available options:
1042
1043 --show-defaults
1044 Show all configuration parameters, even the ones with default
1045 values. Normally, parameters with default values are not shown.
1046
1047 suspend-io
1048 This command is of no apparent use and just provided for the sake of
1049 completeness.
1050
1051 resume-io
1052 If the fence-peer handler fails to stonith the peer node, and your
1053 fencing policy is set to resource-and-stonith, you can unfreeze IO
1054 operations with this command.
1055
1056 status
1057 Show the status of a resource, or of all resources. The output consists
1058 of one paragraph for each configured resource. Each paragraph contains
1059 one line for each resource, followed by one line for each device, and
1060 one line for each connection. The device and connection lines are
1061 indented. The connection lines are followed by one line for each peer
1062 device; these lines are indented against the connection line.
1063
1064 Long lines are wrapped around at terminal width, and indented to
1065 indicate how the lines belongs together. Available options:
1066
1067 --verbose
1068 Include more information in the output even when it is likely
1069 redundant or irrelevant.
1070
1071 --statistics
1072 Include data transfer statistics in the output.
1073
1074 --color={always | auto | never}
1075 Colorize the output. With --color=auto, drbdsetup emits color codes
1076 only when standard output is connected to a terminal.
1077
1078 For example, the non-verbose output for a resource with only one
1079 connection and only one volume could look like this:
1080
1081 fs-backoffice role:Primary
1082 disk:UpToDate
1083 peer role:Secondary
1084 replication:Established peer-disk:UpToDate
1085
1086
1087 With the --verbose --statistics options, the same resource could be
1088 reported as:
1089
1090 fs-data role:Primary suspended:no
1091 write-ordering:drain
1092 volume:0 minor:1 disk:UpToDate
1093 size:10616472 read:134465 written:144800 al-writes:18 bm-writes:0
1094 upper-pending:0 lower-pending:0 al-suspended:no blocked:no
1095 peer connection:Connected role:Secondary congested:no
1096 volume:0 replication:Established peer-disk:UpToDate resync-suspended:no
1097 received:122596 sent:22204 out-of-sync:0 pending:0 unacked:0
1098
1099
1100
1101 events2
1102 Show the current state of all configured DRBD objects, followed by all
1103 changes to the state.
1104
1105 The output format is meant to be human as well as machine readable.
1106 Each line starts with the event number, which is followed by an
1107 asterisk if the event continues in the next line. The second word in
1108 each line indicates the kind of event: exists for an existing object;
1109 create, destroy, and change if an object is created, destroyed, or
1110 changed; or call or response if an event handler is called or it
1111 returns. The third word indicates the object the event applies to:
1112 resource, device, connection, peer-device, helper, or a dash (-) to
1113 indicate that the current state has been dumped completely.
1114
1115 The remaining words identify the object and describe the state that he
1116 object is in. Available options:
1117
1118 --now
1119 Terminate after reporting the current state. The default is to
1120 continuously listen and report state changes.
1121
1122 --statistics
1123 Include statistics in the output.
1124
1125 events
1126 Deprecated. If possible, change to the events2 subcommand instead.
1127
1128 Displays every state change of DRBD and all calls to helper programs.
1129 This might be used to get notified of DRBD's state changes by piping
1130 the output to another program.
1131
1132 --all-devices
1133 Display the events of all DRBD minors.
1134
1135 --unfiltered
1136 This is a debugging aid that displays the content of all received
1137 netlink messages.
1138
1139 new-current-uuid
1140 Generates a new current UUID and rotates all other UUID values. This
1141 has at least two use cases, namely to skip the initial sync, and to
1142 reduce network bandwidth when starting in a single node configuration
1143 and then later (re-)integrating a remote site.
1144
1145 Available option:
1146
1147 --clear-bitmap
1148 Clears the sync bitmap in addition to generating a new current
1149 UUID.
1150
1151 This can be used to skip the initial sync, if you want to start from
1152 scratch. This use-case does only work on "Just Created" meta data.
1153 Necessary steps:
1154
1155 1. On both nodes, initialize meta data and configure the device.
1156
1157 drbdadm -- --force create-md res
1158
1159 2. They need to do the initial handshake, so they know their sizes.
1160
1161 drbdadm up res
1162
1163 3. They are now Connected Secondary/Secondary
1164 Inconsistent/Inconsistent. Generate a new current-uuid and clear
1165 the dirty bitmap.
1166
1167 drbdadm new-current-uuid --clear-bitmap res
1168
1169 4. They are now Connected Secondary/Secondary UpToDate/UpToDate. Make
1170 one side primary and create a file system.
1171
1172 drbdadm primary res
1173
1174 mkfs -t fs-type $(drbdadm sh-dev res)
1175
1176 One obvious side-effect is that the replica is full of old garbage
1177 (unless you made them identical using other means), so any
1178 online-verify is expected to find any number of out-of-sync blocks.
1179
1180 You must not use this on pre-existing data! Even though it may appear
1181 to work at first glance, once you switch to the other node, your data
1182 is toast, as it never got replicated. So do not leave out the mkfs (or
1183 equivalent).
1184
1185 This can also be used to shorten the initial resync of a cluster where
1186 the second node is added after the first node is gone into production,
1187 by means of disk shipping. This use-case works on disconnected devices
1188 only, the device may be in primary or secondary role.
1189
1190 The necessary steps on the current active server are:
1191
1192 1. drbdsetup new-current-uuid --clear-bitmap minor
1193
1194 2. Take the copy of the current active server. E.g. by pulling a disk
1195 out of the RAID1 controller, or by copying with dd. You need to
1196 copy the actual data, and the meta data.
1197
1198 3. drbdsetup new-current-uuid minor
1199
1200 Now add the disk to the new secondary node, and join it to the cluster.
1201 You will get a resync of that parts that were changed since the first
1202 call to drbdsetup in step 1.
1203
1205 For examples, please have a look at the DRBD User's Guide[1].
1206
1208 This document was revised for version 8.3.2 of the DRBD distribution.
1209
1211 Written by Philipp Reisner <philipp.reisner@linbit.com> and Lars
1212 Ellenberg <lars.ellenberg@linbit.com>
1213
1215 Report bugs to <drbd-user@lists.linbit.com>.
1216
1218 Copyright 2001-2008 LINBIT Information Technologies, Philipp Reisner,
1219 Lars Ellenberg. This is free software; see the source for copying
1220 conditions. There is NO warranty; not even for MERCHANTABILITY or
1221 FITNESS FOR A PARTICULAR PURPOSE.
1222
1224 drbd.conf(5), drbd(8), drbddisk(8), drbdadm(8), DRBD User's Guide[1],
1225 DRBD web site[2]
1226
1228 1. DRBD User's Guide
1229 http://www.drbd.org/users-guide/
1230
1231 2. DRBD web site
1232 http://www.drbd.org/
1233
1234
1235
1236DRBD 8.4.0 6 May 2011 DRBDSETUP(8)