Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Implementing the Python hook SAPHanaSR in RHEL

Focus mode
Implementing the Python hook SAPHanaSR in RHEL - SAP HANA on AWS

As a <sid>adm user, stop the SAP HANA databases on both nodes, either with HDB or using sapcontrol, before proceeding further with changes, as seen in the following example.

hdbadm@prihana> sapcontrol -nr NN -function StopSystem

As a root user, copy the hook from the SAPHanaSR package into a read/writable directory on both nodes, as shown in the following example.

[root@prihana ~] mkdir -p /hana/shared/myHooks
[root@prihana ~] cp /usr/share/SAPHanaSR/srHook/SAPHanaSR.py /hana/shared/myHooks
[root@prihana ~] chown -R hdbadm:sapsys /hana/shared/myHooks

Update the global.ini file on each node to enable use of the hook script by both SAP HANA instances. Ensure that you make a copy/backup of global.ini before updating the file.

See the following example for updating the global.ini at location (/hana/shared/HDB/global/hdb/custom/config/global.ini):

[ha_dr_provider_SAPHanaSR]
provider = SAPHanaSR
path = /hana/shared/myHooks
execution_order = 1

[trace]
ha_dr_saphanasr = info

The current version of the SAPHanaSR python hook uses the command sudo to allow the <sid>adm user to access the cluster attributes. To enable this, update the file /etc/sudoers as a root user with entries as shown in the following example:

# SAPHanaSR-ScaleUp entries for writing srHook cluster attribute
Cmnd_Alias SOK_SITEA   = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_PRI -v SOK -t crm_config -s SAPHanaSR
Cmnd_Alias SFAIL_SITEA = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_PRI -v SFAIL -t crm_config -s SAPHanaSR
Cmnd_Alias SOK_SITEB   = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_SEC -v SOK -t crm_config -s SAPHanaSR
Cmnd_Alias SFAIL_SITEB = /usr/sbin/crm_attribute -n hana_hdb_site_srHook_SEC -v SFAIL -t crm_config -s SAPHanaSR
hdbadm ALL=(ALL) NOPASSWD: SOK_SITEA, SFAIL_SITEA, SOK_SITEB, SFAIL_SITEB
Defaults!SOK_SITEA, SFAIL_SITEA, SOK_SITEB, SFAIL_SITEB !requiretty
Note

hdb is the SAP HANA system ID used in the given example. You must replace hdb with lowercase SID of your SAP HANA installation. Replace the PRI and SEC references with your SAP HANA site names.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.