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:
-
Login to primary and enable replication
hdbnsutil -sr_enable --name=<Sitename>
-
Stop secondary server
sapcontrol -nr <inst_no> -function StopSystem HDB
-
Register replication on secondary
hdbnsutil -sr_register --remoteHost=<primary_hostname> --remoteInstance=<Inst_no> --replicationMode=<sync/syncmem/async> --name=<Sitename_secondary> --operationMode=<logreplay/delta_datashipping>
-
Start secondary server
sapcontrol -nr <inst_no> -function StartSystem
-
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
-
Stop secondary system
sapcontrol -nr <inst_no> -function StopSystem HDB
-
Unregister the secondary system as follows:
hdbnsutil –sr_unregister
-
Disable system replication on the primary system as follows:
hdbnsutil –sr_disable
-
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
-
Stop the secondary system using the command:
sapcontrol -nr <inst_no> -function StopSystem
-
Run the command:
hdbnsutil -sr_changemode --mode=sync|syncmem|async
-
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.
Hello,
ReplyDeleteMany Thanks for this blog.
What happens when the primary site (hana system) has an error and that is then replicated to the secondary site.
How does the secondary side know that there was an error on the primary side?
Can I then start the secondary site ? Will it also have the same error?
Many Thanks
Could you please help withsystem replication setup with auto-failover through pacemaker cluster?
ReplyDelete