In the earlier post we saw how to Install a 2-Node HANA DB cluster, Next in this post we will see how to setup site replication between these 2 Nodes.
Please Note: This guide is prepared with Reference from the official documentation here
To install 2 Node HANA DB follow refer here.
Setup Site Replication
On Node 1: Login with ha1adm user and Backup the Database
su - ha1adm
hdbsql -i 10 -u SYSTEM -d SYSTEMDB "BACKUP DATA FOR FULL SYSTEM USING FILE ('backup')"

Enable the Primary Node “Node 1” with Site Name WDF:
hdbnsutil -sr_enable --name=WDF

Check SR status on Node 1
hdbnsutil -sr_stateConfiguration --sapcontrol=1

On the Second Node stop the Hana DB
HDB stop

Copy the KEY and KEY-DATA file from the primary to the secondary site
On Node 2
cd /usr/sap/HA1/SYS/global/security/rsecssfs/
scp 192.168.211.42:/usr/sap/HA1/SYS/global/security/rsecssfs/data/SSFS_HA1.DAT data/
scp 192.168.211.42:/usr/sap/HA1/SYS/global/security/rsecssfs/key/SSFS_HA1.KEY key/

Now Register the second Node
hdbnsutil -sr_register --name=ROT --remoteHost=hana-n1 --remoteInstance=10 --replicationMode=sync --operationMode=logreplay

Start HANA DB on Secondary Node and Check SR Configuration
HDB start

Check Replication Status
hdbnsutil -sr_stateConfiguration --sapcontrol=1

Note that the mode is “SYNC”
Further details on replication can be found using the script hdbsettings
HDBSettings.sh systemReplicationStatus.py --sapcontrol=1
Configuring Replication, Takeover, checksrv hooks and ha1adm user access to cluster
Follow the below step in Both Nodes
Edit the global.ini file and enter the below parameters
vim /hana/shared/HA1/global/hdb/custom/config/global.in
[ha_dr_provider_saphanasr]
provider = SAPHanaSR
path = /usr/share/SAPHanaSR/
execution_order = 1
[trace]
ha_dr_saphanasr = info
[ha_dr_provider_sustkover]
provider = susTkOver
path = /usr/share/SAPHanaSR/
execution_order = 2
[trace]
ha_dr_sustkover = info
[ha_dr_provider_suschksrv]
provider = susChkSrv
path = /usr/share/SAPHanaSR/
execution_order = 3
action_on_lost=stop
[trace]
ha_dr_suschksrv = info
Also make sure the [system_replication] section has the operation mode parameter defined as logreplay
[system_replication]
mode = primary
actual_mode = primary
site_id = 1
site_name = WDF
operation_mode = logreplay
The file should look like this
On Node1

On Node 2

Configure ha1adm user access to cluster on both nodes:
Create a new file SAPHanaSR in suders.d and add the below content
vim /etc/sudoers.d/SAPHanaSR
# SAPHanaSR-ScaleUp entries for writing srHook cluster attribute and SAPHanaSR-hookHelper
ha1adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_ha1_site_srHook_*
ha1adm ALL=(ALL) NOPASSWD: /usr/sbin/SAPHanaSR-hookHelper *
Check the newly configured hooks
Start HANA in both server
HDB start
Once started check the hooks are loaded properly using cdtrace
cdtrace
grep HADR.*load.*SAPHanaSR nameserver_*.trc
grep SAPHanaSR.init nameserver_*.trc
grep HADR.*load.*susTkOver nameserver_*.trc
grep susTkOver.init nameserver_*.trc
grep HADR.*load.*susChkSrv nameserver_*.trc
grep susChkSrv.init nameserver_*.trc
egrep '(LOST:|STOP:|START:|DOWN:|init|load|fail)' nameserver_suschksrv.trc
grep SAPHanaSR.srConnection.*CRM nameserver_*.trc
grep SAPHanaSR.srConnection.*fallback nameserver_*.trc

That is it we have successfully configured Site Replication in 2-Node HANA DB cluster.
In the next post we will see how to setup High Availability between these 2 sites. Refer here
2 thoughts on “Setup Site Replication in Two Node Hana DB Cluster”