drbd storage driver¶
Introduction¶
Drbd is a Linux kernel driver presenting shared block devices from pairs of local block devices. Replication data goes over the network and can be synchronous ou near-synchronous. It supports the active-active or active-passive operation modes. The former being a prerequisite for cluster filesystem.
OpenSVC drbd driver has provisioning capabilities.
OpenSVC also includes a drbd pool driver, to automatically provision drbd-replicated volumes from a volume group, a zpool or a directory.
Node configuration¶
The drbd resource configuration is expected to reside in /etc/drbd.d/$res.res
.
If a vg is layered above drbd, a specific LVM configuration is recommended (link)
Set write_cache_state = 0 in /etc/lvm/lvm.conf
Remove /etc/lvm/cache/.cache
Files contributed to sync#i0¶
/etc/drbd.d/${res}.res
This file is thus replicated from the node running the service to the other nodes and drpnodes.
Command set¶
The drbd driver is a member of the ‘disk group’ class.
start
Promote to ‘primary’ state
stop
Demote to ‘secondary’ state
shutdown
Demote to ‘unconfigured’ state
Example¶
[disk#1]
type = lv
name = lv1
vg = vg1
size = 190m
standby = true
[disk#2]
type = drbd
res = res1
disk = /dev/vg1/lv1
standby = true
The drbd and underlying logical volume resources must be configured for standby=true. This make sure the lv is available for drbd on the slave nodes and the drbd is in secondary state.
The logical volume resource id (disk#1) is sorted before the drbd resource id (disk#2), so the logical volume starts before the drbd.
Keywords¶
- disk.drbd
- no_preempt_abort
- prkey
- promote_rw
- res
- scsireserv
- addr
- disk
- max_peers
- network
- port
- blocking_post_provision
- blocking_post_start
- blocking_post_startstandby
- blocking_post_stop
- blocking_post_unprovision
- blocking_pre_provision
- blocking_pre_start
- blocking_pre_startstandby
- blocking_pre_stop
- blocking_pre_unprovision
- comment
- disable
- encap
- monitor
- optional
- pg_blkio_weight
- pg_cpu_quota
- pg_cpu_shares
- pg_cpus
- pg_mem_limit
- pg_mem_oom_control
- pg_mem_swappiness
- pg_mems
- pg_vmem_limit
- post_provision
- post_start
- post_startstandby
- post_stop
- post_unprovision
- pre_provision
- pre_start
- pre_startstandby
- pre_stop
- pre_unprovision
- provision
- provision_requires
- restart
- restart_delay
- shared
- standby
- start_requires
- stop_requires
- subset
- tags
- unprovision
- unprovision_requires
See also