Technical Guide: Setting Up SAP HANA System Replication (HSR) on AWS
- Kourosh Ghouchkhani
- Apr 17
- 2 min read
By Kourosh Ghouchkhani – SAP Basis Cloud Architect
Overview
This guide outlines the steps required to set up SAP HANA System Replication (HSR) in an AWS cloud environment for high availability (HA) and disaster recovery (DR). HSR ensures data availability by replicating data from the primary HANA system to a secondary system in real time.
Target Audience
SAP Basis Administrators
Cloud Architects
SAP Infrastructure Engineers
Enterprise Architects managing HANA on AWS
Prerequisites
AWS Infrastructure
Two or more EC2 instances (for primary and secondary HANA nodes)
Shared VPC or VPC peering between regions if cross-region DR is needed
EBS volumes provisioned for /hana/data, /hana/log, /hana/shared
SAP-certified EC2 instance types (e.g., r6id.16xlarge)
SAP HANA
HANA 2.0 SP05 or higher
HANA installed and configured on both primary and secondary nodes
Matching OS versions and kernel patch levels
Hostname and SID must be the same on both systems
Time synchronization via NTP
Security & Access
AWS Security Groups with ports open for replication (default TCP 3xx13)
SSH key exchange between nodes
Appropriate IAM role and permissions for EC2 and storage
Architecture

pgsql
CopyEdit
+---------------------+ +---------------------+ | Primary EC2 (AZ-A) | <====HSR====> | Secondary EC2 (AZ-B)| | SID: PRD | Replication | SID: PRD | | IP: 10.0.1.10 | | IP: 10.0.2.10 | +---------------------+ +---------------------+ Active DB Standby DB /hana/data, /hana/log /hana/data, /hana/log
Optionally integrate with AWS Route 53, Elastic IP, and Pacemaker/Cluster Manager for full HA automation.
Step-by-Step Setup
1. Prepare Operating System and File Systems
Ensure /etc/hosts is updated with both HANA hosts.
Set up LVM or EBS volumes for required mount points.
Match UID/GID and permissions across nodes.
bash
CopyEdit
mkdir -p /hana/data/PRD /hana/log/PRD /hana/shared /usr/sap/PRD
2. Install SAP HANA on Both Nodes
Use the same installation media and SID, and configure as standalone on both.
bash
CopyEdit
./hdblcm --action=install --sid=PRD --number=00
3. Enable System Replication on Primary
Log in as sidadm on the primary node.
bash
CopyEdit
hdbnsutil -sr_enable --name=primary
Check replication status:
bash
CopyEdit
hdbnsutil -sr_state
4. Register Secondary Node
On the secondary node, register the system:
bash
CopyEdit
hdbnsutil -sr_register --name=secondary --remoteHost=10.0.1.10 \ --remoteInstance=00 --replicationMode=sync --operationMode=logreplay
5. Verify HSR Status
On both nodes:
bash
CopyEdit
hdbnsutil -sr_state
You should see:
ACTIVE on the primary
SYNC or SYNCMIRROR on the secondary
6. Configure Automatic Takeover (Optional)
Enable auto failover only when using clustering solutions like Pacemaker or AWS Failover Scripts:
bash
CopyEdit
sapcontrol -nr 00 -function EnableAutoFailover 1
Post-Configuration
Set up monitoring with SAP HANA Cockpit or AWS CloudWatch
Implement backup using AWS Backup or HANA Studio
Periodically test failover using:
bash
CopyEdit
hdbnsutil -sr_takeover
Harden with encryption, IAM policies, and firewall rules
Optional Enhancements
Route 53 DNS Failover – Point SAP application layer to a DNS CNAME
SAP HANA Scale-Out with HSR – For large deployments
Pacemaker Cluster – For automated HA with fencing
Final Notes
Always test in a non-production environment.
Ensure SAP Note compatibility with AWS services.
Validate your replication setup regularly.
Need Help?
I offer consulting services for SAP HANA high availability on AWS, including:
Architecture design
RISE with SAP HSR implementation
Cloud-native automation
Performance tuning
Let’s connect to design a resilient, future-ready SAP landscape on AWS.
Comments