VMware-ESXI RHCS中fence配置

一、簡介

VMware-ESXI5.0中虛擬機通過vmware_fenceagent虛擬fence設備。根據Redhat官網資料,在RHEL5之後,vmware_fence agent因與第三方工具(VMware Perl API)信任關係而被替換爲vmware_fence_soap agent

基於此處測試環境爲ESXI5.0centos6.2,所以使用vmware_fence_soap agent虛擬fence設備。

二、環境

ESXI版本:5.0.0

OS版本:centos6.2 x86_64

wKiom1Mf_w_y2S0yAADzMo0Rx1A722.jpg

三、安裝RHCS    (介於本文主要介紹fence設備,安裝不做詳細介紹)

yumgroupinstall "High Availability"

四、調試fence設備

查看主機狀態

   fence_vmware_soap -a 172.26.184.252 -z -lroot -p internavi -n ha1 -o status

   如遇如下錯誤,請使用uuid查詢虛擬機狀態,high availabilityfence設備也是通過uuid查找設備

   Failed: Unable toobtain correct plug status or plug is not available

通過uuid查看主機狀態

   fence_vmware_soap -a 172.26.184.251 -z -l root -p internavi -U564defee-542d-7f24-a283-eaa2f731d160 -o status

   如果返回Status: ON則表明fence設備正常。

查詢uuid號

   fence_vmware_soap -a 172.26.188.251 -z -l root -pinternavi -o list

五、集羣中fence設備配置示例

cluster.conf配置示例:

<?xml version="1.0"?>
<cluster config_version="12" name="apachecluster">
        <clusternodes>
                <clusternode name="ha1" nodeid="1">
                        <fence>
                                <method name="fence_ha1">
                                        <device action="off" name="esxi_fence2" port="ha1" ssl="on" uuid="564df590-d661-ad5d-bb18-36f21e8ea372"/>
                                </method>
                        </fence>
                </clusternode>
                <clusternode name="ha2" nodeid="2">
                        <fence>
                                <method name="fence_ha2">
                                        <device action="off" name="esxi_fence1" port="ha2" ssl="on" uuid="564defee-542d-7f24-a283-eaa2f731d160"/>
                                </method>
                        </fence>
                </clusternode>
        </clusternodes>
        <cman expected_votes="1" two_node="1"/>
        <fencedevices>
                <fencedevice agent="fence_vmware_soap" ipaddr="172.26.184.251" login="root" name="esxi_fence1" passwd="internavi"/>
                <fencedevice agent="fence_vmware_soap" ipaddr="172.26.184.252" login="root" name="esxi_fence2" passwd="t0mcatu5er"/>
        </fencedevices>
        <rm>
                <failoverdomains>
                        <failoverdomain name="FD" nofailback="1" ordered="1" restricted="0">
                                <failoverdomainnode name="ha1" priority="1"/>
                                <failoverdomainnode name="ha2" priority="2"/>
                        </failoverdomain>
                </failoverdomains>
                <resources>
                        <script file="/etc/init.d/httpd" name="httpd"/>
                        <ip address="172.26.188.225" monitor_link="on"/>
                </resources>
                <service domain="FD" exclusive="1" name="httpd" recovery="relocate">
                        <script ref="httpd"/>
                </service>
        </rm>
</cluster>



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章