This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag

Homepage

About Us

Contact Us

Legal Info

How To Contribute

Security Issues

This web page is no longer maintained. Information presented here exists only to avoid breaking historical links.
The Project stays maintained, and lives on: see the Linux-HA Reference Documentation.
To get rid of this notice, you may want to browse the old wiki instead.

1 February 2010 Hearbeat 3.0.2 released see the Release Notes

18 January 2009 Pacemaker 1.0.7 released see the Release Notes

16 November 2009 LINBIT new Heartbeat Steward see the Announcement

Last site update:
2017-12-13 14:47:08

A Simple Apache Web Server HA Configuration

A common configuration for an HA server is simply to provide an IP address and a single service to be failed over. This example will be an active/passive configuration for the Apache web server.

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

paul    1.2.3.4 apache

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

<cib>
  <configuration>
    <crm_config/>
    <nodes/>
    <resources>
      <group id="apache_group">
        <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="apache" class="heartbeat" type="apache"/>
      </group>
    </resources>
    <constraints>
      <rsc_location id="run_apache_group" rsc="apache_group">
        <rule id="pref_run_apache_group" score="100">
          <expression attribute="#uname" operation="eq" value="paul"/>
        </rule>
      </rsc_location>
    </constraints>
  </configuration>
  <status/>
</cib>

Explanation

Alternate Version 2 Configuration

<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="apache" class="heartbeat" type="apache"/>
    </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_colocation id="same_apache_ip" from="ip_resource_1" to="apache" score="INFINITY"/>
    </constraints>
  </configuration>
  <status/>
</cib>

See Also

GettingStarted/Apache