Newsgroup: it.comp.os.linux.sys
Titolo: Heartbeat - aggiungere IP

Sto diventando matto per configurare Heartbeat V2.
Devo aggiungere 4 IP all'attuale configurazione, cioï¿œ
aggiungere 4 "risorse" se non ho capito male.
La configurazione ï¿œ "base" in pratica 2 nodi Attivo/Passivo
con il solo monitoraggio dell' IP ( raggiungibilitï¿œ ).
Scopo finale, se il nodo Attivo si rompe e non pinga il secondario
Attiva i 4 IP.
Quest ï¿œ il mio cib.xml:
Non esiste un comando per aggiungere gli IP
( ho visto che la versione "Pacemaker" lo fa .. ma nella versione redhat 
non lo trovo )
-----------------------------------------
  <cib generated="true" admin_epoch="0" have_quorum="true" 
ignore_dtd="false" num_peers="2" cib_feature_revision="1.3" epoch="38" 
num_updates="40" cib-last-written="Wed Jun 24 19:28:06 2009" 
ccm_transition="2" dc_uuid="77c22816-5c72-4674-991e-d8791bddb456">
    <configuration>
      <crm_config>
        <cluster_property_set id="cib-bootstrap-options">
          <attributes>
            <nvpair id="cib-bootstrap-options-dc-version" 
name="dc-version" value="2.1.3-node: 
552305612591183b1628baa5bc6e903e0f1e26a3"/>
          </attributes>
        </cluster_property_set>
      </crm_config>
      <nodes>
        <node id="77c22816-5c72-4674-991e-d8791bddb456" 
uname="
n2.vs.net
" type="normal"/>
        <node id="336f765d-2034-4b1a-bdb3-3d0b409ce1cf" 
uname="
n1.vs.net
" type="normal"/>
      </nodes>
      <resources>
        <group id="My-APACHE-group" ordered="true" collocated="true">
          <primitive id="IP-Addr" class="ocf" type="IPaddr2" 
provider="heartbeat">
            <instance_attributes id="IP-Addr_instance_attrs">
              <attributes>
                <nvpair id="IP-Addr_target_role" name="target_role" 
value="started"/>
                <nvpair name="ip" value="192.168.1.180" 
id="7a224575-0932-49ef-bca9-580d7fb48c2c"/>
              </attributes>
            </instance_attributes>
          </primitive>
          <instance_attributes id="My-APACHE-group_instance_attrs">
            <attributes>
              <nvpair id="My-APACHE-group_target_role" 
name="target_role" value="started"/>
            </attributes>
          </instance_attributes>
        </group>
      </resources>
      <constraints>
        <rsc_location id="runs_on_pref_node" rsc="My-APACHE-group">
          <rule id="prefered_runs_on_pref_node" score="100">
            <expression attribute="#uname" operation="eq" 
value="
n1.vs.net
" id="24dae218-4131-4d13-91b9-c91082e9e264"/>
          </rule>
        </rsc_location>
      </constraints>
    </configuration>
    <status>
      <node_state id="336f765d-2034-4b1a-bdb3-3d0b409ce1cf" 
uname="
n1.vs.net
" crmd="online" crm-debug-origin="do_update_resource" 
shutdown="0" in_ccm="true" join="member" ha="active" expected="member">
        <lrm id="336f765d-2034-4b1a-bdb3-3d0b409ce1cf">
          <lrm_resources>
            <lrm_resource id="IP-Addr" type="IPaddr2" class="ocf" 
provider="heartbeat">
              <lrm_rsc_op id="IP-Addr_monitor_0" operation="monitor" 
crm-debug-origin="do_update_resource" 
transition_key="5:0:b548c77c-f002-4efd-b628-ddc3c23542e6" 
transition_magic="0:7;5:0:b548c77c-f002-4efd-b628-ddc3c23542e6" 
call_id="2" crm_feature_set="2.0" rc_code="7" op_status="0" interval="0" 
op_digest="9cf99fd8c75e11afe3f357d232b65f87"/>
              <lrm_rsc_op id="IP-Addr_start_0" operation="start" 
crm-debug-origin="do_update_resource" 
transition_key="5:1:b548c77c-f002-4efd-b628-ddc3c23542e6" 
transition_magic="0:0;5:1:b548c77c-f002-4efd-b628-ddc3c23542e6" 
call_id="3" crm_feature_set="2.0" rc_code="0" op_status="0" interval="0" 
op_digest="9cf99fd8c75e11afe3f357d232b65f87"/>
            </lrm_resource>
          </lrm_resources>
        </lrm>
        <transient_attributes id="336f765d-2034-4b1a-bdb3-3d0b409ce1cf">
          <instance_attributes 
id="status-336f765d-2034-4b1a-bdb3-3d0b409ce1cf">
            <attributes>
              <nvpair 
id="status-336f765d-2034-4b1a-bdb3-3d0b409ce1cf-probe_complete" 
name="probe_complete" value="true"/>
            </attributes>
          </instance_attributes>
        </transient_attributes>
      </node_state>
      <node_state id="77c22816-5c72-4674-991e-d8791bddb456" 
uname="
n2.vs.net
" crmd="online" crm-debug-origin="do_update_resource" 
in_ccm="true" join="member" ha="active" expected="member" shutdown="0">
        <lrm id="77c22816-5c72-4674-991e-d8791bddb456">
          <lrm_resources>
            <lrm_resource id="IP-Addr" type="IPaddr2" class="ocf" 
provider="heartbeat">
              <lrm_rsc_op id="IP-Addr_monitor_0" operation="monitor" 
crm-debug-origin="do_update_resource" 
transition_key="3:0:b548c77c-f002-4efd-b628-ddc3c23542e6" 
transition_magic="0:7;3:0:b548c77c-f002-4efd-b628-ddc3c23542e6" 
call_id="2" crm_feature_set="2.0" rc_code="7" op_status="0" interval="0" 
op_digest="9cf99fd8c75e11afe3f357d232b65f87"/>
            </lrm_resource>
          </lrm_resources>
        </lrm>
        <transient_attributes id="77c22816-5c72-4674-991e-d8791bddb456">
          <instance_attributes 
id="status-77c22816-5c72-4674-991e-d8791bddb456">
            <attributes>
              <nvpair 
id="status-77c22816-5c72-4674-991e-d8791bddb456-probe_complete" 
name="probe_complete" value="true"/>
            </attributes>
          </instance_attributes>
        </transient_attributes>
      </node_state>
    </status>
  </cib>
-----------------------------------------
... Ma non era tutto + semplice con la V1 ??!!
Grazie mille!!
-- Yena --

 -- Yena --
Se qualcuno ne avesse bisogno posto una soluzione che va..
anche se non so se sia molto elegante:
<cib generated="true" admin_epoch="0" have_quorum="true" 
ignore_dtd="false" num_peers="2" cib_feature_revision="1.3" epoch="38" 
ccm_transition="4" dc_uuid="77c22816-5c72-4674-991e-d8791bddb456" 
num_updates="60">


        <group id="My-APACHE-group_B" ordered="true" collocated="true">
          <primitive id="IP-Addr_B" class="ocf" type="IPaddr2" 
provider="heartbeat">
            <instance_attributes id="IP-Addr_instance_attrs_B">
              <attributes>
                <nvpair id="IP-Addr_target_role_B" name="target_role" 
value="started"/>
                <nvpair name="ip" value="192.168.1.181" 
id="7a224575-0932-49ef-bca9-580d7fb48c2z"/>
              </attributes>
            </instance_attributes>
          </primitive>
          <instance_attributes id="My-APACHE-group_instance_attrs_B">
            <attributes>
              <nvpair id="My-APACHE-group_target_role_B" 
name="target_role" value="started"/>
            </attributes>
          </instance_attributes>
        </group>
        <group id="My-APACHE-group_C" ordered="true" collocated="true">
          <primitive id="IP-Addr_C" class="ocf" type="IPaddr2" 
provider="heartbeat">
            <instance_attributes id="IP-Addr_instance_attrs_C">
              <attributes>
                <nvpair id="IP-Addr_target_role_C" name="target_role" 
value="started"/>
                <nvpair name="ip" value="192.168.1.182" 
id="7a224575-0932-49ef-bca9-580d7fb48d2z"/>
              </attributes>
            </instance_attributes>
          </primitive>
          <instance_attributes id="My-APACHE-group_instance_attrs_C">
            <attributes>
              <nvpair id="My-APACHE-group_target_role_C" 
name="target_role" value="started"/>
            </attributes>
          </instance_attributes>
        </group>
      </resources>
      <constraints>
        <rsc_location id="runs_on_pref_node" rsc="My-APACHE-group">
          <rule id="prefered_runs_on_pref_node" score="100">
            <expression attribute="#uname" operation="eq" 
value="
n1.vs.net
" id="d4b3ba89-9c41-444c-90db-9839c4fa3cff"/>
          </rule>
        </rsc_location>
        <rsc_location id="runs_on_pref_node_B" rsc="My-APACHE-group_B">
          <rule id="prefered_runs_on_pref_node_B" score="100">
            <expression attribute="#uname" operation="eq" 
value="
n1.vs.net
" id="520e2e0e-e92f-49ee-8e1b-7c5f77beebee"/>
          </rule>
        </rsc_location>
        <rsc_location id="runs_on_pref_node_C" rsc="My-APACHE-group_C">
          <rule id="prefered_runs_on_pref_node_C" score="100">
            <expression attribute="#uname" operation="eq" 
value="
n1.vs.net
" id="520e2e0e-e92f-49ee-8e1b-8c5f77beebee"/>
          </rule>
        </rsc_location>
      </constraints>
    </configuration>
  </cib>
-- Yena --

 anche se non so se sia molto elegante:
[CUT]
Perchï¿œ fai dei gruppi con una sola risorsa dentro? Se non hai intenzione 
di aggiungere altre risorse non ha senso.
Comunque ti consiglio di usare heatbeat 2.1.4 preso da qua: 
http://download.opensuse.org/repositories/server:/ha-clustering:/lha-2.1/
ï¿œ l'ultima release prima dello split pacemaker/heartbeat e mantiene la 
stessa config delle precedenti. Tuttavia ha diversi fix importanti 
rispetto alla 2.1.3.

 rispetto alla 2.1.3.
Aggiungo gruppi perchï¿œ aggiungendo
<nvpair name="ip" value="192.168.1.183" 
id="7a224575-0932-49ef-bca9-580d7fb48d2z"/>
<nvpair name="ip" value="192.168.1.184" 
id="7a424575-0932-49ef-bca9-580d7fb48d2z"/>
....
.....
Non da errore ma non li configura nella scheda
Configura solo il primo.
La Gui di RedHat per quello che devo fare io mi sembra troppo pesante,
l'ho provata e per usarla occorre installare anche la madonn ... quindi 
non mi convince.
E se usassi Pacemaker ?
-- Yena --