对主Primary/Secondary模型的drbd服务来讲,在��个时刻只能有一个节点为Primary,因此,要切换两个节点的角色,只能在先将原有的Primary节点设置为Secondary后,才能原来的Secondary节点设置为Primary:
Node1:
# cp -r /etc/drbd.* /mnt/drbd
# umount /mnt/drbd
# drbdadm secondary web
查看状态:
# drbd-overview
0:web Connected Secondary/Secondary UpToDate/UpToDate C r----
Node2:
# drbdadm primary web
# drbd-overview
0:web Connected Primary/Secondary UpToDate/UpToDate C r----
# mkdir /mnt/drbd
# mount /dev/drbd0 /mnt/drbd
使用下面的命令查看在此前在主节点上复制至此设备的文件是否存在:
# ls /mnt/drbd