AWS infrastructure, operating system setup and HANA installation - SAP HANA on AWS

AWS infrastructure, operating system setup and HANA installation

This guide mainly focuses on SAP HANA system replication setup and high availability cluster configuration steps on AWS. To set up AWS infrastructure, which is necessary to install primary and secondary SAP HANA databases, see the SAP HANA Environment Setup on AWS Guide and the following additional resources:

After you have the AWS infrastructure ready, you will have to perform operating system configuration and installations of primary and secondary SAP HANA databases as per the architecture diagram in the previous section. SAP HANA installation steps are detailed in SAP Installation Guides and Setup Manuals available on the SAP Help Portal.

Hostname resolution

Ensure that both the systems are able to resolve the hostnames of both the cluster nodes. To fix any DNS issues, add the hostnames of both the cluster nodes to /etc/hosts.

# cat /etc/hosts 10.0.0.1 prihana.example.com prihana 10.0.0.2 sechana.example.com sechana

Disable SAP HANA autostart

The high availability cluster will manage the start and stop operations for SAP HANA. Disable the autostart feature after installation is complete.

  1. Login as the sidadm user on each cluster node and run the following command.

    # HDB stop # cdpro
  2. Edit the SAP HANA profile file named SID_HDB_instNum_hostname and set the autostart property to 0.

  3. Save the profile file and start SAP HANA.

    # HDB start # cdpro

Configure SAP HANA System Replication (HSR)

Following are the high-level steps to setup HSR:

  1. Enable HANA system replication for the database on the primary cluster node.

  2. Register the secondary SAP HANA database node with the primary cluster node and start the secondary SAP HANA database.

  3. Verify the state of replication.

The following values are used to configure HSR and high availability cluster in this example:

  • Primary database host name – prihana

  • Secondary database host name – sechana

  • Database system identifier (DBSID) – HDB

  • Instance number – 00

  • Site name of primary node – PRI

  • Site name of secondary node – SEC

Enabling system replication in primary node

As <sid>adm user enables the system replication at the primary node:

hdbadm@prihana> hdbnsutil -sr_enable --name=PRI

Register the secondary node with the primary node

The SAP HANA database instance on the secondary cluster node must be stopped before registering the database instance for system replication.

After the database instance is stopped, you can register the instance using hdbnsutil. On the secondary node, the mode should be either “SYNC“ or “SYNCMEM“.

In the following example, the replication mode used is SYNC.

As a <sid>adm user, stop the secondary SAP HANA database, register the secondary node, and start the SAP HANA database:

hdbadm@sechana> HDB stop hdbadm@sechana> hdbnsutil -sr_register --name=SEC \ --remoteHost=prihana --remoteInstance=00 \ --replicationMode=sync --operationMode=logreplay hdbadm@sechana> HDB start

Verifying the state of system replication

You can use the hdbnsutil tool to check the system replication mode and site name:

hdbadm@prihana> hdbnsutil -sr_state checking for active or inactive nameserver ... System Replication State ~~~~~~~~~~~~~~~~~~~~~~~~ mode: primary site id: 1 site name: PRI Host Mappings: ~~~~~~~~~~~~~~ done.
hdbadm@sechana> hdbnsutil -sr_state checking for active or inactive nameserver ... System Replication State ~~~~~~~~~~~~~~~~~~~~~~~~ mode: sync site id: 2 site name: SEC active primary site: 1 ~~~~~~~~~~~~~~

You can view the replication state of the whole SAP HANA landscape using the following command as a <sid>adm user on the primary node:

hdbadm@prihana> HDBSettings.sh systemReplicationStatus.py --sapcontrol=1 ... site/2/SITE_NAME=SEC site/2/SOURCE_SITE_ID=1 site/2/REPLICATION_MODE=SYNC site/2/REPLICATION_STATUS=ACTIVE site/1/REPLICATION_MODE=PRIMARY site/1/SITE_NAME=PRI local_site_id=1 ...

Configuring system replication operation mode

When your SAP HANA database is connected as an SAPHanaSR target, you can find an entry in the global.ini which represents the operation mode.

To have your secondary site as a hot standby system, the operation mode configured must be ‘logreplay’.

For more details regarding all operation modes, see How To Perform System Replication for SAP HANA.

Ensure the operation_mode parameter is set to your desired operation mode in the global.ini configuration file on both the primary and secondary nodes.

The path for the global.ini is /hana/shared/global/hdb/custom/config/.

operation_mode = logreplay