Show TOC

Active-Active DeploymentsLocate this document in the navigation structure

For high availability at the project level, configure active-active mode to create two instances of a project that run simultaneously.

To deploy a project in active-active or HA (high availability) mode, set <Project ha="true"> in the CCR file. In an active-active deployment, two instances of a project run simultaneously in a cluster. Active-active projects are typically configured so that the cluster starts the two instances of the project on different nodes (hosts). This avoids the risk of a single point of failure at the project level.

One instance of the project is elected as the primary instance. If one of the instances is already active, it is the primary instance. If the failed instance restarts, it assumes the secondary position and maintains this position unless the current instance fails or is stopped.

When the secondary project server starts and does not find the primary project server, it reattempts a connection to the primary server for 30 seconds. If it fails to successfully connect to the existing primary server, it takes the responsibility of primary server.

When you configure an active-active project, you can set instance affinities to control whether the instances can run on the same node.

Failover refers to restarting a process after it stops, whereas active-active refers to keeping a stand-by application already running to take over processing. If required, you could have an HA deployment Project ha ="true" with Failover enable="false".

Example

This example shows the Deployment section of the CCR file for an HA deployment with failover enabled and affinities configured on both instances of an active-active project.
<Deployment>
  <Project ha="true">
    <Options>
      <Option name="debug-level">1</Option>
    </Options>
    <Instances>
      <Instance name="primary">
        <Affinities>
        <!-- Affinities are optional.  -->
        <Affinity type="controller" charge="positive" strength="weak" value="node1"/> 
          <Affinity type="instance" charge="negative" strength="strong" value="secondary"/>
        </Affinities>
        <Failover enable="false"/>
      </Instance>
      <Instance name="secondary">
        <Affinities>
        <!-- Affinities are optional.  --> 
          <Affinity type="controller" charge="positive" strength="weak" value="node2"/> 
          <Affinity type="instance" charge="negative" strength="strong" value="primary"/>
        </Affinities>
        <Failover enable="true">
          <FailureInterval>120</FailureInterval> <!-- in seconds -->
          <FailuresPerInterval>4</FailuresPerInterval> <!-- counter -->
        </Failover>
      </Instance>
    </Instances>
  </Project> 
</Deployment>