How to enable the SAP HA Interface for SAP ABAP application server instances managed by the RHEL HA Add-On?
Environment
- Red Hat Enterprise Linux 7 with High-Availability Add-on
- Red Hat Enterprise Linux 8 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 by SAPInstance 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.
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
# yum install resource-agents-sap
# yum install sap-cluster-connector
RHEL 8
# dnf install resource-agents-sap
# 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 to haclient
group so this user can interact with cluster. (Example below uses user rh2adm
as example, adjust this for your environment). Run the following command on both cluster nodes.
# usermod -a -G haclient rh2adm
2.2. Modify start profiles of all SAP instances that should be managed by external tools. To do this add following lines to the end of the SAP instance start profile. Start profiles can be found in /sapmnt/<SID>/profile
directory. For example a start profile for system with SID RH2
, ASCS instance with instance number 20
and virtual hostname rh2-ascs
can be found in /sapmnt/RH1/profile/RH2_ASCS20_rh2-ascs
.
service/halib = $(DIR_EXECUTABLE)/saphascriptco.so
service/halib_cluster_connector = /usr/bin/sap_cluster_connector
2.3. If the SAP instances are currently running in the cluster, disable them. (Example below uses resource name rh2_ascs20
and rh2_ers29
)
# pcs resource disable rh2_ers29
# pcs resource disable rh2_ascs20
2.4. On each node of the cluster, stop the sapstartsrv
process associated to these instances. You can determine which instance the sapstartsrv
is related to by checking the pf
attribute in process list pointing to start profile of the instance.
ASCS:
# ps aux|grep sapstartsrv|grep rh2adm
rh2adm 856 0.0 1.0 1107820 78524 ? Ssl 13:42 0:09 /usr/sap/RH2/ASCS20/exe/sapstartsrv pf=/usr/sap/RH2/SYS/profile/RH2_ASCS20_ascs -D -u rh2adm
ERS:
# ps aux|grep sapstartsrv|grep rh2adm
rh2adm 18131 0.0 1.0 1039548 78564 ? Ssl 13:06 0:08 /usr/sap/RH2/ERS29/exe/sapstartsrv pf=/sapmnt/RH2/profile/RH2_ERS29_ers -D -u rh2adm
Stop the identified sapstartsrv
process using the PID obtained from previous step. After the command, verify that startsapsrv
processes has stopped.
# kill XXX
2.5. Re-enable the cluster resources and let the SAP instances to be started by SAPInstance
resource agent. If there are issues starting the resources, check corresponding sapstartsrv.log
and fix any error.
# pcs resource enable rh2_ascs20
# pcs resource enable rh2_ers29
2.6. Verify that sap_cluster_connector
has been properly identified and loaded.
Check that startsapsrv.log
file 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 ASCS is running, call sapcontrol
using the instance number of the ASCS instance:
rh2adm > sapcontrol -nr 20 -function HACheckConfig
3. Upgrade 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 SAP Cluster Connector was delivered as part of the resource-agents-sap
package and the name of the connector was sap_redhat_cluster_connector
. When upgrading from older release, install sap_cluster_connector
, and refer to step 2.2 to adjust the profiles accordingly.
4. Supported Databases
For supported databases by Pacemaker cluster on RHEL 7 and RHEL 8, please refer to the following documents:
Root Cause
sap_cluster_connector
is a library that allows tools to control SAP Instances that are running inside a cluster, through HA Interface. 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 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 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.