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

21 December 2007 Heartbeat release 2.1.3 is now out Download it and install it!

11 October 2007 NEW educational HA/DR Blog hosted by Alan Robertson

9 April 2007 Check out the Cool Heartbeat Screencasts: Installation, Intro to the GUI Part of the Heartbeat Education project

Last site update:
2008-05-17 02:54:47

Two Apache Web Servers in an Active/Active Configuration

This configuration is for a high-availability server which provides two IP addresses (1.2.3.4, and 1.2.3.5) to be failed over between the nodes of our cluster, and an Apache server for each IP address. We will set this up as an active/active configuration.

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

paul    1.2.3.4  apache::/apache1dir/httpd.cf
silas   1.2.3.5  apache::/apache2dir/httpd.cf

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

<cib>
  <configuration>
    <crm_config/>
    <nodes/>
    <resources>
      <group id="apache_group_1">
        <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">
          <instance_attributes>
            <attributes>
              <nvpair name="1" value="/apache1dir/httpd.cf"/>
            </attributes>
          </instance_attributes>
        </primitive>
      </group>
      <group id="apache_group_2">
        <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>
        <primitive id="apache" class="heartbeat" type="apache">
          <instance_attributes>
            <attributes>
              <nvpair name="1" value="/apache2dir/httpd.cf"/>
            </attributes>
          </instance_attributes>
        </primitive>
      </group>
    </resources>
    <constraints>
      <rsc_location id="run_apache_group_1" rsc="apache_group_1">
        <rule id="pref_run_apache_group_1" score="100">
          <expression attribute="#uname" operation="eq" value="paul"/>
        </rule>
      </rsc_location>
      <rsc_location id="run_apache_group_2" rsc="apache_group_2">
        <rule id="pref_run_apache_group_2" score="100">
          <expression attribute="#uname" operation="eq" value="silas"/>
        </rule>
      </rsc_location>
    </constraints>
  </configuration>
  <status/>
</cib>

Explanation

See Also

GettingStarted/TwoApaches