2.3.2 复制配置到node2上:
[root@node1 drbd.d]# scp /etc/drbd.conf node2:/etc/
drbd.conf 100% 133 0.1KB/s 00:00
[root@node1 drbd.d]# scp /etc/drbd.d/* node2:/etc/drbd.d/
global_common.conf 100% 427 0.4KB/s 00:00
global_common.conf.bak 100% 1418 1.4KB/s 00:00
nfs.res 100% 330 0.3KB/s 00:00
[root@node1 drbd.d]#
2.4、 检测配置文件
// 检测配置文件
[root@node1 drbd.d]# drbdadm adjust nfs
0: Failure: (119) No valid meta-data signature found.
==> Use 'drbdadm create-md res' to initialize meta-data area. <==
Command 'drbdsetup 0 disk /dev/sda4 /dev/sda4 internal --set-defaults --create-device --fencing=resource-only --on-io-error=detach' terminated with exit code 10
[root@node1 drbd.d]# drbdadm adjust nfs
drbdsetup 0 show:5: delay-probe-volume 0k => 0k out of range [4..1048576]k.
[root@node1 drbd.d]#
2.5、创建nfs 的资源
2.5.1 在node1上创建nfs 的资源
[root@node1 drbd.d]# drbdadm create-md nfs
Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.
[root@node1 drbd.d]# ll /dev/drbd0
brw-r----- 1 root disk 147, 0 Feb 8 14:27 /dev/drbd0
2.5.2 在node2上创建nfs 的资源
[root@node1 drbd.d]# ssh node2.junjie.com 'drbdadm create-md nfs'
NOT initialized bitmap
Writing meta data...
initializing activity log
New drbd meta data block successfully created.
[root@node1 drbd.d]# ssh node2.junjie.com 'ls -l /dev/drbd0'
brw-r----- 1 root disk 147, 0 Feb 8 14:19 /dev/drbd0
2.6 启动DRBD服务
[root@node1 drbd.d]# service drbd start
Starting DRBD resources: drbdsetup 0 show:5: delay-probe-volume 0k => 0k out of range [4..1048576]k.
[root@node1 drbd.d]# ssh node2.junjie.com 'service drbd start'
Starting DRBD resources: drbdsetup 0 show:5: delay-probe-volume 0k => 0k out of range [4..1048576]k.
[root@node1 drbd.d]#
2.7 启动DRBD服务,查看DRBD状态
[root@node1 drbd.d]# service drbd status
drbd driver loaded OK; device status:
version: 8.3.8 (api:88/proto:86-94)
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.CentOS.org, 2010-06-04 08:04:16
m:res cs ro ds p mounted fstype
0:nfs Connected Secondary/Secondary Inconsistent/Inconsistent C
[root@node1 drbd.d]# ssh node2.junjie.com 'service drbd status'
drbd driver loaded OK; device status:
version: 8.3.8 (api:88/proto:86-94)
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:16
m:res cs ro ds p mounted fstype
0:nfs Connected Secondary/Secondary Inconsistent/Inconsistent C
[root@node1 drbd.d]#
[root@node1 drbd.d]# drbd-overview
0:nfs Connected Secondary/Secondary Inconsistent/Inconsistent C r----
[root@node1 drbd.d]# ssh node2.junjie.com 'drbd-overview'
0:nfs Connected Secondary/Secondary Inconsistent/Inconsistent C r----
[root@node1 drbd.d]#
[root@node1 drbd.d]# chkconfig drbd on
[root@node1 drbd.d]# chkconfig --list drbd
drbd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@node1 drbd.d]# ssh node2.junjie.com 'chkconfig drbd on'
[root@node1 drbd.d]# ssh node2.junjie.com 'chkconfig --list drbd'
drbd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
2.8 在node1主节点上进行以下配置,并查看挂载信息。
[root@node1 drbd.d]# mkdir /mnt/nfs
[root@node1 drbd.d]# ssh node2.junjie.com 'mkdir /mnt/nfs'
[root@node1 drbd.d]# drbdsetup /dev/drbd0 primary -o
[root@node1 drbd.d]# mkfs.ext3 /dev/drbd0
[root@node1 drbd.d]# mount /dev/drbd0 /mnt/nfs/
至此DRBD配置成功!!!