Linux-HA Logo

powermac:~ andrew$ cibadmin -?
usage: cibadmin [V?i:o:QDUCEX:t:Srwlsh:MmBfbdRx:p] command
        where necessary, XML data will be obtained using -X, -x, or -p options
Options
        --id (-i) <id>  id of the object being operated on
        --obj_type (-o) <type>  object type being operated on
                Valid values are: nodes, resources, status, constraints
        --verbose (-V)  turn on debug info.  additional instance increase verbosity
        --help (-?)     this help message

Commands
        --cib_erase (-E)
        --cib_query (-Q)
        --cib_create (-C)
        --cib_replace (-R)
        --cib_update (-U)
        --cib_delete (-D)
                        Delete the first object matching the supplied criteria
                        Eg. <op id="rsc1_op1" name="monitor"/>
                        The tagname and all attributes must match in order for the element to be deleted
        --cib_delete_alt (-d)
                        Delete the object at specified fully qualified location
                        Eg. <resource id="rsc1"><operations><op id="rsc1_op1"/>...
                        Requires -o
        --cib_bump (-B)
        --cib_ismaster (-M)
        --cib_sync (-S)

XML data
        --crm_xml (-X) <string>         Retrieve XML from the supplied string
        --xml-file (-x) <filename>      Retrieve XML from the named file
        --xml-pipe (-p)                 Retrieve XML from STDIN

Advanced Options
        --host (-h)     send command to specified host. Applies to cib_query and cib_sync commands only
        --local (-l)    command takes effect locally on the specified host
        --no-bcast (-b) command will not be broadcast even if it altered the CIB
        --sync-call (-s)        wait for call to complete before returning

注記:-x および -p オプションは、2.0.3で追加されました。

CIBにリソースを追加する例です。

cibadmin -C -o resources -X '<primitive id="WebServerIP" class="ocf" type="IPaddr" provider="heartbeat">
    <instance_attributes>
        <attributes>
            <nvpair id="WebServerIP_ip" name="ip" value="127.0.0.26"/>
        </attributes>
     </instance_attributes>
</primitive>'

あるいは、XMLをファイルに入れて、以下のようにすることも可能です。

cibadmin -C -o resources -x file.xml

その上で、以下のコマンドを実行して、特別なパラメータを追加することができます。

cibadmin -U -o resources -X '<primitive id="WebServerIP">
    <instance_attributes>
        <attributes>
            <nvpair id="WebServerIP_nic" name="nic" value="eth0"/>
        </attributes>
     </instance_attributes>
</primitive>'

あるいは、以下の方法で、同じことが可能です。

cibadmin -R -o resources -X '<primitive id="WebServerIP" class="ocf" type="IPaddr" provider="heartbeat">
    <instance_attributes>
        <attributes>
            <nvpair id="WebServerIP_ip" name="ip" value="127.0.0.26"/>
            <nvpair id="WebServerIP_nic" name="nic" value="eth0"/>
        </attributes>
     </instance_attributes>
</primitive>'

instance_attributesを一掃するには、

cibadmin -D -o resources -X '<primitive id="WebServerIP">
    <instance_attributes/>
</primitive>'

あるいは、リソース全体を削除するためには、以下を実行します。

cibadmin -D -o resources -X '<primitive id="WebServerIP"/>'

関連情報

ja/v2/Examples/Simple_ja[1]ja/v2/Examples/Advanced_ja[2]


References

[1]http://www.linux-ha.org/ja/v2/Examples/Simple_ja
[2]http://www.linux-ha.org/ja/v2/Examples/Advanced_ja


This information provided courtesy of the Linux-HA project at http://linux-ha.org/