^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # DRBD device driver configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) comment "DRBD disabled because PROC_FS or INET not selected"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) depends on PROC_FS='n' || INET='n'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) config BLK_DEV_DRBD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) tristate "DRBD Distributed Replicated Block Device support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) depends on PROC_FS && INET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) select LRU_CACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) select LIBCRC32C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) NOTE: In order to authenticate connections you have to select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) CRYPTO_HMAC and a hash function as well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) DRBD is a shared-nothing, synchronously replicated block device. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) is designed to serve as a building block for high availability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) clusters and in this context, is a "drop-in" replacement for shared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) storage. Simplistically, you could see it as a network RAID 1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) Each minor device has a role, which can be 'primary' or 'secondary'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) On the node with the primary device the application is supposed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) run and to access the device (/dev/drbdX). Every write is sent to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) the local 'lower level block device' and, across the network, to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) node with the device in 'secondary' state. The secondary device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) simply writes the data to its lower level block device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) DRBD can also be used in dual-Primary mode (device writable on both
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) nodes), which means it can exhibit shared disk semantics in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) shared-nothing cluster. Needless to say, on top of dual-Primary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) DRBD utilizing a cluster file system is necessary to maintain for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) cache coherency.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) For automatic failover you need a cluster manager (e.g. heartbeat).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) See also: https://www.drbd.org/, http://www.linux-ha.org
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) config DRBD_FAULT_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) bool "DRBD fault injection"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) depends on BLK_DEV_DRBD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) Say Y here if you want to simulate IO errors, in order to test DRBD's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) behavior.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) The actual simulation of IO errors is done by writing 3 values to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) /sys/module/drbd/parameters/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) enable_faults: bitmask of...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 1 meta data write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 2 read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 4 resync data write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 8 read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 16 data write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 32 data read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 64 read ahead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 128 kmalloc of bitmap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 256 allocation of peer_requests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 512 insert data corruption on receiving side
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) fault_devs: bitmask of minor numbers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) fault_rate: frequency in percent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) Example: Simulate data write errors on /dev/drbd0 with a probability of 5%.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) echo 16 > /sys/module/drbd/parameters/enable_faults
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) echo 1 > /sys/module/drbd/parameters/fault_devs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) echo 5 > /sys/module/drbd/parameters/fault_rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) If unsure, say N.