Iniciar sesión / Registrar Cuenta

Red Hat Enterprise Linux (RHEL) 8, which was released at the Red Hat Summit in May 2019, can provide significant performance improvements across a range of modern workloads. 

As of March 31, 2020, SAP officially announced the support for SAP HANA 2.0 on Red Hat Enterprise Linux 8.1 for SAP Solutions on Intel 64 and IBM POWER9 architectures. 

With this offering, SAP HANA is fully certified and supported on Red Hat Enterprise Linux 8.1 for SAP Solutions as documented in SAP notes 2777782 and 2235581. Beyond the benefits provided by the latest version of the world’s leading enterprise Linux platform, RHEL 8 for SAP Solutions offers the following components: 

  • SAP-specific technical components to support S/4HANA, SAP HANA, and SAP Business Applications.

  • High availability solutions for S/4HANA, SAP HANA, and SAP Business Applications.

  • RHEL System Roles for SAP, which can be used to automate the configuration of a RHEL system to run SAP workloads.

  • Smart Management and Red Hat Insights for lifecycle management and proactive optimization.

  • Update services for SAP Solutions, providing support for specific minor RHEL releases for four years from general availability. 

Today, we will walk you through how to use the above mentioned components to quickly deploy SAP HANA, express edition. Before we start, let’s define what this is: 

SAP HANA is a data platform that uses in-memory database technology to allow the processing of massive amounts of real-time data in a short time. SAP HANA, express edition (HXE) runs on PCs, laptops, and small servers or in the cloud. Use this edition, with up to 32 GB of memory, to build applications for free. 

Let’s deploy SAP HANA HXE! Doing so involves a few steps. Follow along below and you’ll be well on your way to deploying SAP HANA HXE on RHEL 8.1. 

You’ll first need to prepare your hardware and software. Second, install RHEL system roles for SAP HANA and run the playbook to make sure RHEL 8 is in good shape. Next, register your RHEL 8 to Red Hat Insights to gain best practice advice. Finally, download and deploy SAP HANA HXE on RHEL 8. No worries, we will guide you through this in the rest of the blog. 

Prerequisites

Your system should should meet the following hardware requirements at least: 

  • RAM: 16 GB (24 GB recommended)

  • HDD: 120 GB free space on root filesystem (/)

  • Cores: 2 cores (4 recommended)

With that, you need to make sure the following repositories are enabled: 

  • rhel-8-for-x86_64-appstream-rpms

  • rhel-8-for-x86_64-baseos-rpms

  • rhel-8-for-x86_64-sap-solutions-rpms

SAP HANA will rely on the following GCC C++ runtime compatibility libraries, i.e. compat-sap-c++. These packages are available with RHEL for SAP Solutions only. Please be aware that Red Hat Enterprise Linux for SAP Solutions subscription is required for rhel-8-for-x86_64-sap-solutions-rpms

In this demo, my system has 4 vCPUs, 16 GB RAM. Please make sure the root filesystem (/)  has at least 120 GB of free space because the SAP HANA HXE will be deployed on /hana by default. 

Setting up RHEL 8 for SAP Solutions

Let’s configure RHEL 8 for SAP Solutions. You’ll first need to add the hostname or FQDN in /etc/hosts, otherwise it will fail the installation. 

10.0.2.4 saphana1.internal.cloudapp.net saphana1

Once the entry is added, run these commands to enable repositories: 

# yum clean all
# subscription-manager clean
# subscription-manager register --auto-attach
# subscription-manager attach --pool=<pool ID>
# subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms \
--enable=rhel-8-for-x86_64-baseos-rpms \
--enable=rhel-8-for-x86_64-sap-solutions-rpms \
--enable=ansible-2-for-rhel-8-x86_64-rpms

With that, install GCC C++ runtime compatibility libraries: compat-sap-c++

# yum install compat-sap-c++-*

You can also find the packages here, in case you need them. 

Next step is to use RHEL System Roles for SAP to configure the server, including configuring kernel parameters and services. RHEL System Roles for SAP is a collection of roles executed by Ansible to assist administrators with server configuration, which is provided in the RHEL for SAP Solutions repositories. RHEL System Roles for SAP can be used by Ansible Engine, Ansible Tower, and Red Hat Satellite 6.5 and later to manage RHEL systems. You can run the following commands to install Ansible Engine and RHEL System Roles for SAP:

# yum install ansible rhel-system-roles-sap

Once the package installs, you can run the following playbook to configure RHEL 8.1: 

# cat site.yml

---
- hosts: localhost
  connection: local
  roles:
  - role: sap-preconfigure
  - role: sap-hana-preconfigure
...

# ansible-playbook site.yml

Running Ansible playbook

...

Playbook output

You may be wondering what is in the playbook. Let’s take RHEL System Roles sap-hana-preconfigure as an example. While it is running, one of the tasks is to configure the tuned profile to sap-hana. 

# cat /usr/share/ansible/roles/sap-hana-preconfigure/tasks/RedHat/generic/configure-tuned.yml

---

- debug:
    msg: "imported RedHat/generic/configure-tuned.yml"

- block:
    - name: Enable and start tuned
      service:
        name: tuned
        state: started
        enabled: yes

    - name: Show active tuned profile
      command: bash -lc "/usr/sbin/tuned-adm active | awk '/:/{print $NF}'"
      check_mode: no
      register: current_profile
      changed_when: false
    - debug:
        var: current_profile.stdout_lines, current_profile.stderr_lines

    - name: Switch to tuned profile sap-hana if not currently active
      block:
        - name: Switch to tuned profile sap-hana if not currently active
          shell: /usr/sbin/tuned-adm profile sap-hana
        
        - name: Show active tuned profile
          command: bash -lc "/usr/sbin/tuned-adm active | awk '{print $NF}'"
          register: new_profile
          changed_when: false
        - debug:
            var: new_profile.stdout_lines, new_profile.stderr_lines

      when:
        - current_profile.stdout != 'sap-hana'

  when:
    - sap_hana_preconfigure_switch_to_tuned_profile_sap_hana

...

The tuned profile sap-hana will configure kernel parameters for SAP HANA: 

# cat /usr/lib/tuned/sap-hana/tuned.conf

#
# tuned configuration
#

[main]
summary=Optimize for SAP HANA

[cpu]
force_latency=cstate.id:3|70
governor=performance
energy_perf_bias=performance
min_perf_pct=100

[vm]
transparent_hugepages=never

[sysctl]
kernel.sem = 32000 1024000000 500 32000
kernel.numa_balancing = 0
kernel.sched_min_granularity_ns = 3000000
kernel.sched_wakeup_granularity_ns = 4000000
vm.dirty_ratio = 40
vm.dirty_background_ratio = 10
vm.swappiness = 10
 
# tuned-adm active
Current active profile: sap-hana

Once the playbook is complete, register the system to Red Hat Insights for lifecycle management and proactive optimization: 

# insights-client --register

Then, open your browser to cloud.redhat.com/insights. On the left bar, click the Topics tab, and then choose SAP. It will bring up the rules page, which includes the SAP system issues identified by Red Hat Insights. 

Insights SAP page

You can also go to Inventory tab to navigate your server and find the information: 

SAP Configuration via Insights

 

SAP Hana Configuration

SAP Hana Insights view

Deploy SAP HANA HXE

Now, you are good to go. Follow the steps in thesection "Install SAP HANA 2.0, express edition" from Install SAP HANA, express edition on a Native Linux Machine. On my VM, it takes approximately 20 minutes to complete the installation. 

One thing you need to be aware of: While checking if XS Engine is running, please make sure that the relevant port is opened on the security group policy if the server is deployed on the cloud.  Here is an example of how a fully automated deployment of SAP HANA could look. 

Conclusion

RHEL 8 for SAP Solutions is equipped with many utilities to help SAP HANA run smoothly with the least amount of effort for the administrators. With this support, you can streamline the deployment and operation of SAP HANA. It can save you time and effort, which can be used to develop your business and make best use of your applications.


About the author

Edward Jin has been working in IT for more than 12 years. He has a strong service mindset and design thinking and insights to IT systems and processes within the pharmaceutical , manufacturing and finance industry. Currently, he is helping customers on their digital journey using open source technology.