一、重要知识

ILO2 对应的fence agent是fence_ilo,ILO3,ILO4对应的fence agent是fence_ipmilan。

使用fence_ipmilan agent时,需要节点安装ipmitool工具,否则报错:

agent "fence_ipmilan" reports: ipmilan: ipmitool not found! failed: Failed to initialize。


二、fence_ipmilan调试指令

查看主机状态

fence_ipmilan -P -A password -l cluster -p hpinvent -o status -a 10.10.129.171


三、cluster.conf配置示例

<?xml version="1.0"?>
<cluster config_version="14" name="psql">
        <clusternodes>
                <clusternode name="trfdb01" nodeid="1">
                        <fence>
                                <method name="ilo">
                                        <device name="fence_node1"/>
                                </method>
                        </fence>
                </clusternode>
                <clusternode name="trfdb02" nodeid="2">
                        <fence>
                                <method name="ilo">
                                        <device name="fence_node2"/>
                                </method>
                        </fence>
                </clusternode>
        </clusternodes>
        <cman expected_votes="1" two_node="1"/>
        <fencedevices>
                <fencedevice agent="fence_ipmilan" action="off" auth="password" ipaddr="10.10.129.170" lanplus="on" login="cluster" name="fence_node1" passwd="hpinvent"/>
                <fencedevice agent="fence_ipmilan" action="off" auth="password" ipaddr="10.10.129.171" lanplus="on" login="cluster" name="fence_node2" passwd="hpinvent"/>
        </fencedevices>
        <rm>
                <failoverdomains>
                        <failoverdomain name="FD" nofailback="1" ordered="1">
                                <failoverdomainnode name="trfdb01" priority="1"/>
                                <failoverdomainnode name="trfdb02" priority="1"/>
                        </failoverdomain>
                </failoverdomains>
                <resources>
                        <ip address="10.10.0.232/24" sleeptime="10"/>
                        <fs device="/dev/dm-1" fsid="19744" fstype="ext4" mountpoint="/var/lib/pgsql/9.1/data" name="filesystem"/>
                        <script file="/etc/init.d/postgresql-9.1" name="postgres"/>
                </resources>
                <service domain="FD" name="postgres" recovery="relocate">
                        <ip ref="10.10.0.232/24"/>
                        <fs ref="filesystem">
                                <script ref="postgres"/>
                        </fs>
                </service>
        </rm>
        <logging to_syslog="no"/>
</cluster>