LoginSignup
7
2

More than 1 year has passed since last update.

SAP HANAをIBM Power Virtual Serverにデプロイしてみた 〜RHEL編〜

Last updated at Posted at 2021-08-05

今回やった内容

まず、今回は本番環境向けの設定ではなく、非本番プロファイルを使用しての構築です。
目的として、SAP HANAをIBM PowerVS環境でデプロイするにあたり、オーダーしたOSの初期パラメータやHANAデプロイに必要なパッチ、パラメータ類の確認を行いました。

*必要パッチやパラメータ類はSAP Noteを参考として、SAP HANAをデプロイするところまでを確認します。

環境

HANA

  • SAP HANA2.0 SPS05 Rev055

OS

  • Red Hat Enterprise Linux for SAP 8.1

Server

  • IBM Power System E980
  • リージョン:Tokyo
  • プロファイル:np1-1×128

*HANAモデル非本番プロファイルを使用しています。

作業内容

初めに今回SAP HANAを構築する上で、追加構成が必要となったパッケージとパラメータについてまとめておきたいと思います。
結果的に以下のパラメータ設定とパッケージ追加が必要となりました。

  • SELinux
  • kdump
  • auto-numa balancing
  • kernel.pid_max
  • tuned-profiles-sap-hana-2.12.0-3.el8_1.1.noarch.rpm
  • compat-sap-c++-9-9.1.1-2.2.el8.ppc64le.rpm
  • libatomic-8.4.1-1.el8.ppc64le.rpm
  • libtool-ltdl-2.4.6-25.el8.ppc64le.rpm

続いて詳細手順についてご紹介いたします。

〜Red Hat Enterprise Linux(RHEL)〜

インスタンス作成

IBM CloudインターフェースからPowerVSインスタンスを作成します。
image.png
image.png
image.png

作成されたインスタンスの管理画面の確認を行います。
image.png
image.png

ディスク構成

ディスク構成を確認してHANA用ディスクのマウントを行い、今回は追加ボリュームとして、HANAのプログラム、データ、ログ用途で500GBを追加してアサインします。

[root@hana-1core-128gb hana]# df -h
ファイルシス                                    サイズ  使用  残り 使用% マウント位置
devtmpfs                                           62G     0   62G    0% /dev
tmpfs                                              62G     0   62G    0% /dev/shm
tmpfs                                              62G   29M   62G    1% /run
tmpfs                                              62G     0   62G    0% /sys/fs/cgroup
/dev/mapper/360050768108181da90000000000023c9p2   100G   11G   90G   11% /
tmpfs                                              13G     0   13G    0% /run/user/0

HANA用ディスクの確認を行います。

[root@hana-1core-128gb hana]# fdisk -l

〜〜〜
中略
〜〜〜

ディスク /dev/mapper/360050768108181da90000000000023c8: 500 GiB, 536870912000 バイト, 1048576000 セクタ
単位: セクタ (1 * 512 = 512 バイト)
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O サイズ (最小 / 推奨): 32768 バイト / 32768 バイト


ディスク /dev/mapper/360050768108181da90000000000023c9: 100 GiB, 107374182400 バイト, 209715200 セクタ
単位: セクタ (1 * 512 = 512 バイト)
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O サイズ (最小 / 推奨): 32768 バイト / 32768 バイト
ディスクラベルのタイプ: dos
ディスク識別子: 0xfe8fb00b

デバイス                                        起動 開始位置  終了位置    セクタ サイズ Id タイプ
/dev/mapper/360050768108181da90000000000023c9p1 *        2048     10239      8192     4M 41 PPC PReP Boot
/dev/mapper/360050768108181da90000000000023c9p2         10240 209715166 209704927   100G 83 Linux
[root@hana-1core-128gb hana]# 

ファイルシステムを作成し、/hana へマウントします。

[root@hana-1core-128gb hana]# df -h
ファイルシス                                    サイズ  使用  残り 使用% マウント位置
devtmpfs                                           62G     0   62G    0% /dev
tmpfs                                              62G     0   62G    0% /dev/shm
tmpfs                                              62G   29M   62G    1% /run
tmpfs                                              62G     0   62G    0% /sys/fs/cgroup
/dev/mapper/360050768108181da90000000000023c9p2   100G   11G   90G   11% /
tmpfs                                              13G     0   13G    0% /run/user/0
/dev/mapper/360050768108181da90000000000023c8     500G  747M  500G    1% /hana

詳細なストレージの設定は下記をご参照ください。
IBM System Storage Architecture and Configuration Guide for SAP HANA TDI
https://www.ibm.com/support/pages/node/6355415

初期パラメータ

初期構築時のパラメータ確認を行い、追加で必要なパラメータ類の確認を行います。
*参照:2777782 - SAP HANA DB: Recommended OS Settings for RHEL 8

kernelバージョンの確認を行います。

kernel
[root@hana-1core-128gb ~]# uname -r
4.18.0-147.44.1.el8_1.ppc64le

SELinuxの確認を行います。

SELinux
[root@hana-1core-128gb ~]# getenforce
Enforcing

kdumpの確認を行います。

kdump
[root@hana-1core-128gb ~]# systemctl status kdump
 kdump.service - Crash recovery kernel arming
   Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: enabled)
   Active: active (exited) since Thu 2021-06-24 02:42:47 EDT; 1h 28min ago
 Main PID: 4201 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 26213)
   Memory: 0B
   CGroup: /system.slice/kdump.service

kernel.numa_balancingの確認を行います。

Turn-off-auto-numa-balancing
[root@hana-1core-128gb ~]# sysctl kernel.numa_balancing
kernel.numa_balancing = 1

transparent_hugepageの確認を行います。

Disable-Transparent-Hugepages-(THP)
[root@hana-1core-128gb ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always [madvise] never

Kernel samepage mergingの確認を行います。

Disable-Kernel-samepage-merging-(KSM)
[root@hana-1core-128gb ~]# cat /sys/kernel/mm/ksm/run
0

パラメータ修正

SELinuxのDisableを行います。

SELinux
[root@hana-1core-128gb ~]# sed -i 's/\(SELINUX=enforcing\|SELINUX=permissive\)/SELINUX=disabled/g' /etc/selinux/config
[root@hana-1core-128gb ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@hana-1core-128gb ~]# getenforce 
Disabled

kdumpのDisableを行います。

kdump
[root@hana-1core-128gb ~]# systemctl stop kdump
[root@hana-1core-128gb ~]# systemctl disable kdump
Removed /etc/systemd/system/multi-user.target.wants/kdump.service.
[root@hana-1core-128gb ~]# 
[root@hana-1core-128gb ~]# systemctl status kdump
 kdump.service - Crash recovery kernel arming
   Loaded: loaded (/usr/lib/systemd/system/kdump.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

kernel.numa_balancingのDisableを行います。

Turn-off-auto-numa-balancing
[root@hana-1core-128gb ~]# vi /etc/sysctl.conf
[root@hana-1core-128gb ~]# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.core.rmem_max = 56623104
net.core.wmem_max = 56623104
net.ipv4.tcp_rmem = 65536 262088 56623104
net.ipv4.tcp_wmem = 65536 262088 56623104
net.ipv4.tcp_mem = 56623104 56623104 56623104

#SAP Note:2777782
kernel.numa_balancing = 0


[root@hana-1core-128gb ~]# sysctl -p
net.core.rmem_max = 56623104
net.core.wmem_max = 56623104
net.ipv4.tcp_rmem = 65536 262088 56623104
net.ipv4.tcp_wmem = 65536 262088 56623104
net.ipv4.tcp_mem = 56623104 56623104 56623104
kernel.numa_balancing = 0
[root@hana-1core-128gb ~]# 
[root@hana-1core-128gb ~]# sysctl kernel.numa_balancing
kernel.numa_balancing = 0
[root@hana-1core-128gb ~]# 

tuned-profiles-sap-hanaの環境設定を行います。

tuned-profiles-sap-hana
[root@hana-1core-128gb os-patch]# yum install tuned-profiles-sap-hana-2.12.0-3.el8_1.1.noarch.rpm 
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
依存関係が解決しました
==============================================================================================================================================================================================================================================
 パッケージ                                                        アーキテクチャー                                 バージョン                                                   リポジトリー                                           サイズ
==============================================================================================================================================================================================================================================
インストール:
 tuned-profiles-sap-hana                                           noarch                                           2.12.0-3.el8_1.1                                             @commandline                                            32 k

トランザクションの概要
==============================================================================================================================================================================================================================================
インストール  1 パッケージ

合計サイズ: 32 k
インストール済みのサイズ: 1.4 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
トランザクションの確認を実行中
トランザクションの確認に成功しました
トランザクションのテストを実行中
トランザクションのテストに成功しました
トランザクションを実行中
  準備             :                                                                                                                                                                                                                      1/1 
  インストール中   : tuned-profiles-sap-hana-2.12.0-3.el8_1.1.noarch                                                                                                                                                                      1/1 
  scriptletの実行中: tuned-profiles-sap-hana-2.12.0-3.el8_1.1.noarch                                                                                                                                                                      1/1 
  検証             : tuned-profiles-sap-hana-2.12.0-3.el8_1.1.noarch                                                                                                                                                                      1/1 
Installed products updated.

インストール済み:
  tuned-profiles-sap-hana-2.12.0-3.el8_1.1.noarch                                                                                                                                                                                             

完了しました!
[root@hana-1core-128gb os-patch]# 
[root@hana-1core-128gb os-patch]# systemctl start tuned
[root@hana-1core-128gb os-patch]# systemctl enable tuned
[root@hana-1core-128gb os-patch]# tuned-adm profile sap-hana
[root@hana-1core-128gb os-patch]# tuned-adm active
Current active profile: sap-hana
[root@hana-1core-128gb os-patch]# 

kernel.pid_maxのパラメータ設定を行います。

Increase-kernel.pid_max
[root@hana-1core-128gb ~]# sysctl -w kernel.pid_max=4194304
kernel.pid_max = 4194304
[root@hana-1core-128gb ~]#
[root@hana-1core-128gb ~]# sysctl kernel.pid_max
kernel.pid_max = 4194304
[root@hana-1core-128gb ~]# 

追加パッケージ

初期インストールで不足しているパッケージをインストールします。
*参考:2886607 - Linux: Running SAP applications compiled with GCC 9.x

compat-sap-c++-9/libatomic
[root@hana-1core-128gb os-patch_RHEL]# yum install compat-sap-c++-9-9.1.1-2.2.el8.ppc64le.rpm libatomic-8.4.1-1.el8.ppc64le.rpm 
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
依存関係が解決しました
==============================================================================================================================================================================================================================================
 パッケージ                                                   アーキテクチャー                                    バージョン                                                   リポジトリー                                             サイズ
==============================================================================================================================================================================================================================================
インストール:
 compat-sap-c++-9                                             ppc64le                                             9.1.1-2.2.el8                                                @commandline                                             569 k
 libatomic                                                    ppc64le                                             8.4.1-1.el8                                                  @commandline                                              23 k

トランザクションの概要
==============================================================================================================================================================================================================================================
インストール  2 パッケージ

合計サイズ: 592 k
インストール済みのサイズ: 2.6 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
トランザクションの確認を実行中
トランザクションの確認に成功しました
トランザクションのテストを実行中
トランザクションのテストに成功しました
トランザクションを実行中
  準備             :                                                                                                                                                                                                                      1/1 
  インストール中   : libatomic-8.4.1-1.el8.ppc64le                                                                                                                                                                                        1/2 
  scriptletの実行中: libatomic-8.4.1-1.el8.ppc64le                                                                                                                                                                                        1/2 
  インストール中   : compat-sap-c++-9-9.1.1-2.2.el8.ppc64le                                                                                                                                                                               2/2 
  scriptletの実行中: compat-sap-c++-9-9.1.1-2.2.el8.ppc64le                                                                                                                                                                               2/2 
  検証             : compat-sap-c++-9-9.1.1-2.2.el8.ppc64le                                                                                                                                                                               1/2 
  検証             : libatomic-8.4.1-1.el8.ppc64le                                                                                                                                                                                        2/2 
Installed products updated.

インストール済み:
  compat-sap-c++-9-9.1.1-2.2.el8.ppc64le                                                                                     libatomic-8.4.1-1.el8.ppc64le                                                                                    

完了しました!

libtool-ltdlはSAP Noteへの記載はありませんが、HANAの導入を実施した際にパッケージとして不足していることがわかり、個別に導入しました。

libtool-ltdl
[root@hana-1core-128gb os-patch_RHEL]# rpm -ivh libtool-ltdl-2.4.6-25.el8.ppc64le.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:libtool-ltdl-2.4.6-25.el8        ################################# [100%]

HANA構築&稼働確認

HANAのインストールを実施します。

[root@hana-1core-128gb SAP_HANA_DATABASE]# ./hdblcm


SAP HANA Lifecycle Management - SAP HANA Database 2.00.055.00.1615413201
************************************************************************


Scanning software locations...
Detected components:
    SAP HANA Database (2.00.055.00.1615413201) in /work/hana/SAP_HANA_DATABASE/server
    SAP HANA Database Client (2.8.22.1621352674) in /work/hana/SAP_HANA_CLIENT/client

〜〜〜
中略
〜〜〜

Summary before execution:
=========================

SAP HANA Database System Installation
   Installation Parameters
      Remote Execution: ssh
      Database Isolation: low
      Install Execution Mode: standard
      Installation Path: /hana/shared
      Local Host Name: hana-1core-128gb
      SAP HANA System ID: H01
      Instance Number: 00
      Local Host Worker Group: default
      System Usage: custom
      Location of Data Volumes: /hana/data/H01
      Location of Log Volumes: /hana/log/H01
      SAP HANA Database secure store: ssfs
      Certificate Host Names: hana-1core-128gb -> hana-1core-128gb
      System Administrator Home Directory: /usr/sap/H01/home
      System Administrator Login Shell: /bin/sh
      System Administrator User ID: 1001
      ID of User Group (sapsys): 79
      SAP HANA Database Client Installation Path: /hana/shared/H01/hdbclient
   Software Components
      SAP HANA Database
         Install version 2.00.055.00.1615413201
         Location: /work/hana/SAP_HANA_DATABASE/server
      SAP HANA Database Client
         Install version 2.8.22.1621352674
         Location: /work/hana/SAP_HANA_CLIENT/client
   Log File Locations
      Log directory: /var/tmp/hdb_H01_hdblcm_install_2021-06-30_15.50.30
      Trace location: /var/tmp/hdblcm_2021-06-30_15.50.30_97531.trc

Do you want to continue? (y/n): y

〜〜〜
中略
〜〜〜

SAP HANA Database System installed
You can send feedback to SAP with this form: https://hana-1core-128gb:1129/lmsl/HDBLCM/H01/feedback/feedback.html
Log file written to '/var/tmp/hdb_H01_hdblcm_install_2021-06-30_15.50.30/hdblcm.log' on host 'hana-1core-128gb'.

最後に稼働確認をしてみます。

[root@hana-1core-128gb SAP_HANA_DATABASE]# su - h01adm -c "HDB info"
USER          PID     PPID  %CPU        VSZ        RSS COMMAND
h01adm     100951   100950   0.0     218176       4352 /bin/sh /usr/sap/H01/HDB00/HDB info
h01adm     101035   100951   0.0     232512       7296  \_ ps fx -U h01adm -o user:8,pid:8,ppid:8,pcpu:5,vsz:10,rss:10,args
h01adm      99092        1   0.0 3848291410560   35776 hdbrsutil  --start --port 30003 --volume 3 --volumesuffix mnt00001/hdb00003.00003 --identifier 1625036106
h01adm      98700        1   0.0 3848291410624   35840 hdbrsutil  --start --port 30001 --volume 1 --volumesuffix mnt00001/hdb00001 --identifier 1625036071
h01adm      98569        1   0.0      11136       4928 sapstart pf=/hana/shared/H01/profile/H01_HDB00_hana-1core-128gb
h01adm      98576    98569   0.0 3848291163904   84352  \_ /usr/sap/H01/HDB00/hana-1core-128gb/trace/hdb.sapH01_HDB00 -d -nw -f /usr/sap/H01/HDB00/hana-1core-128gb/daemon.ini pf=/usr/sap/H01/SYS/profile/H01_HDB00_hana-1core-128gb
h01adm      98594    98576  78.1 3848302765120 7195904      \_ hdbnameserver
h01adm      98839    98576   0.4 3848293237888  150208      \_ hdbcompileserver
h01adm      98842    98576   272 3848296506944 4292480      \_ hdbpreprocessor
h01adm      98891    98576  82.3 3848302292160 6834304      \_ hdbindexserver -port 30003
h01adm      98894    98576   2.6 3848296515520 1366592      \_ hdbxsengine -port 30007
h01adm      99311    98576   3.1 3848295107392  625600      \_ hdbwebdispatcher
h01adm      98482        1   1.1     494720      34816 /usr/sap/H01/HDB00/exe/sapstartsrv pf=/hana/shared/H01/profile/H01_HDB00_hana-1core-128gb -D -u h01adm

まとめ

今回は非本番環境のデプロイを実施し、追加パッケージなどは必要でしたが、HANAの稼働確認まで簡単に行うことができました。
時間計測はしてないので感覚にはなってしまいますが、今回の環境下では事前準備などを行いスムーズにいけば正味1時間でデプロイできました。
次回はデプロイの自動化にチャレンジ!

参考

2777782 - SAP HANA DB: Recommended OS Settings for RHEL 8 Version 19 from 16.03.2021
https://launchpad.support.sap.com/#/notes/2777782

2886607 - Linux: Running SAP applications compiled with GCC 9.x Version 2 from 26.06.2020
https://launchpad.support.sap.com/#/notes/2886607

IBM Cloud Docs: IBM Power Systems Virtual Server の概説
https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started

IBM Cloud Docs: IBM Cloud for SAP の概要
https://cloud.ibm.com/docs/sap?topic=sap-overview

7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2