drbd cli

最後更新: 2021-02-11

目錄

  • drbdadm
  • drbdmon
  • drbdmeta
  • drbdsetup

 


drbdadm

 

drbdadm -call-> drbdsetup

drbdadm -call-> drbdmeta

Usage

drbdadm options command resource[/volume]...

options

-d                   # dry-run mode

Command

attach / detach

Attaches a local backing block device to the DRBD resource's device

/dev/sdb1 -> /dev/drbd1

connect / disconnect

connect

If the peer device is already configured, the two DRBD devices will connect.

node1 <--> node2

----

disconnect

Removes the network configuration from the resource.

The device will then go into StandAlone state.

up / down

shortcut for attach and connect

shortcut for disconnect and detach

primary / secondary

You need to do this before any access to the device,

such as creating or mounting a file system.

Info 類

dstate | cstate | role

adjust

根據 "/etc/drbd.conf" Update setting

dump

configure

Sync

syncer (Loads the resynchronization parameters into the device.)

pause-sync / resume-sync

Temporarily suspend an ongoing resynchronization by setting the local pause flag

verify

verify 之後須要再 disconnect, connect 去修復

outdate

mark the node's data as outdated

(Sets the outdated flag in the meta data)

invalidate / invalidate-remote

強制 re-sync 所有 data 一次

很少用的 command:

create-md <Device>

* first time only

drbdadm create-md r0

new-current-uuid <Device>

resize <Device>

Causes DRBD to re-examine all sizing constraints, and resize the resource's device accordingly

check-resize <Device>

Calls drbdmeta to move internal meta data to the end of the device

使用原因: backing device was resized, while DRBD was not running

wipe-md <Device>

Wipe out the DRBD metadata of a device.

drbdadm wipe-md r0

Do you really want to wipe out the DRBD meta data?
[need to type 'yes' to confirm] yes

Wiping meta data...
DRBD meta data block successfully wiped out.

 


drbdmon

 

 


drbdmeta

 

drbdadm -call-> drbdmeta  # Usually you do not want to use this command directly

Only works if

  • DRBD resource is currently down or
  • detached from its backing storage