[root@client ~]# mkdir /data
[root@client ~]# mount 192.168.101.210:/mnt/nfs/ /data/
[root@client ~]# cd /data/
[root@client data]# ll
total 20
-rw-r--r-- 1 root root 4 Feb 8 17:41 f1
drwx------ 2 root root 16384 Feb 8 14:57 lost+found
[root@client data]# touch f-client-1
[root@client data]# ll
total 20
-rw-r--r-- 1 root root 0 Feb 8 19:50 f-client-1
-rw-r--r-- 1 root root 4 Feb 8 17:41 f1
drwx------ 2 root root 16384 Feb 8 14:57 lost+found
[root@client data]#cd
[root@client ~]#

3、将主节点node1 的heartbeat服务停止,则备节点node2 接管服务
[root@node1 ha.d]# service heartbeat stop
Stopping High-Availability services:
[ OK ]
[root@node1 ha.d]# drbd-overview
0:nfs Connected Secondary/Primary UpToDate/UpToDate C r----
[root@node1 ha.d]# ifconfig eth0:0
eth0:0 Link encap:Ethernet HWaddr 00:0C:29:AE:83:D1
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:67 Base address:0x2000
[root@node1 ha.d]#
[root@node2 ha.d]# drbd-overview
0:nfs Connected Primary/Secondary UpToDate/UpToDate C r---- /mnt/nfs ext3 950M 18M 885M 2%
[root@node2 ha.d]# ifconfig eth0:0
eth0:0 Link encap:Ethernet HWaddr 00:0C:29:D1:D4:32
inet addr:192.168.101.210 Bcast:192.168.101.254 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:67 Base address:0x2000
[root@node2 ha.d]#
[root@client ~]# ./nfs.sh
---> trying touch x : Wed Feb 8 20:00:58 CST 2012
<----- done touch x : Wed Feb 8 20:00:58 CST 2012
---> trying touch x : Wed Feb 8 20:00:59 CST 2012
<----- done touch x : Wed Feb 8 20:00:59 CST 2012
---> trying touch x : Wed Feb 8 20:01:00 CST 2012
<----- done touch x : Wed Feb 8 20:01:00 CST 2012
---> trying touch x : Wed Feb 8 20:01:01 CST 2012
<----- done touch x : Wed Feb 8 20:01:01 CST 2012
---> trying touch x : Wed Feb 8 20:01:02 CST 2012
<----- done touch x : Wed Feb 8 20:01:02 CST 2012
---> trying touch x : Wed Feb 8 20:01:03 CST 2012
<----- done touch x : Wed Feb 8 20:01:03 CST 2012
---> trying touch x : Wed Feb 8 20:01:04 CST 2012
<----- done touch x : Wed Feb 8 20:01:04 CST 2012
---> trying touch x : Wed Feb 8 20:01:05 CST 2012
<----- done touch x : Wed Feb 8 20:01:05 CST 2012
[root@client ~]# mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
192.168.101.210:/mnt/nfs on /data type nfs (rw,addr=192.168.101.210)
[root@client ~]#
[root@client ~]# ll /data/
total 20
-rw-r--r-- 1 root root 0 Feb 8 19:50 f-client-1
-rw-r--r-- 1 root root 4 Feb 8 17:41 f1
drwx------ 2 root root 16384 Feb 8 14:57 lost+found
[root@client ~]#
[root@node1 ha.d]# service heartbeat start
Starting High-Availability services:
2012/02/08_20:04:49 INFO: Resource is stopped
[ OK ]
[root@node1 ha.d]# drbd-overview
0:nfs Connected Primary/Secondary UpToDate/UpToDate C r---- /mnt/nfs ext3 950M 18M 885M 2%
[root@node1 ha.d]#
