How to enable the SAP HA Interface for SAP ABAP application server instances managed by the RHEL HA Add-On?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7 with High-Availability Add-on
  • Red Hat Enterprise Linux 8 with High-Availability Add-on
  • Red Hat Enterprise Linux 9 with High-Availability Add-on
  • Pacemaker cluster running SAPInstance resources that are also managed by external tools such as SAP Management Console (MC/MMC) or SAP Landscape Management (LaMa)

Issue

  • How to allow SAP instances managed in a pacemaker based HA cluster using the SAPInstance resource agent to be controlled by tools outside of cluster, so cluster and the outside tools will coordinate with each other?
  • When an SAP instance is stopped by an external tool, cluster reacts to this situation and tries to start the SAP instance.

Resolution

To allow SAP admins to control SAP ABAP application server instances that are managed by an HA cluster using the RHEL HA Add-On using tools like SAP LaMa or the SAP Management Console (MMC), the SAP HA Interface must be enabled. SAP Start Service sapstartsrv controls the SAP instances, and needs to be configured to communicate with the pacemaker cluster software through the HA interface. The SAP HA Interface consists of the SAP HA-Script Connector (which is part of SAP Start Service) and the SAP-Red Hat Cluster Connector, as shown below.

HA Interface


For more information on how the SAP HA Script Connector Library works, please refer to SAP Note 1693245 - SAP HA Script Connector Library.

1. SAP Resource Agents and SAP Cluster Connector

To allow SAP instances to be managed by both the SAPInstance cluster resource agent and outside tools, the sap_cluster_connector must be implemented. To ensure that the latest version of the SAPInstance resource agent and the sap_cluster_connector script are installed, run the following commands on each cluster node:

RHEL 7

[root]# yum install resource-agents-sap
[root]# yum install sap-cluster-connector

RHEL 8 and RHEL 9

[root]# dnf install resource-agents-sap
[root]# dnf install sap-cluster-connector

Note: Due to a regression introduced with the pacemaker package shipped in RHEL 8.6 and later, RHEL 9.0 and later, it is necessary to also install an updated version of the pacemaker package on these RHEL releases. This will enable the sap_cluster_connector script to work correctly. For more information please refer to Why SAPInstance cluster resources cannot start after implementing the sap_cluster_connector?.

2. Configuration

2.1. Add the SAP administrative user (adm, rh2adm in the example below) to the haclient group on all cluster nodes to allow the user to run 'pcs' and other commands to manage the cluster by running the following command on all cluster nodes:

[root]# usermod -a -G haclient rh2adm

2.2. Modify instance profiles of all SAP instances that should be managed by external tools via the SAP HA interface. To do this add following lines to the end of the SAP instance profile, which can be found in the /sapmnt/<SID>/profile directory (for example the instance profile for system with SID RH2, ASCS instance with instance number 20 and virtual hostname rh2-ascs will be /sapmnt/RH1/profile/RH2_ASCS20_rh2-ascs):

service/halib = $(DIR_EXECUTABLE)/saphascriptco.so
service/halib_cluster_connector = /usr/bin/sap_cluster_connector

2.3. Restart the sapstartsrv process of all SAP instances where the SAP instance profile has been modified to enable the SAP HA interface on the cluster node where the instance is currently running:

rh2adm > sapcontrol -nr <InstNr> -function RestartService

2.4. Verify that sap_cluster_connector has been properly identified and loaded.

For example: Check that startsapsrv.log file of the SAP instance ERS29 contains lines similar to following:

rh2adm > vi /usr/sap/RH2/ERS29/work/sapstartsrv.log
SAP HA Trace: === SAP_HA_InitEx2: SAP UNIX HA Lib 753, patch 201, changelist 1847707, optU (May 29 2018, 17:52:17) ===
SAP HA Trace: profile_params: setting cluster_connector = "/usr/bin/sap_cluster_connector"
SAP HA Trace: Fire system command /usr/bin/sap_cluster_connector init ...
SAP HA Trace: === SAP_HA_GetVersionInfo ===
SAP HA Trace: Fire system command /usr/bin/sap_cluster_connector gvi ...
SAP HA Trace: SAP_HA_GetVersionInfo HA interface version: 3
SAP HA Trace: SAP_HA_GetVersionInfo HAproduct: Pacemaker
SAP HA Trace: SAP_HA_GetVersionInfo SAPinterface: sap_cluster_connector
SAP HA Trace: SAP_HA_GetVersionInfo documentation: https://github.com/ClusterLabs/sap_cluster_connector
SAP HA Trace: --- SAP_HA_GetVersionInfo Exit-Code: SAP_HA_OK ---
SAP HA Trace: --- SAP_HA_InitEx2 Exit-Code: SAP_HA_OK ---

Check the output of sapcontrol. For example, on the node where the ERS instance is running, call sapcontrol using the instance number of the ERS instance:

rh2adm > sapcontrol -nr <InstNr> -function HACheckConfig

3. Upgrade the SAP Cluster Connector from older release

The minimum version of sap_cluster_connector that complies with HA-Interface certification NW-HA-CLU 750 or S/4-HA-CLU 1.0 is 3.0.1-1.el7_6.5. Previous version of the SAP Cluster Connector were delivered as part of the resource-agents-sap package and the name of the connector was sap_redhat_cluster_connector, but these versions are not compatible with the current version of the SAP HA interface.
To upgrade the SAP Cluster connector from an older release, install the sap_cluster_connectorpackage, and refer to step 2.2 above to adjust the SAP instance profiles accordingly so thast the instances will use the new version of the sap_cluster_connector.

4. Supported Databases

For the supported databases that can be used in combination with the HA solutions for managing SAP NetWeaver or S/4HANA application server instances on RHEL 7, RHEL 8 and RHEL 9 please refer to the following documentation:

Root Cause

sap_cluster_connector is a library that allows SAP management tools to control SAP Instances that are managed by a pacemaker based HA cluster on RHEL using the HA Interface provided by the SAP Start Framework for SAP application server instances. If this library is not properly configured for a given SAP instance, pacemaker cluster that is managing this SAP instance will consider any change in the state of the SAP instance that has been triggered by a SAP management tool as an issue, and will take appropriate action to recover from such situation.

Implementing the sap_cluster_connector is not required if the SAP instance will only be managed by the cluster tools such as pcs or the PCSD WEB GUI.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments