Discovering Multitier and Multitarget System Replication

Objective

After completing this lesson, you will be able to describe multitier and multitarget system replication

Multitier System Replication

To offer higher levels of availability, you can link together multiple systems in a SAP HANA multitier system replication landscape.

With Multitier system replication, a tier 2 system replication setup can be used as the source for replication in a chained setup of primary site, tier 2 secondary site, and tier 3 secondary site.

After setting up a basic system replication scenario, you add a third system to provide another level of redundancy. In a multitier setup, the primary system is always on tier 1, a tier 2 secondary has a primary system as its replication source, and a tier 3 secondary has the tier 2 secondary as its replication source.

Multitier system replication enables replication modes, which depend on the tier 1 to tier 2 replication mode.

In general, multitier system replication does not allow operation mode mixtures. However, there is one exception. If the logreplay_readaccess operation mode is configured between tier 1 and tier 2, the logreplay operation mode can be configured between tier 2 and tier 3.

Set Up SAP HANA Multitier System Replication

You can configure multitier system replication using the following tools:

  • The SAP HANA Cockpit

  • hdbnsutil

  • SAP HANA Studio

To set up multitier system replication, you have installed and configured three identical, independently operational SAP HANA systems: a primary system, a tier 2 secondary system, and a tier 3 secondary system.

To use hdbnsutil to set up multitier system replication, you must perform the steps below. In this scenario, there are three SAP HANA systems: A, B, and C, named Tier1 , Tier2, and Tier3, respectively. In addition, in this scenario, multitier system replication supports a tier 2 secondary with sync replication mode and a tier 3 secondary with async replication mode.

Set up an SAP HANA Multitier System Replication Using hdbnsutil

  1. Start SAP HANA system A and back up the system database and all tenant databases.

  2. Enable system replication and give system A a logical name:

    hdbnsutil -sr_enable --name=Tier1

  3. Stop the tier 2 secondary system B.

  4. Register system B as tier 2:

    Code Snippet
    12
    hdbnsutil -sr_register --replicationMode=sync --name=Tier2 --remoteInstance=<instID> --remoteHost=<hostA>

  5. Start the tier 2 secondary system B.

  6. Enable tier 2 as the source for a tier 3 secondary system:

    hdbnsutil -sr_enable

  7. Stop the tier 3 secondary system C.

  8. Register system C as tier 3:

    Code Snippet
    12
    hdbnsutil -sr_register --replicationMode=async --name=Tier3 --remoteInstance=<instID> --remoteHost=<hostB>

  9. Start the tier 3 secondary system C.

Using the SAP HANA Cockpit, you can set up multitier system replication in one step. After you have entered the system details for tier 1 and tier 2, you can add the details for the tier 3 system.

To activate the tier 3 system replication in the wizard, choose the Add Tier 3 System button.
On the primary system, the system replication tile shows a mini graphic showing all tiers. The system replication overview app shows the detailed status per service for all tiers

If the primary system fails, a takeover to the tier 2 secondary system is done. Once your failed site is operational again, you can attach it as a tier 3 secondary system or you can restore the original multitier system replication configuration.

Multitarget System Replication

In a multitarget system replication, the primary system can replicate data changes to more than one secondary system.

Multitarget system replication can bring advantages for several use cases:

  • Update scenarios

  • Rearrangements of system replication multitier chains

  • Reaching higher availability (before stopping existing structures, new structures can be built and established)

On the primary system, the system replication tile shows a mini graphic showing all tiers. The system replication overview app shows the detailed status per service for all tiers
Command line: The output of the command hdbnsutil -sr_state is shown

Multitarget Replication with Read-Enabled Secondary Site

In a multitarget system replication setup, you can configure multiple secondary systems as Active/Active (read enabled). Only one of these secondary systems can be accessed using hint-based statement routing; the others must be accessed using a direct connection.

An example: In Europe, the leading SAP HANA system replicates data to local SAP HANA systems in the US, Africa, and China. The local clients all perform their updates in the European leading system.

You can configure which of the read-enabled secondary systems is allowed for hint-based statement routing using the parameter: global.ini/[ system_replication]/hint_based_routing_site_name = <site_name>.

So far, the feature is implemented for Tier 2 systems only – Tier 3 are not enabled for this feature. Note that systems which are supposed to use this feature are connected directly to primary system (Tier 1).

Disaster Recovery Scenarios for Multitarget System Replication

Several solutions are available when the systems involved in a multitarget system replication configuration fail.

We are using the setup described in the figure, Multitarget Replication Failure on Primary System, as an example to describe the procedure. In this setup, primary system A replicates data changes to secondary system B located in the same data center. Primary system A also replicates data changes to the secondary system C located in data center 2. Secondary system C is a source system for a further secondary system D located in the same data center with system C.

An example of a base setup of multitarget replication: In data center 1, system A fails. System B takes over. To provide a valid replication path, system B automatically re-registers itself to system C in data center 2.

When primary system A fails, proceed as follows:

  1. Take over on secondary system B in data center 1.

  2. Register secondary system C in data center 2 to the new primary system B in data center 1. Then, register secondary system D in data center 2 to secondary system C.

  3. After the failure on the previous primary system A is solved, register it to the new primary system B in data center 1.

Alternatively, you can set the global.ini/[system_replication]/register_secondaries_on_takeover parameter to True and take over on secondary system B in data center 1. As a result, secondary system C in data center 2 will register automatically to the new primary system B, while secondary system D in data center 2 will register automatically to secondary system C.

After the failure on the previous primary system A is solved, register it to the new primary system B in data center 1.

An example of a base setup multitarget replication: In data center 2, system C fails. To provide a valid replication path, system B automatically re-registers itself to system D in data center 2.

When secondary system C fails, register secondary system D to secondary system B in data center 1.

Alternatively, you can set parameters on the specific secondary so that the secondary system D will register automatically secondary system D to secondary system B in data center 1:

  • global.ini/[system_replication]/alternative_sources
  • global.ini/[system_replication]/retries_before_register_to_alternative_source

Example: alternative_sources=SiteC:sync,SiteB:async,..

An example of a base setup of multitarget replication: In data center 1, system C takes over. A valid replication path to system D is still available.

When all the systems in data center 1 fail as shown in figure, Multi Target Replication Failure of Data Center 1, proceed as follows:

  1. Take over on secondary system C in data center 2.

  2. After the failure on the previous primary system is solved, register system A to the new primary system C in data center 2.

  3. Register secondary system B as tier 3 to system A in data center 1.

Use Multitarget System Replication for Near Zero Downtime Upgrades

You can upgrade your SAP HANA systems running in a multitarget system replication setup.

Example:

Primary system A replicates data changes to secondary system B located in the same data center. Primary system A also replicates data changes to the secondary system C located in data center 2. Secondary system C is a source system for a further secondary system D located in the same data center.

This setup provides the following conditions:

  • The primary system is the production system.

  • The secondary system located in the same data center as the primary system will become the production system after the upgrade. Further secondary systems are located in a remote data center.

  • There is no replication error.

Almost no downtime upgrades can also be performed in multitarget system replication setups.

Log in to track your progress & complete quizzes