HANA System Replication is one of the important topic in SAP HANA.
Being used in the context of high availability and disaster recovery
scenario, It is really important to learn how to setup HANA System
Replication in multi-tier replication scenario.
In this scenario we are enabling HANA System Replication – In Multi-tier scenario.
There are 3 HANA nodes: A, B and C, named SiteA, SiteB and SiteC
Site A : Primary Database Node
Site B: Secondary Database Node / HA Node
Site C: DR node
- Replication Mode:
From Site A –> Site B : SYNC
From Site B –> Site C : ASYNC - Operation Mode:
From Site A –> Site B : logreplay
From Site B –> Site C : logreplay
HSR Scenario: HANA System Replication
Prerequisites:
- Install HANA on primary and secondary node
With different host names
With same HANA system ID
With same instance number
Start up each HANA independently - Ensure, The primary and secondary system are both installed and configured properly. Do verify that both are independently up and running fine without any issue
- Ensure, that the host-names in the primary system are different from the host-names used in the secondary systems.
- Ensure, The secondary system must have the same SAP system ID,<SID> and instance number as the primary system.
- Ensure, The software version of the secondary has to be equal or newer to the version on the primary system
- Ensure that the following configuration parameters are set
ini
[persistence] log_mode = normal - Do prepare the secondary system by copying the system SSFS keys from the primary system to the secondary system.
Manually copy SSFS_<SID>.DAT and SSFS_<SID>.KEY from primary host to secondary host.
These files are in path /<SID>/global/security/rsecssfs/data and /<SID>/global/security/rsecssfs/key respectively
HANA System Replication : Primary Node: Site A Configuration
[Node A] start database : HDB start or /usr/sap/hostctrl/exe/sapcontrol -nr <instance number> -function Start
[Node A] create data backup
[Node A] enable system replication: hdbnsutil -sr_enable –name=SiteA
[Node A] verify the HSR state : hdbnsutil -sr_state
HANA System Replication : Secondary Node- HA Node: Site B Configuration
[Node B] Stop Database : HDB stop or /usr/sap/hostctrl/exe/sapcontrol -nr <instance number> -function Stop
[Node B]Register site:
hdbnsutil -sr_register –mode=sync –name=SiteB
–remoteInstance=<instId> –remoteHost=<hostname_of_A>
–operationMode=logreplay
[Node B] start database : HDB start or /usr/sap/hostctrl/exe/sapcontrol -nr <instance number> -function Start
[Node B] enable this site as replication source system: hdbnsutil -sr_enable
[Node B] verify the HSR state : hdbnsutil -sr_state
HANA System Replication : DR Node- : Site C Configuration
[Node C] Stop database: HDB stop or /usr/sap/hostctrl/exe/sapcontrol -nr <instance number> -function Stop
[Node C] Register tier 3 secondary:
hdbnsutil -sr_register –mode=async –name=SiteC
–remoteInstance=<instId> –remoteHost=<hostname_of_B>
–operationMode=logreplay
[Node C] start database : HDB start or /usr/sap/hostctrl/exe/sapcontrol -nr <instance number> -function Start
[Node C] verify the HSR state : hdbnsutil -sr_state
Reference command in case of change in replication mode and operation mode :
hdbnsutil -sr_register –name=<secondary_alias> –remoteHost=<primary_host> –remoteInstance=<primary_systemnr>
–replicationMode=[sync|syncmem|async] –operationMode=[delta_datashipping|logreplay|logreplay_readaccess]
Check if everything went fine by issuing SELECT * FROM M_SERVICE_REPLICATION on the primary site: