Scroll to navigation

OCF_HEARTBEAT_SAPHAN(7) OCF resource agents OCF_HEARTBEAT_SAPHAN(7)

NAME

ocf_heartbeat_SAPHana - Manages two SAP HANA database systems in system replication (SR).

SYNOPSIS

SAPHana [start | stop | status | monitor | promote | demote | meta-data | validate-all]

DESCRIPTION

The SAPHanaSR resource agent manages two SAP HANA database systems which are configured in system replication. SAPHana supports Scale-Up scenarios.

Managing the two SAP HANA database systems means that the resource agent controls the start/stop of the instances. In addition the resource agent is able to monitor the SAP HANA databases to check their availability on landscape host configuration level. For this monitoring the resource agent relies on interfaces provided by SAP. A third task of the resource agent is to also check the synchronisation status of the two SAP HANA databases. If the synchronisation is not "SOK", then the cluster avoids to failover to the secondary side, if the primary fails. This is to improve the data consistency.

The resource agent uses the following four interfaces provided by SAP:

1. sapcontrol/sapstartsrv The interface sapcontrol/sapstartsrv is used to start/stop a HANA database instance/system

2. landscapeHostConfiguration The interface is used to monitor a HANA system. The python script is named landscapeHostConfiguration.py. landscapeHostConfiguration.py has some detailed output about HANA system status and node roles. For our monitor the overall status is relevant. This overall status is reported by the returncode of the script: 0: Internal Fatal, 1: ERROR, 2: WARNING, 3: INFO, 4: OK The SAPHana resource agent will interpret returncodes 0 as FATAL, 1 as not-running or ERROR and and returncodes 2+3+4 as RUNNING.

3. hdbnsutil The interface hdbnsutil is used to check the "topology" of the system replication as well as the current configuration (primary/secondary) of a SAP HANA database instance. A second task of the interface is the possibility to run a system replication takeover (sr_takeover) or to register a former primary to a newer one (sr_register).

4. hdbsql / systemReplicationStatus Interface is SQL query into HANA (system replication table). The hdbsql query will be replaced by a python script "systemReplicationStatus.py" in SAP HANA SPS8 or 9. As long as we need to use hdbsql you need to setup secure store users for linux user root to be able to access the SAP HANA database. You need to configure a secure store user key "SAPHANASR" which can connect the SAP HANA database:

5. saphostctrl The interface saphostctrl uses the function ListInstances to figure out the virtual host name of the SAP HANA instance. This is the hostname used during the HANA installation.

SUPPORTED PARAMETERS

SID

SAP System Identifier (SID) like "SLE" or "HAE"

(required, string, no default)

InstanceNumber

SAP instance number like "00" or "07"

(required, string, no default)

PREFER_SITE_TAKEOVER

Should cluster/RA prefer to switchover to slave instance instead of restarting master locally? Default="yes" no: Do prefer restart locally yes: Do prefer takever to remote site never: Do never run a sr_takeover (promote) at the secondary side. THIS VALUE IS CURRENTLY NOT SUPPORTED.

(optional, string, default "yes")

AUTOMATED_REGISTER

The parameter AUTOMATED_REGISTER defines, whether a former primary instance should be registered automatically by the resource agent during cluster/resource start, if the DUPLICATE_PRIMARY_TIMEOUT is expired... TDB

(optional, boolean, default false)

DUPLICATE_PRIMARY_TIMEOUT

Time difference needed between to primary time stamps, if a dual-primary situation occurs. If the time difference is less than the time gap, then the cluster holds one or both instances in a "WAITING" status. This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed. After this registration to the new primary all data will be overwritten by the system replication.

(optional, string, default "7200")

DIR_EXECUTABLE

The full qualified path where to find sapstartsrv and sapcontrol. Specify this parameter, if you have changed the SAP kernel directory location after the default SAP installation.

(optional, string, no default)

DIR_PROFILE

The full qualified path where to find the SAP START profile. Specify this parameter, if you have changed the SAP profile directory location after the default SAP installation.

(optional, string, no default)

INSTANCE_PROFILE

The name of the SAP HANA instance profile. Specify this parameter, if you have changed the name of the SAP HANA instance profile after the default SAP installation. Normally you do not need to set this parameter.

(unique, optional, string, no default)

SAPHanaFilter

OUTDATED PARAMETER

(optional, string, no default)

SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

start

Starts the resource. Suggested minimum timeout: 180.

stop

Stops the resource. Suggested minimum timeout: 240.

status

Performs a status check. Suggested minimum timeout: 60.

monitor

Performs a detailed status check. Suggested minimum timeout: 60. Suggested interval: 120.

monitor (Slave role)

Performs a detailed status check. Suggested minimum timeout: 60. Suggested interval: 121.

monitor (Master role)

Performs a detailed status check. Suggested minimum timeout: 60. Suggested interval: 119.

promote

Promotes the resource to the Master role. Suggested minimum timeout: 320.

demote

Demotes the resource to the Slave role. Suggested minimum timeout: 320.

validate-all

Performs a validation of the resource configuration. Suggested minimum timeout: 5.

meta-data

Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5.

methods

Suggested minimum timeout: 5.

EXAMPLE CRM SHELL

The following is an example configuration for a SAPHana resource using the crm(8) shell:

primitive p_SAPHana ocf:heartbeat:SAPHana \

params \
SID=string \
InstanceNumber=string \
op monitor depth="0" timeout="60" interval="120" \
op monitor depth="0" timeout="60" interval="121" role="Slave" \
op monitor depth="0" timeout="60" interval="119" role="Master"

ms ms_SAPHana p_SAPHana \

meta notify="true" interleave="true"

EXAMPLE PCS

The following is an example configuration for a SAPHana resource using pcs(8)

pcs resource create p_SAPHana ocf:heartbeat:SAPHana \

SID=string \
InstanceNumber=string \
op monitor depth="0" timeout="60" interval="120" \
op monitor depth="0" timeout="60" interval="121" role="Slave" \
op monitor depth="0" timeout="60" interval="119" role="Master" --master

SEE ALSO

http://clusterlabs.org/

AUTHOR

ClusterLabs contributors (see the resource agent source for information about individual authors)

08/08/2019 resource-agents UNKNOWN