Linux-HA Logo

An Active/Active Two IP address Configuration

A common configuration is that of a high-availability server which simply provides two IP addresses (1.2.3.4, and 1.2.3.5) to be failed over[1] between the node[2]s of our cluster[3]. We will set this up as an active/active[4] configuration.

Version 1 Configuration in /etc/ha.d/haresources

paul    1.2.3.4
silas   1.2.3.5

Version 2 Configuration in /var/lib/heartbeat/crm/cib.xml

<cib>
  <configuration>
    <crm_config/>
    <nodes/>
    <resources>
      <primitive id="ip_resource_1" class="ocf" type="IPaddr" provider="heartbeat">
        <instance_attributes>
          <attributes>
            <nvpair name="ip" value="1.2.3.4"/>
          </attributes>
        </instance_attributes>
      </primitive>
      <primitive id="ip_resource_2" class="ocf" type="IPaddr" provider="heartbeat">
        <instance_attributes>
          <attributes>
            <nvpair name="ip" value="1.2.3.5"/>
          </attributes>
        </instance_attributes>
      </primitive>
    </resources>
    <constraints>
      <rsc_location id="run_ip_resource_1" rsc="ip_resource_1">
        <rule id="pref_run_ip_resource_1" score="100">
          <expression attribute="#uname" operation="eq" value="paul"/>
        </rule>
      </rsc_location>
      <rsc_location id="run_ip_resource_2" rsc="ip_resource_2">
        <rule id="pref_run_ip_resource_2" score="100">
          <expression attribute="#uname" operation="eq" value="silas"/>
        </rule>
      </rsc_location>
    </constraints>
  </configuration>
  <status/>
</cib>

Explanation

See Also

GettingStarted/TwoIPaddresses[5]


References

[1]http://en.wikipedia.org/wiki/Failover
[2]http://www.linux-ha.org/node
[3]http://en.wikipedia.org/wiki/Computer_cluster
[4]http://www.linux-ha.org/ActiveActive
[5]http://www.linux-ha.org/GettingStarted/TwoIPaddresses


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