Chapter 3. Configuring the SAP HANA Scale-Out environment
This solution is about setting up and configuring an SAP HANA Scale-Out environment with System Replication and Pacemaker. It is separated into two parts: Setting up a basic RHEL configuration, which is different for every environment. Deploying and configuring SAP HANA Scale-Out for System Replication and Pacemaker.
The minimal requirement is using 2 nodes per site plus a quorum device which is in our example an additional majoritymaker node. The test environment described here is built up with eight SAP HANA nodes and an additional majoritymaker node for cluster quorum. All SAP HANA nodes have a 50 GB root disk and an additional 80 GB partition for the /usr/sap directory. Every SAP HANA node has 32 GB RAM. The majoritymaker node can be smaller, for example 50GB root disk and 8GB of RAM. For the shared directories, there are two NFS pools with 128 GB. To ensure a smooth deployment, it is recommended that you record all required parameters as described in the Preparing the SAP HANA Scale-Out environment section of this document. The following example provides an overview of the required configuration parameters.
Environment
| Pacemaker | ||
| 4 Nodes (3 + 1) | Majoritymaker | 4 Nodes (3 + 1) |
| Shared Storage (NFS for DC1) | ← System Replication → | Shared Storage (NFS for DC2) |
| Network
| Network
| |
3.1. Setting up a basic RHEL configuration Copy linkLink copied to clipboard!
Use the procedures in this section to set up a basic RHEL configuration in your environment. You can also check for RHEL 8 in SAP-Notes 2772999 - Red Hat Enterprise Linux 8.x: Installation and Configuration and 2777782 - SAP HANA DB: Recommended OS Settings for RHEL 8.
Please check SAP Note 2235581 - SAP HANA: Supported Operating Systems to verify that the RHEL 8 minor release that is going to be used is supported for running SAP HANA. In addition, it is also necessary to check with the server/storage vendor or cloud provider to make sure that the combination of SAP HANA and RHEL 8 is supported on the servers/storage or cloud instances that are to be used.
For information about the latest RHEL release, see the Release Notes document available on the Customer Portal. To find your installed version and see if you need to update, run the following command:
[root:~]# subscription-manager release Release: 8.2 [root:~]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.2 (Ootpa) [root:~]#
[root:~]# subscription-manager release
Release: 8.2
[root:~]# cat /etc/redhat-release Red Hat Enterprise Linux
release 8.2 (Ootpa)
[root:~]#
3.1.1. Registering your RHEL system and enabling repositories Copy linkLink copied to clipboard!
-
In this solution, Red Hat receives system registration directly as there is no staging configuration. You are recommended to create a staging configuration for SAP HANA systems to have a reproducible environment. Satellite Server provides packet management, which also includes the staging process (
dev/qa/prod.) For more information, refer to the Satellite Server product information. - You must verify that the hostname is correct before registering the system, as this makes it easier to identify systems when managing subscriptions. For more information, refer to the solution How to set the hostname in Red Hat Enterprise Linux 7, 8, 9. For RHEL 8, check Configuring basic system settings.
Prerequisites
- RHEL 8 is installed.
- You are logged in as user root on every host, including the 'majoritymaker` for Subscription Management.
Procedure
If a staging configuration is not present, you can assign the registration of the SAP HANA test deployment directly to Red Hat Subscription Management (RHSM) with the following command:
[root:~]# subscription-manager register
[root:~]# subscription-manager registerCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Enter the username and password.
List all pools available with the
rhel-8-for-x86_64-sap-solutions-rpmsrepositories:[root:~]# subscription-manager list --available --matches="rhel-8-for-x86_64-sap-solutions-rpms"
[root:~]# subscription-manager list --available --matches="rhel-8-for-x86_64-sap-solutions-rpms"Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information, refer to Configuring basic system settings.
NoteThe company pool ID is required. If the list is empty contact Red Hat for a list of the company’s subscriptions.
Attach the pool ID to your server instances:
[root:~]# subscription-manager attach --pool=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[root:~]# subscription-manager attach --pool=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check if the repo for
sap-solutionsis enabled:[root:~]# yum repolist | grep sap-solution rhel-8-for-x86_64-sap-solutions-rpms RHEL for x86_64 - SAP Solutions (RPMs)
[root:~]# yum repolist | grep sap-solution rhel-8-for-x86_64-sap-solutions-rpms RHEL for x86_64 - SAP Solutions (RPMs)Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can enable the RHEL 8 required repos:
[root:~]# subscription-manager repos --enable=rhel-8-for-x86_64-sap-solutions-rpms --enable=rhel-8-for-x86_64-highavailability-rpms
[root:~]# subscription-manager repos --enable=rhel-8-for-x86_64-sap-solutions-rpms --enable=rhel-8-for-x86_64-highavailability-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information, see RHEL for SAP Subscriptions and Repositories.
Update the packages on all systems to verify that the correct RPM packages and versions are installed:
[root:~]# yum update -y
[root:~]# yum update -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.2. Configuring network settings Copy linkLink copied to clipboard!
This section describes the network parameters used in this solution. The configuration of this solution was dependent on the environment, and it should be considered an example. The configuration of the network should be done according to SAP specifications. An example for node dc1hana01 is included in the Preparing the SAP HANA Scale-Out environment section of this document.
[root:~]# nmcli con add con-name eth1 ifname eth1 autoconnect yes type ethernet ip4 192.168.101.101/24 nmcli con add con-name eth2 ifname eth2 autoconnect yes type ethernet ip4 192.168.102.101/24
[root:~]# nmcli con add con-name eth1 ifname eth1 autoconnect yes type ethernet ip4 192.168.101.101/24 nmcli con add con-name eth2 ifname eth2 autoconnect yes type ethernet ip4 192.168.102.101/24
3.1.3. Configuring /etc/hosts Copy linkLink copied to clipboard!
Use this procedure to configure /etc/hosts on your RHEL systems. This configuration is necessary for consistent hostname resolution.
Procedure
-
Login as user root on every host and configure the
/etc/hostsfile. - Create a host entry for every SAP HANA host in the scale-out environment.
Copy the hosts file to every node. It is important to set the hostname in the order shown in the following output example. If not, the SAP HANA environment fails during the deployment or operating process.
NoteThis configuration is based on the parameters listed in the Preparing the SAP HANA Scale-Out environment section of this document.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.4. Configuring disks Copy linkLink copied to clipboard!
Complete this procedure to configure the disks on your RHEL systems.
Procedure
Login as user root on every SAP HANA host for the additional
/usr/sappartition.NoteIn general, the default XFS format and mount options are optimal for most workloads. Red Hat recommends that the default values are used unless specific configuration changes are expected to benefit the workload of the file system. All supported file systems can be used. For more information, refer to SAP Note 2972496 - SAP HANA Filesystem Types. If software RAID is used, the
mks.xfscommand automatically configures itself with the correct stripe unit and width to align with the hardware.Create the required mount points:
[root:~]# mkdir -p /usr/sap
[root:~]# mkdir -p /usr/sapCopy to Clipboard Copied! Toggle word wrap Toggle overflow On the logical volume, create file systems based on XFS:
[root:~]# mkfs -t xfs -b size=4096 /dev/sdb
[root:~]# mkfs -t xfs -b size=4096 /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about the creation of an XFS filesystem and the tuning possibilities, run the
man mkfs.xfscommand. For optimal performance of the XFS file system, refer to the article What are some of best practices for tuning XFS filesystems.Write the mount directives to
/etc/fstab:[root:~]# echo "/dev/sdb /usr/sap xfs defaults 1 6" >> /etc/fstab
[root:~]# echo "/dev/sdb /usr/sap xfs defaults 1 6" >> /etc/fstabCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf mount points are managed by filesystem resources, these file systems must then be later commented out again in the
/etc/fstabfile.Check if XFS filesystems from
/etc/fstabcan be mounted:[root:~]# mount /usr/sap
[root:~]# mount /usr/sapCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.5. Configuring Scale-Out with shared storage for each datacenter Copy linkLink copied to clipboard!
In cloud environments, there can be different sources for the same mount point in different availability zones.
Use this procedure to configure scale-out with shared services for each datacenter.
Procedure
Login as user root on every SAP HANA host for the shared storage configuration.
NoteThe
nfs-utilspackage is required. Every datacenter requires its own storage configuration. For this example, the storage configuration is built as a shared storage environment. Both scale-out environments are using its own NFS share. This configuration is based on the information in the Preparing the SAP HANA Scale-Out environment section of this document. In a production environment, this procedure should be configured as supported by your preferred hardware vendor.Install the
nfs-utilspackage:[root:~]# yum install -y nfs-utils
[root:~]# yum install -y nfs-utilsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the nodes in Datacenter 1:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To mount the volumes run the following command:
[root:~]# mount -a
[root:~]# mount -aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the nodes in Datacenter 2:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To mount the volumes run the following command:
[root:~]# mount -a
[root:~]# mount -aCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Configuring and deploying SAP HANA Copy linkLink copied to clipboard!
3.2.1. Configuring RHEL settings required for running SAP HANA Copy linkLink copied to clipboard!
Use this procedure to configure the HA cluster nodes for running SAP HANA. It is necessary to perform these steps on each RHEL system on which a HANA instance is running.
Prerequisites
- You are logged in as user root on every host of the shared storage configuration.
- You have prepared the installation source of SAP HANA.
You have set the hostname compatible with SAP HANA:
[root:~]# hostnamectl set-hostname dc1hana01
[root:~]# hostnamectl set-hostname dc1hana01Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure: Verifying /etc/hosts
Verify that
/etc/hostscontains an entry matching the hostname and IP address of the system:.example.com:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the system language to English:
[root:~]# localectl set-locale LANG=en_US.UTF-8
[root:~]# localectl set-locale LANG=en_US.UTF-8Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure: Configuring NTP
Edit
/etc/chrony.confand verify that the server lines reflect your ntp servers:[root:~]# yum -y install chrony [root:~]# systemctl stop chronyd.service
[root:~]# yum -y install chrony [root:~]# systemctl stop chronyd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check time server entries:
[root:~]# grep ^server /etc/chrony.conf server 0.de.pool.ntp.org server 1.de.pool.ntp.org
[root:~]# grep ^server /etc/chrony.conf server 0.de.pool.ntp.org server 1.de.pool.ntp.orgCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the chrony service:
[root:~]# systemctl enable chronyd.service [root:~]# systemctl start chronyd.service [root:~]# systemctl restart systemd-timedated.service
[root:~]# systemctl enable chronyd.service [root:~]# systemctl start chronyd.service [root:~]# systemctl restart systemd-timedated.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
chronyservice is enabled:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.2. Preconfiguring RHEL for SAP HANA Copy linkLink copied to clipboard!
Use this procedure to preconfigure the RHEL system for SAP HANA. This configuration is based on published SAP Notes. Run this procedure on every SAP HANA host in the cluster as user root.
- This procedure is based on SAP Notes SAP Note 2777782: SAP HANA DB: Recommended OS Settings for RHEL 8 and SAP Note 2772999 - Red Hat Enterprise Linux 8.x: Installation and Configuration.
- On RHEL 8, you can also use the RHEL System Roles for SAP to automate the installation and configuration of the HA cluster nodes. More information can be found here: Red Hat Enterprise Linux System Roles for SAP.
3.2.3. Installing the SAP Host Agent Copy linkLink copied to clipboard!
SAP Host Agent is installed automatically during the installation of all new SAP system instances or instances with SAP kernel 7.20 or higher. This manual installation is not necessary in most cases. Please install SAP HANA first and then check if the installation of saphostagent is still needed.
Prerequisites
-
You have verified that
umaskconfiguration is configured as a standard value (the command umask should reply 0022.); otherwise, the SAP Host Agent installation could fail. - You are logged in as user root on every host for SAP Host Agent installation.
The user and group are created during the SAP HANA installation if the user/group does not exist and the SAPHOSTAGENT is installed/upgraded through the installation of SAP software.
Procedure (optional)
Create the
sapadmandsapsysuser for the SAP Host Agent and set the password for thesapadmuser. The UID 996 of the usersapadmand the GID 79 of the groupsapsysare based on the parameters in the Preparing the SAP HANA Scale-Out environment section of this document.[root:~]# adduser sapadm --uid 996 [root:~]# groupadd sapsys --gid 79 [root:~]# passwd sapadm
[root:~]# adduser sapadm --uid 996 [root:~]# groupadd sapsys --gid 79 [root:~]# passwd sapadmCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a temp directory, unpack the installation source, and install the SAP Host Agent from the temp directory. The variable
INSTALLDIRHOSTAGENTis an example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Secure operation only works with an encrypted connection. You can configure a working SSL connection to achieve this. An SSL password is required. The following example is based on the parameters in the Preparing the SAP HANA Scale-Out environment section of this document.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the SAP Host Agent is available for all SAP HANA nodes:
[root:~]# netstat -tulpen | grep sapstartsrv tcp 0 0 0.0.0.0:50014 0.0.0.0:* LISTEN 1002 84028 4319/sapstartsrv tcp 0 0 0.0.0.0:50013 0.0.0.0:* LISTEN 1002 47542 4319/sapstartsrv
[root:~]# netstat -tulpen | grep sapstartsrv tcp 0 0 0.0.0.0:50014 0.0.0.0:* LISTEN 1002 84028 4319/sapstartsrv tcp 0 0 0.0.0.0:50013 0.0.0.0:* LISTEN 1002 47542 4319/sapstartsrvCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteNot all processes are identified. Non-owned process information are not be shown. You have to be root to see all processes.
[root:~]# netstat -tulpen | grep 1129 tcp 0 0 0.0.0.0:1129 0.0.0.0:* LISTEN 996 25632 1345/sapstartsrv
[root:~]# netstat -tulpen | grep 1129 tcp 0 0 0.0.0.0:1129 0.0.0.0:* LISTEN 996 25632 1345/sapstartsrvCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about how to install SAP Host Agent, see SAP Host Agent Installation.
3.2.4. Deploying SAP HANA with Scale-Out and System Replication Copy linkLink copied to clipboard!
Before deploying SAP HANA with Scale-Out and System Replication, you must understand SAP network mappings. This solution provides minimal configuration details for deployment in a lab environment. However, when configuring a production environment, it is necessary to map the scale-out network communication and system replication communication over separate networks. This configuration is described in the Network Configuration for SAP HANA System Replication.
The SAP HANA database should be installed as described according to the SAP HANA Server Installation and Update Guide.
There are different options to set up the SAP HANA database. You must install the database on both datacenters with the same SID. A scale-out configuration needs at least 2 HANA instances per site.
The installation for each HANA site consists of the following steps:
-
Install SAP HANA database on the first node using
hdblcm(checkhdblcmin theSAP_HANA_DATABASEsubdirectory of the SAP HANA installation media). Configure the internal network for the scale-out configuration on this first node (this is only necessary once):
[root:~]# ./hdblcm --action=configure_internal_network
[root:~]# ./hdblcm --action=configure_internal_networkCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the additional HANA instances on the other nodes using the shared executable created by the first installation:
[root:~]# /hana/shared/RH1/hdblcm/hdblcm
[root:~]# /hana/shared/RH1/hdblcm/hdblcmCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Choose the right HANA role (worker or standby) for each HANA instance.
- Repeat the same steps for the secondary HANA site.
Setup SAP HANA System Replication between both sites:
- Copy keys.
-
Backup primary database (
SYSTEMDBand tenant). - Stop HANA on secondary site.
- Register secondary HANA site to primary HANA site.
- Start HANA on secondary site.
The HANA database installation can also be done using the hdblcm command in batch mode. It is possible to use the config file template, which is used as an answer file for a complete automatic installation.
In this solution, the SAP database is installed over the batch mode with the integration of additional hosts that perform an automatic deployment over the SAP Host Agent for each datacenter. A temporary password file is generated, which includes all of the necessary deployment passwords. Based on this file, a command-based batch mode installation starts.
For batch mode installation, the following parameters must be changed:
- SID
- System number
-
Hostname of the installation instance (
hostname) -
All hostnames and roles (
addhosts) -
System type (
system_usage) -
Home directory of
<sid>admuser -
useridfrom usersapadm -
groupidfromsapsys
Most of the parameters are provided by SAP.
Procedure
- Login as user root on one SAP HANA node in each datacenter to start the SAP HANA Scale-Out installation.
In this solution, the following command is executed on one node in each datacenter:
[root:~]# INSTALLDIR=/install/51053381/DATA_UNITS HDB_SERVER_LINUX_X86_64/ [root:~]# cd $INSTALLDIR [root:~]# ./hdblcm --dump_configfile_template=/tmp/templateFile
[root:~]# INSTALLDIR=/install/51053381/DATA_UNITS HDB_SERVER_LINUX_X86_64/ [root:~]# cd $INSTALLDIR [root:~]# ./hdblcm --dump_configfile_template=/tmp/templateFileCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe correct addhosts parameter must be used. This must not include the installation node.
Change the passwords in
/tmp/templateFile.xml:NoteThe
internal_networkparameter is for the internal scale-out communication network. This prefills the SAP HANA configuration fileglobal.iniwith the correct configuration during the installation process.Datacenter 1 example:
[root:~]# cat /tmp/templateFile.xml | ./hdblcm \ --batch \ --sid=RH1 \ --number=10 \ --action=install \ --hostname=dc1hana01 \ --addhosts=dc1hana02:role=worker,dc1hana03:role=worker,dc1hana04:role =standby \ --install_hostagent \ --system_usage=test \ --sapmnt=/hana/shared \ --datapath=/hana/data \ --logpath=/hana/log \ --root_user=root \ --workergroup=default \ --home=/usr/sap/RH1/home \ --userid=79 \ --shell=/bin/bash \ --groupid=79 \ --read_password_from_stdin=xml \ --internal_network=192.168.101.0/24 \ --remote_execution=saphostagent
[root:~]# cat /tmp/templateFile.xml | ./hdblcm \ --batch \ --sid=RH1 \ --number=10 \ --action=install \ --hostname=dc1hana01 \ --addhosts=dc1hana02:role=worker,dc1hana03:role=worker,dc1hana04:role =standby \ --install_hostagent \ --system_usage=test \ --sapmnt=/hana/shared \ --datapath=/hana/data \ --logpath=/hana/log \ --root_user=root \ --workergroup=default \ --home=/usr/sap/RH1/home \ --userid=79 \ --shell=/bin/bash \ --groupid=79 \ --read_password_from_stdin=xml \ --internal_network=192.168.101.0/24 \ --remote_execution=saphostagentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Datacenter 2 example:
[root:~]# cat /tmp/templateFile.xml | ./hdblcm \ --batch \ --sid=RH1 \ --number=10 \ --action=install \ --hostname=dc2hana01 \ --addhosts=dc2hana02:role=worker,dc2hana03:role=worker,dc2hana04:role =standby \ --install_hostagent \ --system_usage=test \ --sapmnt=/hana/shared \ --datapath=/hana/data \ --logpath=/hana/log \ --root_user=root \ --workergroup=default \ --home=/usr/sap/RH1/home \ --userid=79 \ --shell=/bin/bash \ --groupid=79 \ --read_password_from_stdin=xml \ --internal_network=192.168.101.0/24 \ --remote_execution=saphostagent
[root:~]# cat /tmp/templateFile.xml | ./hdblcm \ --batch \ --sid=RH1 \ --number=10 \ --action=install \ --hostname=dc2hana01 \ --addhosts=dc2hana02:role=worker,dc2hana03:role=worker,dc2hana04:role =standby \ --install_hostagent \ --system_usage=test \ --sapmnt=/hana/shared \ --datapath=/hana/data \ --logpath=/hana/log \ --root_user=root \ --workergroup=default \ --home=/usr/sap/RH1/home \ --userid=79 \ --shell=/bin/bash \ --groupid=79 \ --read_password_from_stdin=xml \ --internal_network=192.168.101.0/24 \ --remote_execution=saphostagentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that everything is working on one host per datacenter after the installation process is complete:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.5. Configuring SAP HANA System Replication Copy linkLink copied to clipboard!
Configuring SAP HANA System Replication is done after both scale-out environments are installed. The configuration steps are:
- Backup the primary database.
- Enable system replication on the primary database.
- Stop secondary database.
- Copy database keys.
- Register the secondary database.
- Start secondary database.
- Verify system replication.
This solution provides high-level information about each step.
3.2.5.1. Backing up the primary database Copy linkLink copied to clipboard!
Backing up the primary database is required for SAP HANA System Replication. Without it, you cannot bring SAP HANA into a system replication configuration.
- This solution provides a simple example. In a production environment, you must take into account your backup infrastructure and setup.
-
It is very important that you include “/” in the SQL command; for example,
/hana/shared/backup/. If you do not, then you need write access to the directory, as SAP HANA will not use the directory but instead will create files namedPATH_databackup*.
3.2.5.2. Enable HANA System Replication Copy linkLink copied to clipboard!
After creating the backup functionality on your datacenter, you can start to configure system replication. The first datacenter starts with the configuration as the source site.
Enable system replication on the first datacenter (DC1) on one host of the scale-out system.
su - rh1adm [rh1adm@dc1hana01]% hdbnsutil -sr_enable --name=DC1 nameserver is active, proceeding … successfully enabled system as system replication source site done.
[root@dc1hana01]# su - rh1adm [rh1adm@dc1hana01]% hdbnsutil -sr_enable --name=DC1 nameserver is active, proceeding … successfully enabled system as system replication source site done.Copy to Clipboard Copied! Toggle word wrap Toggle overflow After the first datacenter is enabled for system replication, the second datacenter must be registered to the first datacenter. You must copy two keys from the enabled source system to the second datacenter. This must be done when the database is stopped.
Copy the key and key data file from the primary site to the secondary site. This is done on only one node in each datacenter. This file is shared over the
/hana/shareddirectory in the separated scale-out environments. For more information, see SAP Note 2369981 - Required configuration steps for authentication with HANA System Replication.Start this command on one node in Datacenter 1 (DC1):
scp -rp /usr/sap/RH1/SYS/global/security/rsecssfs/data/SSFS_RH1.DAT root@dc2hana01:/usr/sap/RH1/SYS/global/security/rsecssfs/data/SSFS_RH 1.DAT scp -rp /usr/sap/RH1/SYS/global/security/rsecssfs/key/SSFS_RH1.KEY root@dc2hana01:/usr/sap/RH1/SYS/global/security/rsecssfs/key/SSFS_RH1 .KEY
[root@dc1hana01]# scp -rp /usr/sap/RH1/SYS/global/security/rsecssfs/data/SSFS_RH1.DAT root@dc2hana01:/usr/sap/RH1/SYS/global/security/rsecssfs/data/SSFS_RH 1.DAT [root@dc1hana01]# scp -rp /usr/sap/RH1/SYS/global/security/rsecssfs/key/SSFS_RH1.KEY root@dc2hana01:/usr/sap/RH1/SYS/global/security/rsecssfs/key/SSFS_RH1 .KEYCopy to Clipboard Copied! Toggle word wrap Toggle overflow You can register the second datacenter (secondary SAP HANA instance) to the primary SAP HANA instance, after copying both keys to the secondary site. This has to be done on a node from Datacenter 2 (DC2) as
`user <sid>adm.NoteUp to now, two modes for the replication type are available:
- delta_datashipping
- logreplay
The replication mode should be either
syncorsyncmem. The "classic" operation mode isdelta_datashipping. The preferred mode for HA islogreplay. Using the operation modelogreplaymakes your secondary site in SAP HANA System Replication a hot standby system. For more information, see the SAP HANA System Replication.With the preferred operation mode, system replication is configured on the DC2 node as the
<sid>admuser:Copy to Clipboard Copied! Toggle word wrap Toggle overflow After the system starts, run the following commands to verify that everything works as expected. When the HANA Scale-Out environment is running correctly,
dispstatusmust showGREENfor all nodes in the output of theGetSystemInstanceListfunction ofsapcontrol(this may take several minutes after initial startup). Also, the landscape host configuration must be in theOKstate.Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the Datacenter 1 site, the
dispstatusmust showGREENfor all nodes in the output of theGetSystemInstanceListfunction ofsapcontroland the landscape host configuration must be in theOKstate.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check if HANA System Replication is active.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf this configuration is implemented in a production environment, it is recommended that you change the network communication in the
global.inifile. This action limits the communication to a specified adapter to the system replication network. For more information, see the Network Configuration for SAP HANA system replication.ImportantIt is necessary to manually test the complete SAP HANA Scale-Out System Replication environment and verify that all SAP HANA features are working. For more information, see the SAP HANA System Replication.
3.3. Configuring Pacemaker Copy linkLink copied to clipboard!
When the HANA Scale-Out environment is configured and HANA system replication is working as expected, you can configure the HA cluster to manage the HANA Scale-Out System Replication environment using the RHEL HA Add-On.
An additional quorum instance is necessary to prevent a Pacemaker split-brain configuration. In this example, we add a node. This node, referred to in this solution as majoritymaker, is needed for an odd number of cluster nodes for a working configuration. This is an additional minimalist host that only requires the Pacemaker and public network. While on this node, no SAP HANA database is installed, and storage configuration is obsolete.
Prerequisites
-
You have installed the
saphostagentand checked if /usr/sap/hostcontrol/exe/sapcontrol exists. For more information, check 1031096 - Installing Package SAPHOSTAGENT. - You have verified that the RHEL High Availability repository is configured in the system. You cannot install Pacemaker without this configuration.
- You have logged in as root to all systems.
You have verified that all cluster nodes are registered and have the required repositories enabled to install the packages for the cluster, as described in the Registering your RHEL system and enabling repositories section of this document.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
- Configure the cluster. For more information, see Configuring and managing high availability clusters.
On each node in the cluster, including the
majoritymaker, install the Red Hat High Availability Add-On software packages along with all available fence agents from the High Availability channel:yum -y install pcs pacemaker fence-agents
[root]# yum -y install pcs pacemaker fence-agentsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can also install only specific fence-agents:
yum install fence-agents-sbd fence-agents-ipmilan
[root]# yum install fence-agents-sbd fence-agents-ipmilanCopy to Clipboard Copied! Toggle word wrap Toggle overflow Execute the following commands to enable the ports that are required by the Red Hat High Availability Add-On, if you are running the
firewalleddaemon:firewall-cmd --permanent --add-service=high-availability firewall-cmd --add-service=high-availability
[root]# firewall-cmd --permanent --add-service=high-availability [root]# firewall-cmd --add-service=high-availabilityCopy to Clipboard Copied! Toggle word wrap Toggle overflow After this configuration, set the password for the user
haclusteron each cluster node.passwd hacluster Changing password for user hacluster. New password: Retype new password: passwd: all authentication tokens updated successfully.
[root]# passwd hacluster Changing password for user hacluster. New password: Retype new password: passwd: all authentication tokens updated successfully.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the daemon by issuing the following commands on each node:
systemctl start [root]# pcsd.service systemctl enable pcsd.service
[root]# systemctl start [root]# pcsd.service systemctl enable pcsd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow On only one node, you have to authenticate the
haclusteruser. It is important to include every node in this command, which should be part of the cluster. If you don’t specify the password, you are asked for thehaclusterpassword, which was defined in the previous step. For RHEL 8.x run the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
pcs clustersetup on the same node to generate and synchronize thecorosyncconfiguration. The RHEL 8 example also shows, if you are using 2 cluster networkCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the services on every node with the following cluster command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Completing all steps results in a configured cluster and nodes. The first step in configuring the resource agents is to configure the fencing method with STONITH, which reboots nodes that are no longer accessible. This STONITH configuration is required for a supported environment.
Use the fence agent that is appropriate for your hardware or virtualization environment to configure STONITH for the environment. Below is a generic example of configuring a fence device for STONITH:
pcs stonith create <stonith id> <fence_agent> ipaddr=<fence device> login=<login> passwd=<passwd>
[root@dc1hana01]# pcs stonith create <stonith id> <fence_agent> ipaddr=<fence device> login=<login> passwd=<passwd>Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteConfiguration for each device is different, and configuring STONITH is a requirement for this environment. If you need assistance, please contact Red Hat Support for direct assistance. For more information, refer to Support Policies for RHEL High Availability Clusters - General Requirements for Fencing/STONITH and Fencing Configuration.
After configuration, the cluster status should look like the following output. This is an example of a fencing device of a Red Hat Enterprise virtualization environment:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.1. Installing SAP HANA resource agents for Scale-Out systems Copy linkLink copied to clipboard!
When configuring the resource agents, the resource-agent-sap-hana-scaleout package was installed on every system, including the majoritymaker:
yum install resource-agents-sap-hana-scaleout
[root@dc1hana01]# yum install resource-agents-sap-hana-scaleout
Verify that the correct repository is attached. yum repolist should contain:
root# yum repolist "rhel-x86_64-server-sap-hana-<version>” RHEL Server SAP HANA (v. <version> for 64-bit <architecture>).
root# yum repolist
"rhel-x86_64-server-sap-hana-<version>” RHEL Server SAP HANA (v. <version> for 64-bit <architecture>).
3.3.2. Enabling the srConnectionChanged() hook on all SAP HANA instances Copy linkLink copied to clipboard!
As documented in SAP’s Implementing a HA/DR Provider, recent versions of SAP HANA provide "hooks" that allow SAP HANA to send out notifications for certain events. The srConnectionChanged() hook can be used to improve the ability of the cluster to detect when a change in the status of the SAP HANA System Replication occurs that requires the cluster to take action and to avoid data loss/data corruption by preventing accidental takeovers to be triggered in situations where this should be avoided. You must enable the hook before proceeding with the cluster setup, when using SAP HANA 2.0 SPS06 or later and a version of the resource-agents-sap-hana-scaleout package that provides the components for supporting the srConnectionChanged() hook.
Procedure
- Install the hook on one node in each datacenter on a shared device. For more information, see Implementing a HA/DR Provider.
Create a directory in the hana shared folder to configure the hooks. This is configured to create additional data from the SAP HANA database. To enable it, you must stop the system and add two additional configuration parameters to the
global.inifile. In this solution, the following example shows the configuration ofha_dr_provider_SAPHanaSrandtrace.Copy to Clipboard Copied! Toggle word wrap Toggle overflow On each cluster node, create the file
/etc/sudoers.d/20-saphanaby runningsudo visudo /etc/sudoers.d/20-saphanaand add the contents below to allow the hook script to update the node attributes when thesrConnectionChanged()hook is called:rh1adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_rh1_glob_srHook -v * -t crm_config -s SAPHanaSR rh1adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_rh1_gsh -v * -l reboot -t crm_config -s SAPHanaSR Defaults:rh1adm !requiretty
rh1adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_rh1_glob_srHook -v * -t crm_config -s SAPHanaSR rh1adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_rh1_gsh -v * -l reboot -t crm_config -s SAPHanaSR Defaults:rh1adm !requirettyCopy to Clipboard Copied! Toggle word wrap Toggle overflow For further information on why the defaults setting is needed, see The srHook attribute is set to SFAIL in a Pacemaker cluster managing SAP HANA system replication, even though replication is in a healthy state.
Start the SAP HANA database after the successful integration.
# Execute the following commands on one HANA node in every datacenter [root]# su - rh1adm [rh1adm]% sapcontrol -nr 10 -function StartSystem
# Execute the following commands on one HANA node in every datacenter [root]# su - rh1adm [rh1adm]% sapcontrol -nr 10 -function StartSystemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the hook script is working as expected. Perform an action to trigger the hook, such as stopping the HANA instance. Then, use the method given below to check if the hook logged anything:
[rh1adm@dc1hana01]% cdtrace [rh1adm@dc1hana01]% awk '/ha_dr_SAPHanaSR.*crm_attribute/ \ { printf "%s %s %s %s\n",$2,$3,$5,$16 }' nameserver_* 2018-05-04 12:34:04.476445 ha_dr_SAPHanaSR SFAIL 2018-05-04 12:53:06.316973 ha_dr_SAPHanaSR SOK[rh1adm@dc1hana01]% cdtrace [rh1adm@dc1hana01]% awk '/ha_dr_SAPHanaSR.*crm_attribute/ \ { printf "%s %s %s %s\n",$2,$3,$5,$16 }' nameserver_* 2018-05-04 12:34:04.476445 ha_dr_SAPHanaSR SFAIL 2018-05-04 12:53:06.316973 ha_dr_SAPHanaSR SOKCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information on how to verify that the SAP HANA hook is working, see Monitoring with M_HA_DR_PROVIDERS.
3.3.3. Configuring Pacemaker resources Copy linkLink copied to clipboard!
You have to create two resource agents, SAPHanaTopology and SAPHanaController, that control the HANA and Pacemaker environment, for the Pacemaker configuration process. Additionally, you need to configure a virtual IP address in Pacemaker for the connectivity of the end-user and the SAP application server. Based on the actions performed, two dependencies are added to ensure that the resource agents are executed in the correct order and that the virtual IP address is mapped to the right host.
Prerequisites
You have set the cluster
maintenance-modeto avoid unwanted effects during configuration:pcs property set maintenance-mode=true
[root@dc1hana01]# pcs property set maintenance-mode=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.3.1. Configuring the SAPHanaTopology resource Copy linkLink copied to clipboard!
The
SAPHanaTopologyresource agent gathers the status and configuration of SAP HANA System Replication on each node. In addition, it starts and monitors the local SAP HostAgent which is required to start, stop, and monitor the SAP HANA instances. The resource agent has the following attributes that depend on the installed SAP HANA environment:Expand Attribute Name
Required?
Default value
Description
SID
yes
null
The SAP System Identifier (SID) of the SAP HANA installation (must be identical for all nodes). Example: RH2
InstanceNumber
yes
null
The Instance Number of the SAP HANA installation (must be identical for all nodes). Example: 02
In this solution, the SID is set to RH1 and the Instance Number is set to 10.
NoteThe timeout and monitor parameters are recommended for the first deployment, and they can be changed while testing the environment. There are several dependencies, like the size and the number of nodes in the environment.
Execute the following command for RHEL 8.x as root on one host in the whole cluster:
pcs resource create rsc_SAPHanaTopology_RH1_HDB10 SAPHanaTopology SID=RH1 InstanceNumber=10 op methods interval=0s timeout=5 op monitor interval=10 timeout=600 clone clone-max=6 clone-node-max=1 interleave=true --disabled
[root@dc1hana01]# pcs resource create rsc_SAPHanaTopology_RH1_HDB10 SAPHanaTopology SID=RH1 InstanceNumber=10 op methods interval=0s timeout=5 op monitor interval=10 timeout=600 clone clone-max=6 clone-node-max=1 interleave=true --disabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow When the resource is created in Pacemaker, it is then cloned.
NoteThe
clone-node-maxparameter defines how many copies of the resource agent can be started on a single node. Interleave means that if this clone depends on another clone using an ordering constraint, it is allowed to start after the local instance of the other clone starts, rather than waiting for all instances of the other clone to start. Theclone-maxparameter defines how many clones could be started; if you have, for example, the minimum configuration of 2 nodes per site, you should useclone-max=4forSAPHanaControllerandSAPHanaTopology. At 3 nodes per site (without counting the standby node), you should use 6.You can view the collected information stored in the form of node attributes once the resource starts using the command:
root# pcs status --full
root# pcs status --fullCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.3.2. Configuring the SAPHanaController resource Copy linkLink copied to clipboard!
When the configuration process for the SAPHanaTopology resource agent is complete, the SAPHanaController resource agent can be configured. While the SAP Hana Topology resource agent collects only data, the SAPHanaTopology resource agent controls the SAP environment based on the data previously collected. As shown in the following table, five important configuration parameters define the cluster functionality:
| Attribute Name | Required? | Default value | Description |
| SID | yes | null | The SAP System Identifier (SID) of the SAP HANA installation (must be identical for all nodes). Example: RH2 |
| InstanceNumber | yes | null | The Instance Number of the SAP HANA installation (must be identical for all nodes). Example: 02 |
| PREFER_SITE_TAKEOVER | no | null | Should resource agent prefer to switch over to the secondary instance instead of restarting primary locally? true: prefer takeover to the secondary site; false: prefer restart locally; never: under no circumstances initiate a takeover to the other node. |
| AUTOMATED_REGISTER | no | false | If a takeover event has occurred, and the DUPLICATE_PRIMARY_TIMEOUT has expired, should the former primary instance be registered as secondary? ("false": no, manual intervention will be needed; "true": yes, the former primary will be registered by resource agent as secondary) [1]. |
| DUPLICATE_PRIMARY_TIMEOUT | no | 7200 | The time difference (in seconds) needed between two primary timestamps, if a dual-primary situation occurs. If the time difference is less than the time gap, the cluster will hold one or both instances in a "WAITING" status. This is to give the system admin a chance to react to a takeover. After the time difference has passed, if AUTOMATED_REGISTER is set to true, the failed former primary will be registered as secondary. After the registration to the new primary, all data on the former primary will be overwritten by the system replication. |
[1] - As a best practice for testing and Proof of Concept (PoC) environments, it is recommended that you leave AUTOMATED_REGISTER at its default value (AUTOMATED_REGISTER="false") to prevent a failed primary instance automatically registering as a secondary instance. After testing, if the failover scenarios work as expected, particularly in a production environment, it is recommended that you set AUTOMATED_REGISTER="true" so that after a takeover, system replication will resume in a timely manner, avoiding disruption. When AUTOMATED_REGISTER="false" in case of a failure on the primary node, you must manually register it as the secondary HANA system replication node.
The following command is an example for RHEL 8.x of how to create the SAPHanaController promotable resource. The example is based on the parameters: SID RH1, InstanceNumber 10, the values true for Prefer Site Takeover and Automated_REGISTER, and Duplicate Primary Timeout of 7200:
pcs resource create rsc_SAPHana_RH1_HDB10 SAPHanaController SID=RH1 InstanceNumber=10 PREFER_SITE_TAKEOVER=true DUPLICATE_PRIMARY_TIMEOUT=7200 AUTOMATED_REGISTER=true op demote interval=0s timeout=320 op methods interval=0s timeout=5 op monitor interval=59 role="Promoted" timeout=700 op monitor interval=61 role="Unpromoted" timeout=700 op promote interval=0 timeout=3600 op start interval=0 timeout=3600 op stop interval=0 timeout=3600 promotable clone-max=6 promoted-node-max=1 interleave=true --disabled
[root@dc1hana01]# pcs resource create rsc_SAPHana_RH1_HDB10 SAPHanaController SID=RH1 InstanceNumber=10 PREFER_SITE_TAKEOVER=true DUPLICATE_PRIMARY_TIMEOUT=7200 AUTOMATED_REGISTER=true op demote interval=0s timeout=320 op methods interval=0s timeout=5 op monitor interval=59 role="Promoted" timeout=700 op monitor interval=61 role="Unpromoted" timeout=700 op promote interval=0 timeout=3600 op start interval=0 timeout=3600 op stop interval=0 timeout=3600 promotable clone-max=6 promoted-node-max=1 interleave=true --disabled
For clone-max, use twice the number of HDB_WORKERs listed in the command:
In this solution, after the creation of the SAPHanaController, the resource is defined as a promotable resource with the following command: (SID is RH1 and InstanceNumber is 10).
For more information, see Multi-State Resources: Resources That Have Multiple Modes.
3.3.3.3. Configuring the resource to manage the virtual IP address Copy linkLink copied to clipboard!
The cluster needs to include a resource to manage the virtual IP address that is used by clients to reach the master nameserver of the primary SAP HANA Scale-Out site.
The following command is an example of how to create an IPaddr2 resource with the virtual IP 10.0.0.250:
pcs resource create rsc_ip_SAPHana_RH1_HDB10 ocf:heartbeat:IPaddr2 ip=10.0.0.250 op monitor interval="10s" timeout="20s"
[root@dc1hana01]# pcs resource create rsc_ip_SAPHana_RH1_HDB10 ocf:heartbeat:IPaddr2 ip=10.0.0.250 op monitor interval="10s" timeout="20s"
3.3.4. Creating constraints Copy linkLink copied to clipboard!
For correct operation, verify that SAPHanaTopology resources start before SAPHanaController resources start, and also that the virtual IP address is present on the node where the promoted resource of SAPHanaController runs. Use this procedure to create the four required constraints.
Procedure: Starting SAPHanaTopology before SAPHana
The following command is an example of how to create the constraint that mandates the start order of the resources.
Create the constraint:
pcs constraint order start rsc_SAPHanaTopology_RH1_HDB10-clone then start rsc_SAPHana_RH1_HDB10-clone
[root@dc1hana01]# pcs constraint order start rsc_SAPHanaTopology_RH1_HDB10-clone then start rsc_SAPHana_RH1_HDB10-cloneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Colocate the
IPaddr2resource with the promotedSAPHanaresource:pcs constraint colocation add rsc_ip_SAPHana_RH1_HDB10 with promoted rsc_SAPHana_RH1_HDB10-clone
[root@dc1hana01]# pcs constraint colocation add rsc_ip_SAPHana_RH1_HDB10 with promoted rsc_SAPHana_RH1_HDB10-cloneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Avoid the
majoritymakerto use an active role in the cluster environment:pcs constraint location add topology-avoids-majoritymaker rsc_SAPHanaTopology_RH1_HDB10-clone majoritymaker -INFINITY resource-discovery=never pcs constraint location add hana-avoids-majoritymaker rsc_SAPHana_RH1_HDB10-clone majoritymaker -INFINITY resource-discovery=never
[root@dc1hana01]# pcs constraint location add topology-avoids-majoritymaker rsc_SAPHanaTopology_RH1_HDB10-clone majoritymaker -INFINITY resource-discovery=never [root@dc1hana01]# pcs constraint location add hana-avoids-majoritymaker rsc_SAPHana_RH1_HDB10-clone majoritymaker -INFINITY resource-discovery=neverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Disable
maintenance-mode:Use
maintenance-modeto start the resources after settingmaintenance-modeto false. To avoid activities of pacemaker before all configurations are finished, we have used in the examples above--disabled. By default, the resources are started as soon as they are created. With--disabled, you can start the resources by using the command:pcs resource enable <resource-name>
[root@dc1hana01]# pcs resource enable <resource-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow To leave
maintenance-mode, please use:pcs property set maintenance-mode=false
[root@dc1hana01]# pcs property set maintenance-mode=falseCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following 3 commands to verify that the cluster environment is working correctly:
-
pcs statusprovides an overview of every resource and if they are functioning correctly. -
pcs status --fullprovides an overview of all resources and additional attribute information of the cluster environment. SAPHanaSR-showAttr --sid=RH1provides a readable overview that is based on the attribute information.The correct status is displayed a few minutes after deactivating the
maintenance-mode.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-