在节点2上做同样操作
[root@www1 ~]# cp /usr/share/doc/drbd83-8.3.8/drbd.conf /etc
cp: overwrite `/etc/drbd.conf'? y 必须选择覆盖!
[root@www1 ~]# scp /etc/drbd.conf www2:/etc/
[root@www1 ~]# vim /etc/drbd.d/global_common.conf
[root@www1 ~]# cat /etc/drbd.d/global_common.conf
global {
usage-count yes;
# minor-count dialog-refresh disable-ip-verification
}
common {
protocol C;
startup {
wfc-timeout 120;
degr-wfc-timeout 120;
}
disk {
on-io-error detach;
fencing resource-only;
}
net {
cram-hmac-alg "sha1";
shared-secret "mydrbdlab";
}
syncer {
rate 100M;
}
}
[root@www1 ~]# vim /etc/drbd.d/web.res
[root@www1 ~]# cat /etc/drbd.d/web.res
resource web {
on www1.gjp.com {
device /dev/drbd0;
disk /dev/sda5;
address 192.168.2.1:7789;
meta-disk internal;
}
on www2.gjp.com {
device /dev/drbd0;
disk /dev/sda5;
address 192.168.2.2:7789;
meta-disk internal;
}
}
开始初始化
双方借点上都要执行
drbdadm create-md web
在双方的节点上启动服务
service drbd start
查看状态
[root@www1 ~]# drbdadm create-md web
[root@www1 ~]# service drbd start
启动时必须双方一块启动!
