A “Silly Season Blog” – Have Fun with Sapstartsrv and Pacemaker

Share
Share

This blog is about a funny integration of a plain Linux service into the SAP start framework sapstartsrv and SUSEs High Availability solution based on pacemaker. This solution is not intended to run in productive environments but should demonstrate how to integrate special services.

At first we have decided which Linux server process could we try to integrate? Let us take something silly and not productive services. So we do not use a service like sshd, ftpd or apache2. What about qperf? Qperf is a simple, small Linux client server software to measure network performance. So it perfectly matches to our goals. It is not productive, it does show-up as a real Linux service and it could be started and stopped quite easy.

The first step is to install qperf on our system where we already have a non productive SAP installation like any SAP NetWeaver instance.

Install Qperf and Set-Up Directory Structure

We use zypper to install the linux software package qperf and sap-suse-cluster-connector:

 zypper in qperf sap-suse-cluster-connector

That was really easy enough.

In the following the example uses the following values: SID is QPF, the instance number is 42, the instance name is QPERF and the virtual host name is grauenstein01.

Create a base directory structure where we implement our qperf instance:

 mkdir -p /usr/sap/QPF/QPERF42/exe
 mkdir -p /usr/sap/QPF/QPERF42/work
 mkdir -p /usr/sap/QPF/SYS/profile
 mkdir -p /usr/sap/QPF/SYS/global/sapcontrol

Create the user qpfadm and add this user to the to the group sapsys. From your non-productive installation on the same server we copy some files to fill the executable (exe) directory:  Copy sapstartsrv, sapcontrol, sapstart and the library libsapnwrfccm.so to /usr/sap/QPF/QPERF42/exe. From our installed qperf package copy the qperf binary into the same directory. Adjust the ownership of the complete directory tree in /usr/sap/QPF to qpfadm:sapsys. At the end the directory should look like:

 /usr/sap/QPF/QPERF42/exe/sapstartsrv
 /usr/sap/QPF/QPERF42/exe/libsapnwrfccm.so
 /usr/sap/QPF/QPERF42/exe/sapcontrol
 /usr/sap/QPF/QPERF42/exe/sapstart
 /usr/sap/QPF/QPERF42/exe/qperf

We are already done with the software installation.

Creating an Instance Profile

Now it’s time to set up the instance configuration. In directory /usr/sap/QPF/SYS/profile we create a config file names QPF_QPERF42_grauenstein. The name scheme is <SID>_<INSTANCE-NAME>_<virtual-or-real HOSTNAME>.

grauenstein01:~ # cat /usr/sap/QPF/SYS/profile/QPF_QPERF42_grauenstein01
SAP_RETRIEVAL_PATH = $(DIR_INSTANCE)/$(SAPLOCALHOST)
DIR_HOME = $(SAP_RETRIEVAL_PATH)/trace
DIR_PERF = $(SAP_RETRIEVAL_PATH)/trace
DIR_LOGGING = $(SAP_RETRIEVAL_PATH)/log
SECUDIR = $(SAP_RETRIEVAL_PATH)/sec
Autostart = 0
SETENV_00 = PATH=$(DIR_INSTANCE)/exe:%(PATH)
SAPSYSTEMNAME = QPF
SAPLOCALHOST = grauenstein
SAPSYSTEM = 42
INSTANCE_NAME = QPERF42
DIR_EXECUTABLE = $(DIR_INSTANCE)/exe
DIR_HOME = $(DIR_INSTANCE)/work
DIR_PROFILE = $(DIR_INSTALL)/profile
ccms/enable_agent = 0
service/status_procs = qperf2
_PF = $(DIR_PROFILE)/QPF_QPERF42_grauenstein
#-----------------------------------------------------------------------
# Start qperf
#-----------------------------------------------------------------------
_QPERF = $(DIR_HOME)/qperf.suse.$(SAPSYSTEMNAME)_$(INSTANCE_NAME)
Execute_01 = local rm -f $(_QPERF)
Execute_02 = local ln -s -f $(DIR_EXECUTABLE)/qperf $(_QPERF)
Start_Program_02 = local $(_QPERF)

In our example you can easily see the definition of the SID, the instance number and the instance name. I also have highlighted the parameter service/status_procs and  start command Start_Program_02. While the parameter is needed to allow the sap start framework to show the status of the service the start command is the most important one in the instance profile as it does the real work.

Testing the Instance with sapstartsrv and sapcontrol

The software is installed and the start framework is configured. This gives us the chance to use sapcontrol to start or stop the QPERF instance. And we can get the status of the configured services.

qpfadm@grauenstein01:~> /usr/sap/QPF/QPERF42/exe/sapcontrol -nr 42 -function GetProcessList
23.10.2019 14:04:30
GetProcessList
OK
name, description, dispstatus, textstatus, starttime, elapsedtime, pid
qperf, , GREEN, Running, 2019 09 05 15:44:45, 1150:19:45, 23708

We use the instance number 42 as configured in the instance profile. The called function “GetProcessList” lists the status of the services of an instance.

Integration into the Pacemaker Cluster

In the following we assume you have already an empty cluster running as described in our best practices available at: https://documentation.suse.com/sbp/all/

Beside of the other resources such as the file system and the IP address (IPaddr2) we add a primitive (type SAPInstance) resource to the cluster:

 primitive rsc_sap_QPG_QPERF42 SAPInstance \
   op monitor interval=10 timeout=60 on_fail=restart \
   params InstanceName=QPF_QPERF42_grauenstein \
      START_PROFILE="/usr/sap/QPF/SYS/profile/QPF_QPERF42_grauenstein" \
      MONITOR_SERVICES="qperf"

The interesting parameter here is MONITOR_SERVICES and we just add the new self-defined service “qperf” to that services list and – voila – the cluster is able
to control and monitor the qperf service of our instance QPERF42.

Next step is to enable the sap-suse-cluster-connector as described in our best practices available at https://documentation.suse.com/sbp/all/.

You need to add the following lines to the instance profile and sapstartsrv needs to be restarted:

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

Controlling via The SAP Management Console

It would be really nice, if we could also make our QPER42 instance visible in the graphical SAP Management Console. So do not hesitate to start the SAP Management Console and enjoy the result 🙂

How to use that solution for SAP workloads?

We described the procedure with a plain linux service (here qperf) to show that nearly each simple service binary might be integrated into the SAP start framework and could be controlled by SUSEs High Availability solution based on pacemaker.

That implies that also SAP services which might be even available in a non-SAP-instance-installation could be integrated in that simple way. Examples could be the SAP Webdispatcher,
the ASE fault manager or other services.

If the SAP service is already available in a SAP instance it is even more easy. Then you just need to integrate the SAP instance into the cluster using the SAPInstance primitive and to set the parameters for the profile and the monitored services properly.

This is Fabian (SUSE) from the SAP LinuxLab.

 

Share
(Visited 35 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

No comments yet

Avatar photo
9,635 views