SAPHanaSR.py(7)

NAME
SAPHanaSR.py - Provider for SAP HANA srHook method srConnectionChanged().

DESCRIPTION
SAPHanaSR.py can be used to provide a script for the SAP HANA srHook method srConnectionChanged(). The SAP HANA nameserver provides a Python-based API ("HA/DR providers"), which is called at important points of the host auto-failover and system replication takeover process. These so called hooks can be used for arbitrary operations that need to be executed. The method srConnectionChanged() is called on the master nameserver as soon as one of the replicating services loses or establishes the system replication connection. This method is called only once.

SUPPORTED PARAMETERS
The "HA/DR providers" API accepts the following parameters for the ha_dr_provider_SAPHanaSR section:

provider = SAPHanaSR

path = /usr/share/SAPHanaSR

execution_order = 1

The "HA/DR providers" API accepts the following parameter for the trace section (as of SAP HANA 1.x):

ha_dr_saphanasr = [ info | debug ]

SAPHanaController recognizes the effecting system replication status via the following cluster attribute:

hana_${sid}_site_srHook_${site}

RETURN CODES
0 Successful program execution.
>0 Usage, syntax or execution errors.

EXAMPLES

* Example for entry in sudo permissions /etc/sudoers

    # SAPHanaSR-ScaleUp needs for srHook
    ha1adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_ha1_site_srHook_*

* Example for entry in SAP HANA global configuration /hana/shared/$SID/global/hdb/custom/config/global.ini
This file is needed at both sites. The HANA has to be stopped before the files can be edited.

    [ha_dr_provider_SAPHanaSR]
    provider = SAPHanaSR
    path = /usr/share/SAPHanaSR
    execution_order = 1
    [trace]
    ha_dr_saphanasr = info

* Example for creating the optional SAPHanaSR python object file manually.

# mkdir -p /hana/shared/srhook
# chown ha1adm.sapsys /hana/shared/srhook
# su - ha1adm
# cd /hana/shared/srhook
# python -m py_compile /usr/share/SAPHanaSR/SAPHanaSR.py
# ls -l SAPHanaSR.pyc

FILES

/usr/share/SAPHanaSR/SAPHanaSR.py
     the hook provider, delivered with the RPM

/hana/shared/srhook/SAPHanaSR.pyc
     the hook provider, if pre-compiled for the particular HANA (optional)

/hana/shared/$SID/global/hdb/custom/config/global.ini
     the on-disk representation of HANA global system configuration

/etc/sudoers
     the sudo permissions configuration

REQUIREMENTS
1. SAP HANA starting with version 1.0 SPS 11 patch level 112.02. Older versions do not provide the srHook method srConnectionChanged().

2. The user ${sid}adm needs execution permission as user root for the command crm_attribute.

3. The hook provider needs to be added to the HANA global configuration, in memory and on disk (in persistence).

4. If the hook provider should be pre-compiled, the particular Python version that comes with SAP HANA has to be used.

BUGS
In case of any problem, please use your favourite SAP support process to open a request for the component BC-OP-LNX-SUSE. Please report any other feedback and suggestions to feedback@suse.com.

SEE ALSO
SAPHanaSR(7) , ocf_suse_SAPHanaTopology(7) , ocf_suse_SAPHana(7) , ocf_heartbeat_IPaddr2(7) , SAPHanaSR-monitor(8) , SAPHanaSR-showAttr(8) , crm_attribute(8) , sudo(8) , sudoers(5), python(8) ,
https://www.susecon.com/doc/2015/sessions/TUT19921.pdf ,
http://help.sap.com/saphelp_hanaplatform/helpdata/en/13/67c8fdefaa4808a7485b09815ae0f3/content.htm ,
http://help.sap.com/saphelp_hanaplatform/helpdata/en/5d/f2e766549a405e95de4c5d7f2efc2d/content.htm ,
http://help.sap.com/saphelp_hanaplatform/helpdata/en/12/00ab8ef0c54c54be2d0e7f5327f7ed/content.htm?frameset=/en/13/67c8fdefaa4808a7485b09815ae0f3/frameset.htm&current_toc=/en/00/0ca1e3486640ef8b884cdf1a050fbb/plain.htm&node_id=413 ,
https://help.sap.com/saphelp_hanaplatform/helpdata/en/3f/1a6a7dc31049409e1a9f9108d73d51/content.htm

AUTHORS
F.Herschel, L.Pinne.

COPYRIGHT
(c) 2015-2018 SUSE Linux GmbH, Germany.
(c) 2019 SUSE LLC
SAPHanaSR.py comes with ABSOLUTELY NO WARRANTY.
For details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html