Troubleshooting the SAPHanaSR python hook

This document (000019865) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server for SAP Applications 15 SP1
SUSE Linux Enterprise Server for SAP Applications 12 SP4
SAPHanaSR-0.154.1-4.14.1.noarch

Situation

How to verify the SAPHanaSR.py hook is working properly after installing and  implementing the hook provided by SAPHanaSR RPM package and following directions provided in the Best Practices Guide.

If it's not working properly,  reference the Troubleshooting: section below.

Resolution

1.  Check the SAP logs after starting the databases back up and look for entries with "ha_dr_" in SAP's trace directory logged in as the <sidadm> user. 
     Example:  <sidadm> = sleadm
hana2 # su - sleadm

sleadm@hana2:/usr/sap/SLE/HDB00> cdtrace

sleadm@hana2:/usr/sap/SLE/HDB00/hana2/trace> grep ha_dr_ nameserver_*

nameserver_hana2.30001.066.trc:[86754]{-1}[-1/-1] 2021-02-01 14:17:07.863502 i ha_dr_provider   PythonProxyImpl.cpp(01096) : calling HA/DR provider SAPHanaSR.hookDRConnectionChanged(hostname=hana2, port=30007, volume=2, service_name=xsengine, database=SLE, status=15, database_status=13, system_status=13, timestamp=2021-02-01T14:17:07.863451-07:00, is_in_sync=1, reason=, siteName=SiteA)
nameserver_hana2.30001.066.trc:[86754]{-1}[-1/-1] 2021-02-01 14:17:07.863845 i ha_dr_SAPHanaSR  SAPHanaSR.py(00086) : SAPHanaSR (0.162.0) SAPHanaSR.srConnectionChanged method called with Dict={'status': 15, 'is_in_sync': True, 'timestamp': '2021-02-01T14:17:07.863451-07:00', 'database': 'SLE', 'siteName': 'SiteA', 'service_name': 'xsengine', 'hostname': 'hana2', 'volume': 2, 'system_status': 13, 'reason': '', 'database_status': 13, 'port': '30007'}
2.  A new cluster property called "SAPHanaSR" is also created.   
To see this, use the following command as root user. 
hana2:/ # crm configure show SAPHanaSR
property SAPHanaSR: \
	hana_sle_site_srHook_SiteB=PRIM \
	hana_sle_site_srHook_SiteA=SOK
Note: If a failover or srTakeover has not taken place, you may only see one of the attributes populated.

3. The utility SAPHanaSR-showAttr should also show information about the srHook.
hana2:/ # SAPHanaSR-showAttr 
Global cib-time                 maintenance 
--------------------------------------------
global Fri Feb  5 11:16:45 2021 false       

Resource              maintenance 
----------------------------------
msl_SAPHana_SLE_HDB00 false       

Sites srHook 
-------------
SiteA SOK    
SiteB PRIM   

Hosts clone_state lpa_sle_lpt maintenance node_state op_mode   remoteHost roles                            score site  srmode  standby sync_state version                vhost 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
hana1 DEMOTED     30          off         online     logreplay hana2      4:S:master1:master:worker:master 100   SiteA syncmem off     SOK        2.00.042.00.1564994110 hana1 
hana2 PROMOTED    1612549005  off         online     logreplay hana1      4:P:master1:master:worker:master 150   SiteB syncmem off     PRIM       2.00.042.00.1564994110 hana2 

Note: If a failover or srTakeover has not taken place, you may only see one of the attributes populated.

4. The SAPHana resource monitor now also populates the SRHOOK1= <value> instead of being blank. 
This can be seen in the /var/log/messages on each node. 
primary node: 
hana2 SAPHana(rsc_SAPHana_SLE_HDB00)[134236]: INFO: RA: SRHOOK1=PRIM
hana2 SAPHana(rsc_SAPHana_SLE_HDB00)[134236]: INFO: RA: SRHOOK3=PRIM
or results on secondary node: 
hana1 SAPHana(rsc_SAPHana_SLE_HDB00)[45054]: INFO: RA: SRHOOK1=SOK
hana1 SAPHana(rsc_SAPHana_SLE_HDB00)[45054]: INFO: RA: SRHOOK3=SOK

Before implementing the SAPHanaSR.py hook.
hana1 SAPHana(rsc_SAPHana_SLE_HDB00)[20948]: INFO: RA: SRHOOK1=
hana1 SAPHana(rsc_SAPHana_SLE_HDB00)[20948]: INFO: RA: SRHOOK2=SOK
hana1 SAPHana(rsc_SAPHana_SLE_HDB00)[20948]: INFO: RA: SRHOOK3=SOK


Troubleshooting: 
1. Verify the visudo entry on both nodes is correct.  Verify the <sidadm> and <sid> variables match your environment. 
# SAPHanaSR-ScaleUp entries for writing srHook cluster attribute
<sidadm> ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_<sid>_site_srHook_*

Example:  <sidadm>=nw1adm   <sid>=nw1
nw1adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_nw1_site_srHook_*
2. Verify that correct entry is added to the global.ini on both nodes and the path= points to correct location.
[ha_dr_provider_SAPHanaSR]
provider = SAPHanaSR
path = /hana/hooks/
execution_order = 1

[trace]
ha_dr_saphanasr = info
3. Verify the SAPHanaSR.py has the correct owner and permissions. 
sap-hana02:/hana/hooks 
-rwxr-xr-x 1 nw1adm sapsys 4869 Jan 11 23:53 SAPHanaSR.py
 

 

Additional Information

Documentation References: 
Best Practices Guide --> Implementing the Python Hook SAPHanaSR
man page for srHook --> man SAPHanaSR.py (7)  

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000019865
  • Creation Date: 05-Feb-2021
  • Modified Date:10-Feb-2021
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center