Updated on 2022-12-08 GMT+08:00

Configuring the System Replication

In the cross-AZ or cross-region DR scenario, configure the Multitier System Replication function after the System Replication function between the nodes for HA has been configured successfully.

Configuration scheme: Set the standby HA node as the active node and the DR node as the standby node. The DR node synchronizes data with the standby HA node. Configure the mode of Multitier System Replication to async.

Prerequisites

Procedure

  1. Configure the active node.

    1. Use PuTTY to log in to the NAT server with an elastic IP address bound. Ensure that user root and the key file (.ppk file) are used for authentication. Then, use SSH to switch to the ECS that will work as the active node.
    2. Switch to the administrator mode:

      su - $SIDadm

      For example, run the following command to switch to the administrator mode:

      su - s00adm

      Information similar to the following is displayed:

      hana001:/hana/shared/S00/HDB00>   
    3. Run the following command to configure the SAP HANA node as the active one:

      hdbnsutil -sr_enable --name=siteA

      In the preceding command, siteA is the name of the active HANA node, which can be customized.

      For example, if the name of the active HANA node is hana001, run the following command:

      hdbnsutil -sr_enable --name=hana001

  2. Configure the standby HANA node.

    1. Switch to the other SAP HANA node using SSH.
    2. Enter the administrator mode:

      su - $SIDadm

      For example, run the following command to enter the administrator mode:

      su - s00adm

      Information similar to the following is displayed:

      hana002:/hana/shared/S00/HDB00>  
    3. Run the following command to stop the SAP HANA database:

      HDB stop

    4. Run the following command to enable System Replication:

      hdbnsutil -sr_register --remoteHost=remoteHostName --remoteInstance=remoteInstanceNumber --replicationMode=sync --name=siteB

      In the preceding command, remoteHostName is the name of the active node, remoteInstanceNumber is the instance ID of the active node, and SiteB is the name of the standby node, which can be customized.

      For example, if remoteHostName is hana001, remoteInstanceNumber is 00, and SiteB is hana002, run the following command:

      hdbnsutil -sr_register --remoteHost=hana001 --remoteInstance=00 --replicationMode=sync --name=hana002

      • If the SSFS_S00.DAT and SSFS_S00.KEY files on the active and standby nodes are different when the SAP HANA 2.0 installation package is used, see the official SAP document SAP Note 2369981 to resolve the problem.
      • In the cross-AZ DR scenario, set the mode of Multitier System Replication to async, that is, replicationMode=async.
    5. Run the following command to start the SAP HANA database:

      HDB start

  3. Query the System Replication status in the SAP HANA system.

    1. Run the following command in the administrator mode on the active node CLI:

      hdbnsutil -sr_state

      Information similar to the following is displayed:

      checking for active or inactive nameserver ...
      System Replication State
      ~~~~~~~~~~~~~~~~~~~~~~~~
      mode: primary
      site id: 1
      site name: hana001
      Host Mappings:
      ~~~~~~~~~~~~~
      hana001 -> [hana001] hana001
      hana001 -> [hana002] hana002
      done.
    2. Query the active node status on SAP HANA Studio.

      In actual application scenarios, the service software has connected to the SAP HANA node. If you manually switch the SAP HANA node, you must change the IP address of the SAP HANA node on the service software and restart the service software.