Добавляем жесткие диски, создаем точки монтирования
nodeN# dmesg | grep ada1 nodeN# mkdir /disk2
nodeN# cat /etc/hast.conf
resource r0 { on node1 { local /dev/ada1 remote 10.Z.M.200+X } on node2 { local /dev/ada1 remote 10.Z.M.100+X } }
nodeN# service hastd rcvar nodeN# service hastd start
nodeN# hastctl status nodeN# hastctl create r0 node1# hastctl role primary r0 node2# hastctl role secondary r0 nodeN# hastctl status node1# newfs /dev/hast/r0 node1# mount /dev/hast/r0 /disk2 node1# cp /etc/rc.conf /disk2/
node1# umount /disk2 node1# hastctl role secondary r0 node2# hastctl role primary r0 node2# fsck -y -t ufs /dev/hast/r0 node2# mount /dev/hast/r0 /disk2
node2# umount /disk2 node2# hastctl role secondary r0
Выбираем узел, данные которого будут затерты.
nodeZ# hastctl create r0 nodeZ# hastctl role secondary r0 nodeM# hastctl role primary r0 nodeZ# hastctl status nodeM# hastctl status
nodeN# service heartbeat stop nodeN# cat /usr/local/etc/ha.d/resource.d/hast
#!/bin/sh case $1 in status) hastctl status r0 | grep -q 'init' && hastctl role secondary r0 ;; start) hastctl role primary r0 sleep 60 fsck -y -t ufs /dev/hast/r0 mount /dev/hast/r0 /disk2 ;; stop) mount | grep -q hast && umount /disk2 hastctl role secondary r0 ;; esac exit 0
nodeN# chmod +x /usr/local/etc/ha.d/resource.d/hast nodeN# cat /usr/local/etc/ha.d/haresources
node1.corpX.un hast
nodeN# service heartbeat start