分类: LINUX
2008-12-23 17:45:41
# # please have a a look at the example configuration file in # /usr/share/doc/drbd82/drbd.conf # global { usage-count no; } common { protocol C; } resource r0 { protocol C; on oem2.blueice.com{ device /dev/drbd0; disk /dev/sdb1; address 10.0.1.32:7788; meta-disk internal; } on oem3.blueice.com{ device /dev/drbd0; disk /dev/sdb1; address 10.0.1.33:7788; meta-disk internal; } } resource r1 { protocol C; on oem2.blueice.com{ device /dev/drbd1; disk /dev/sdb2; address 10.0.1.32:7789; meta-disk internal; } on oem3.blueice.com{ device /dev/drbd1; disk /dev/sdb2; address 10.0.1.33:7789; meta-disk internal; } } |
drbdadm create-md |
drbdadm attach drbdadm connect
|
drbdadm -- --overwrite-data-of-peer primary
|
[root@oem3 ~]# cat /proc/drbd version: 8.2.6 (api:88/proto:86-88) GIT-hash: 3e69822d3bb4920a8c1bfdf7d647169eba7d2eb4 build by buildsvn@c5-x8664-build, 2008-10-03 11:30:17 0: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r--- ns:0 nr:811016 dw:811016 dr:0 al:0 bm:61 lo:0 pe:0 ua:0 ap:0 oos:0 1: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r--- ns:0 nr:8 dw:8 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 oos:0 |
StandAlone,
WFConnection,
Connected等,
Connected表示该resource的节点已经建立连接, WFConnection表示在等待连接, 常在启动过程中, 或者另外一方运行disconnect后出现, StandAlone表示没有可用的网络配置, 常在运行disconnect后出现. 常见的状态有UpToDate
, Unknown
等, UpToDate表示表示数据是最新的,这一状态为正常状态, Unknow表示对方状态是未知的, 网络断开后, 对方节点的磁盘状态常变为Unknown. drbdadm disconnect
|
drbdadm primary
|
drbdadm secondary
|
drbdadm connect
|
drbdadm -- --discard-my-data connect
|
drbd0: Split-Brain detected, dropping connection! drbd0: self BF739B73E097B05E:D3B06FBE563C5580:7D4CAACF55C1C208:A625E780FF79A3B7 drbd0: peer 2FE125710E63486F:D3B06FBE563C5581:7D4CAACF55C1C208:A625E780FF79A3B7 drbd0: helper command: /sbin/drbdadm split-brain drbd0: conn( WFReportParams -> Disconnecting ) |