HANA System Replication - Prerequisites & Setup


Hey Folks! Welcome back to Hana high availability blog series. In our last blog we checked out operation & replication modes in hana system replication. If you haven't gone though that blog, you can checkout this link

In this blog we will be talking about the prerequisites of hana replication and it's setup. So let's get started.

When we plan to setup hana system replication, we need to make sure that all prerequisite steps have been followed. Let's have a look at these prerequisites.

HANA System Replication Prerequisites:

  • Primary & secondary systems should be up & running
  • HDB version of secondary should be greater than or equal to Primary database sever
  • But, for Active/Active(read enabled config), HDB version should be same on both sites.
  • System configuration/ini files should be identical on both sides
  • Replication happens for the whole system and can't be tenant/database specific
  • Number of worker nodes and role configuration on both sites should be same. Standby nodes need not to be same.
  • Systems should not be on the same host. Hostnames should be different.
  • Both systems should have same SID and instance number.
  • Replication related ports with default port offset 10000 should be available.
  • Initial backup should have been done for the primary system's databases.
  • Log mode should be 'normal'
  • Should have sidadm access
  • System PKI SSFS .key and the .dat files must be copied from the primary system to the secondary system
    • /usr/sap/<SID>/SYS/global/security/rsecssfs/data/SSFS_<SID>.DAT
    • /usr/sap/<SID>/SYS/global/security/rsecssfs/key/SSFS_<SID>.KEY
      For XS advanced, following files should also be copied
    • /usr/sap/<SID>/SYS/global/xsa/security/ssfs/data/SSFS_<SID>.DAT 
    • /usr/sap/<SID>/SYS/global/xsa/security/ssfs/key/SSFS_<SID>.KEY
  • In a system replication landscape the systems on all sites must run on platforms with the same byte order. System replication is supported between Intel little-endian and IBM Power little-endian systems
  • If you plan to add SAP HANA dynamic tiering to your landscape in the future, seeSAP Note 2447994 before you enable HANA system replication
Now let's see how to enable/disable hana replication and change replication mode. All below operations should be performed as <sid>adm

Setup/Enable SAP HANA System Replication:

  1. Login to primary and enable replication
    hdbnsutil -sr_enable --name=<Sitename>
    where, name -> can be anything

  2. Stop secondary server
    sapcontrol -nr <inst_no> -function StopSystem HDB

  3. Register replication on secondary
    hdbnsutil -sr_register --remoteHost=<primary_hostname> --remoteInstance=<Inst_no> --replicationMode=<sync/syncmem/async> --name=<Sitename_secondary> --operationMode=<logreplay/delta_datashipping>

  4. Start secondary server
    sapcontrol -nr <inst_no> -function StartSystem

  5. Replication check on Primary System
    hdbnsutil -sr_state

    cd /usr/sap/<SID>/HDB<inst_no>/exe/python_support
    $ python systemReplicationStatus.py

Disable SAP HANA System Replication with hdbnsutil

  1. Stop secondary system
    sapcontrol -nr <inst_no> -function StopSystem HDB

  2. Unregister the secondary system as follows:
    hdbnsutil –sr_unregister
    For other use cases of the command hdbnsutil –sr_unregister, see SAP Note 1945676.

  3. Disable system replication on the primary system as follows:
    hdbnsutil –sr_disable

  4. Start secondary server
    sapcontrol -nr <inst_no> -function StartSystem HDB

If system replication is out of sync and you need to register again the initial secondary system, use the command hdbnsutil –sr_register. It is not needed to unregister the secondary system before registering it again.

SAP HANA System Change Replication Mode

  1. Stop the secondary system using the command:
    sapcontrol -nr <inst_no> -function StopSystem

  2. Run the command:
    hdbnsutil -sr_changemode --mode=sync|syncmem|async

  3. Start the secondary system using the command:
    sapcontrol -nr <inst_no> -function StartSystem

To change operation mode, we need to re-register replication with the required mode.

That was all about prerequisites and setup of hana system replication. Hope you now have a better understanding of Hana System replication concepts.

Comments