5.查看备份机器的日志,发现已经开始启动关联的服务,此时备份机器上cat /proc/drbd
出现Primary/Secondary 主机器上显示Secondary/Primary,说明DRBD切换成功,然后查看mfs是否启动,如果启动成功,恭喜您,高可用的MFS文件分布式系统已经搭建好了.
查看日志:
[root@mfs-bak ha.d]# tail -f /var/log/ha.log
IPaddr[16737]:2012/06/05_19:23:31 INFO: Using calculated nic for 192.168.8.210: eth0
IPaddr[16737]:2012/06/05_19:23:31 INFO: Using calculated netmask for 192.168.8.210: 255.255.255.0
IPaddr[16737]:2012/06/05_19:23:31 INFO: eval ifconfig eth0:0
192.168.8.210 netmask 255.255.255.0 broadcast 192.168.8.255
IPaddr[16720]:2012/06/05_19:23:32 INFO: Success
mach_down[16548]:2012/06/05_19:23:32 info: /usr/share/heartbeat/mach_down: nice_failback: foreign resources acquired
mach_down[16548]:2012/06/05_19:23:32 info: mach_down takeover complete for node mfs-master.
heartbeat[16471]: 2012/06/05_19:23:32 info: mach_down takeover complete.
heartbeat[16471]: 2012/06/05_19:23:49 WARN: node mfs-master: is dead
heartbeat[16471]: 2012/06/05_19:23:49 info: Dead node mfs-master gave up resources.
heartbeat[16471]: 2012/06/05_19:23:49 info: Link mfs-master:eth1 dead.
切换后mfs是否自己启动起来:
[root@mfs-bak ha.d]# ps aux |grep mfs
mfs 16650 15.8 27.3 93800 80484 ? S< 19:23 0:02 /usr/local/mfs/sbin/mfsmaster start
root 16843 0.0 0.2 61220 748 pts/0 S+ 19:23 0:00 grep mfs
查看有没有自动接管VIP
[root@mfs-bak ha.d]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:5a:64:12 brd ff:ff:ff:ff:ff:ff
inet 192.168.8.201/24 brd 192.168.8.255 scope global eth0
inet 192.168.8.210/24 brd 192.168.8.255 scope global secondary eth0:0
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:5a:64:1c brd ff:ff:ff:ff:ff:ff
inet 192.168.125.201/24 brd 192.168.125.255 scope global eth1
结论:主服务器的heartbeat 服务停掉后,从服务器heartbeat 服务马上接管过来!
下面我们再重启主服务器 heartbeat 服务,他会自动再抢过来!
[root@mfs-master /]# service heartbeat start
Starting High-Availability services:
[ OK ]
[root@mfs-master /]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:d8:bc:3e brd ff:ff:ff:ff:ff:ff
inet 192.168.8.200/24 brd 192.168.8.255 scope global eth0
inet 192.168.8.210/24 brd 192.168.8.255 scope global secondary eth0:0
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:d8:bc:48 brd ff:ff:ff:ff:ff:ff
inet 192.168.125.200/24 brd 192.168.125.255 scope global eth1
本人也刚开始对MFS进行初步了解,整个架构从搭建到最后的测试花了不少时间,凝聚了不少心血!希望大家提出宝贵的意见!!