状况1,主服务器网络故障,将从服务器作为主服务器,原主服务器改为从服务器
(最后原主服务器从原从服务器同步数据)
从服务器host2:
#service drbd status | tail -1
0:db WFConnection Secondary/Unknown UpToDate/DUnknown C
#drbdadm disconnect db
#drbdadm primary db
#mount /dev/drbd0 /mnt/drbd/
#service drbd status | tail -1
0:db StandAlone Primary/Unknown UpToDate/DUnknown r----- ext3
#cp /mnt/drbd/anaconda-ks.cfg /mnt/drbd/useful
主服务器host1(网络故障未修复):
#service drbd status | tail -1
0:db WFConnection Primary/Unknown UpToDate/DUnknown C /mnt/drbd ext3
#drbdadm disconnect db
#cp /mnt/drbd/anaconda-ks.cfg /mnt/drbd/useless
#umount /mnt/drbd/
#drbdadm down db
#service drbd status | tail -1
0:db Unconfigured
#drbdadm create-md db
恢复网络故障后(如果用虚拟机测试就启动虚拟机的网卡)
从服务器host2:
#drbdadm connect db
#service drbd status | tail -1
0:db WFConnection Primary/Unknown UpToDate/DUnknown C /mnt/drbd ext3
主服务器host1(网络故障已经修复):
#drbdadm up db
#service drbd status | tail -1
0:db Connected Secondary/Primary UpToDate/UpToDate C
从服务器host2:
#service drbd status | tail -1
0:db Connected Primary/Secondary UpToDate/UpToDate C /mnt/drbd ext3
阅读(2425) | 评论(0) | 转发(0) |