标签:
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.10.60.16 node1 10.10.60.55 node2 |
# for i in cman ricci ;do rpm -qa | grep $i;done cman-3.0.12.1-32.el6.x86_64 ricci-0.16.2-55.el6.x86_64 |
[root@node1 ~]# virsh -c qemu+ssh://10.10.60.10/system root@10.10.60.10‘s password: Welcome to virsh, the virtualization interactive terminal. Type: ‘help‘ for help with commands ‘quit‘ to quit virsh # list Id Name State ---------------------------------------------------- 2 cLient_App running 14 node1 running 18 node2 running virsh # |
[root@node1 ~]# cat /etc/cluster/cluster.conf <?xml version="1.0"?> <cluster config_version="12" name="kvm_fence"> <clusternodes> <clusternode name="node1" nodeid="1"> <fence> <method name="virsh"> <device action="reboot" name="virsh" port="node1"/> </method> </fence> </clusternode> <clusternode name="node2" nodeid="2"> <fence> <method name="virsh"> <device action="reboot" name="virsh" port="node2"/> </method> </fence> </clusternode> </clusternodes> <cman expected_votes="1" two_node="1"/> <fencedevices> <fencedevice agent="fence_virsh" ipaddr="10.10.60.10" login="root" name="virsh" passwd="root"/> </fencedevices> </cluster> 验证cluster.conf语句
[root@node1 ~]# ccs_config_validate
Configuration validates 备注:cluster.conf文件中fencedevice agent部分参数由man fence_virsh可知
|
[root@node1 ~]# fence_virsh --ip=10.10.60.10 --username=root --password=root -x -n node2 Success: Rebooted 或者 [root@node1 ~]# fence_node node2 fence node2 success fence_node命令会自动取fence_virsh中相关参数 |
标签:
原文地址:http://www.cnblogs.com/tonychiu/p/5766537.html