您的位置:首页 > 其它

老外眼中的简单drbd配置

2011-09-23 16:59 295 查看


Simple drbd configuration

Each of the following steps must be completed on both nodes.

yum install kmod-drbd83 drbd83

fdisk -l /dev/sdb

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         130     1044193+  83  Linux

vim /etc/drbd.conf

global {
usage-count yes;
}

common {
protocol C;
syncer { rate 10M; }
}


resource r0 {
on node1.ybn.fr {
device    /dev/drbd1;
disk      /dev/sdb1;
address   192.168.0.10:7789;
meta-disk internal;
}
on node2.ybn.fr {
device    /dev/drbd1;
disk      /dev/sdb1;
address   192.168.0.11:7789;
meta-disk internal;
}
startup {
become-primary-on node1.ybn.fr;
}
}
Synchronisation rate should be the third of effective available bandwidth . You can measure network troughtput this way.
The resource uses TCP port 7789 for its network connections, and binds to the IP addresses 192.168.0.1 and 192.168.0.11, respectively. You can configure firewall rules this way.
scp /etc/drbd.conf node2:/etc/drbd.conf

modprobe drbd

drbdadm create-md r0

drbdadm up r0

cat /proc/drbd

1: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r----

ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:1044124

The
following must be performed on only one node, only on initial resource
configuration, and only on the node you selected as the synchronization
source.
drbdadm -- --overwrite-data-of-peer primary r0

drbd-overview

1:r0 SyncSource Primary/Secondary UpToDate/Inconsistent C r----

[=====>..............] sync'ed: 30.6% (726684/1044124)K

drbd-overview

1:r0  Connected Primary/Secondary UpToDate/UpToDate C r----

mkfs.ext3 /dev/drbd1

参考地址:http://www.ybn.fr/linux-technical-library/configure-netfilter-iptables-firewall/simple-drbd-configuration
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: