【SUSE Linux自动调整系统参数】安装升级saptune并配置saptune
目录
saptune安装升级方式二:手工下载saptune文件并安装升级
背景
使用SUSE Linux操作系统安装SAP软件之前,需要调整系统参数。手工调整系统参数容易出错或遗漏,为了方便,我们通常安装升级saptune软件包并配置saptune来实现自动调整系统参数。
本次实验环境是SUSE Linux Enterprise Server 12 SP5:
cat /etc/*-release
SAPTEST:~ # cat /etc/*-release
SUSE Linux Enterprise Server 12 (x86_64)
VERSION = 12
PATCHLEVEL = 5
# This file is deprecated and will be removed in a future service pack or release.
# Please check /etc/os-release for details about this release.
NAME="SLES"
VERSION="12-SP5"
VERSION_ID="12.5"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP5"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles_sap:12:sp5"
安装升级saptune有两种方式,方式一是通过配置zypper源并使用zypper命令来安装升级saptune至最新版本,方式二是手工下载最新版本的saptune文件并安装升级saptune版本。
安装升级saptune
saptune安装升级方式一:通过zypper命令安装升级
zypper install saptune (安装saptune)
SAPTEST:~ # zypper install saptune
Loading repository data...
Reading installed packages...
'saptune' is already installed.
No update candidate for 'saptune-3.0.2-4.10.1.x86_64'. The highest available version is already installed.
Resolving package dependencies...
Nothing to do.
zypper update saptune (升级saptune)
SAPTEST:~ # zypper update saptune
Loading repository data...
Reading installed packages...
No update candidate for 'saptune-3.0.2-4.10.1.x86_64'. The highest available version is already installed.
Resolving package dependencies...
Nothing to do.
以上结果是因为未配置zypper源,故通过zyyper命令无法安装升级saptune版本。
saptune安装升级方式二:手工下载saptune文件并安装升级
手工下载saptune文件之前,需要先确认当前saptune包的版本:
rpm -qa|grep saptune
SAPTEST:/sapcd/SUSE12SP5 # rpm -qa|grep saptune
saptune-2.0.1-3.3.1.x86_64
yast2-saptune-1.3-3.4.2.noarch
通过网址 https://scc.suse.com登录SUSE Customer Center并下载saptune包:
将下载的saptune包放入目录/sapcd/SUSE12SP5底下:
SAPTEST:/sapcd/SUSE12SP5 # ls -l
total 218760
-rwxrwxrwx 1 root root 1025963 Mar 21 16:29 saptune-3.0.2-4.10.1.x86_64.rpm
安装saptune
rpm -ivh saptune*
升级saptune:
rpm -Uvh saptune*
SAPTEST:/sapcd/SUSE12SP5 # rpm -Uvh saptune*
Preparing... ################################# [100%]
Updating / installing...
1:saptune-3.0.2-4.10.1 ################################# [ 50%]
Updating /etc/sysconfig/saptune...
detected enabled Solution 'S4HANA-APPSERVER', checking for new or deleted Notes
### appending the new Note '2993054' from Solution 'S4HANA-APPSERVER' to 'NOTE_APPLY_ORDER' in '/etc/sysconfig/saptune'
### appending the new Note '1656250' from Solution 'S4HANA-APPSERVER' to 'NOTE_APPLY_ORDER' in '/etc/sysconfig/saptune'
### appending the new Note '900929' from Solution 'S4HANA-APPSERVER' to 'NOTE_APPLY_ORDER' in '/etc/sysconfig/saptune'
Cleaning up / removing...
2:saptune-2.0.1-3.3.1 ################################# [100%]
Removed symlink /etc/systemd/system/multi-user.target.wants/tuned.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/saptune.service to /usr/lib/systemd/system/saptune.service.
查看saptune版本:
rpm -qa|grep saptune
SAPTEST:~ # rpm -qa|grep saptune
saptune-3.0.2-4.10.1.x86_64
yast2-saptune-1.3-3.4.2.noarch
启动saptune
saptune不同版本的启动方式不一样,saptune 2.0和saptune 3.0的启动方式如下:
saptune daemon start (saptune 2.0版本)
SAPTEST:~ # saptune daemon start
Starting daemon (tuned.service), this may take several seconds...
Daemon (tuned.service) has been enabled and started.
saptune service takeover (saptune 3.0版本)
SAPTEST:~ # saptune service takeover
NOTICE: Starting 'saptune.service', this may take some time...
NOTICE: Service 'tuned.service' disabled and stopped
NOTICE: Service 'saptune.service' has been enabled and started.
查看saptune的服务状态:
saptune daemon status (saptune 2.0版本)
SAPTEST:~ # saptune daemon status
Daemon (tuned.service) is running.
The system has been tuned for the following solutions and notes:
S4HANA-APPSERVER
saptunestatus (saptune 3.0版本)
SAPTEST:~ # saptune status
saptune.service: enabled/active
saptune package: '3.0.2'
configured version: '3'
configured Solution: S4HANA-APPSERVER
configured Notes:
order of enabled Notes: 941735 1771258 1984787 2993054 1656250 900929
applied Notes: 1656250 1771258 1984787 2993054 900929 941735
staging: disabled
staging area:
sapconf.service: disabled/inactive
tuned.service: disabled/inactive
system state: degraded
The system state is NOT ok.
Please call '/usr/sbin/saptune_check' to get guidance to resolve the issues!
saptune健康检查(针对saptune 3.0版本):
saptune_check
SAPTEST:~ # saptune_check
This is saptune_check v0.2.2.
It verifies if saptune is set up correctly.
Please keep in mind:
- This tool does not check, if the tuning itself works correctly.
- Follow the hints from top to down to minimize side effects.
Checking saptune
================
[NOTE] saptune package has version 3.0.2
[WARN] System is in status "degraded". Failed services are: postfix.service -> Check the cause and reset the state with 'systemctl reset-failed'!
[ OK ] configured saptune version is 3
[ OK ] sapconf.service is inactive
[ OK ] sapconf.service is disabled
[ OK ] saptune.service is active
[ OK ] saptune.service is enabled
[NOTE] tuned profile is 'missing'
[ OK ] tuned.service is inactive
[ OK ] tuned.service is disabled
1 warning(s) have been found.
Saptune should work properly, but better investigate!
修复saptune问题(针对saptune 3.0版本):
systemctl reset-failed
SAPTEST:~ # systemctl reset-failed
重新检查saptune健康(针对saptune 3.0版本):
saptune_check
SAPTEST:~ # saptune_check
This is saptune_check v0.2.2.
It verifies if saptune is set up correctly.
Please keep in mind:
- This tool does not check, if the tuning itself works correctly.
- Follow the hints from top to down to minimize side effects.
Checking saptune
================
[NOTE] saptune package has version 3.0.2
[ OK ] System is in status "running"
[ OK ] configured saptune version is 3
[ OK ] sapconf.service is inactive
[ OK ] sapconf.service is disabled
[ OK ] saptune.service is active
[ OK ] saptune.service is enabled
[NOTE] tuned profile is 'missing'
[ OK ] tuned.service is inactive
[ OK ] tuned.service is disabled
Saptune is set up correctly.
配置saptune
查看可用的notes:
saptune note list
SAPTEST:~ # saptune note list
All notes (+ denotes manually enabled notes, * denotes notes enabled by solutions, - denotes notes enabled by solutions but reverted manually later, O denotes override file exists for note, C denotes custom note):
1410736 TCP/IP: setting keepalive interval
Version 6 from 13.01.2020
1557506 Linux paging improvements
Version 14 from 10.08.2015
1656250 SAP on AWS: Support prerequisites - only Linux Operating System IO Recommendations
Version 31 from 02.12.2020
1680803 Sybase - SAP Adaptive Server Enterprise
Version 26 from 11.06.2021
1771258 Linux: User and system resource limits
Version 6 from 05.11.2021
1805750 SYB: Usage of HugePages on Linux Systems with Sybase ASE
Version 6 from 14.11.2017
1980196 Setting Linux Kernel Parameter /proc/sys/vm/max_map_count on SAP HANA Systems
Version 7 from 18.10.2017
1984787 SUSE LINUX Enterprise Server 12: Installation notes
Version 36 from 06.08.2020
2161991 VMware vSphere configuration guidelines
Version 26 from 02.12.2019
2205917 SAP HANA DB: Recommended OS settings for SLES 12 / SLES for SAP Applications 12
Version 61 from 12.11.2020
2382421 Optimizing the Network Configuration on HANA- and OS-Level
Version 38 from 29.06.2020
2534844 Indexserver Crash During Startup due to Insufficient Shared Memory Segment
Version 12 from 15.11.2017
2993054 Recommended settings for SAP systems on Linux running in Azure virtual machines
Version 2 from 12.07.2021
3024346 Linux Kernel Settings for NetApp NFS
Version 3 from 17.02.2021
900929 Linux: STORAGE_PARAMETERS_WRONG_SET and 'mmap() failed'
Version 7 from 31.07.2017
941735 SAP memory management system for 64-bit Linux systems
Version 11 from 04.05.2018
SAP_BOBJ operating system tuning for SAP Business OBJects (BOBJ)
Version 0 from 10.03.2017
查看可用的solutions:
saptune solution list
SAPTEST:~ # saptune solution list
All solutions (* denotes enabled solution, O denotes override file exists for solution, C denotes custom solutions, D denotes deprecated solutions):
BOBJ - 941735 1771258 1984787 SAP_BOBJ 2993054 1656250
HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
D MAXDB - 941735 1771258 1984787
NETWEAVER - 941735 1771258 1984787 2993054 1656250 900929
NETWEAVER+HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
S4HANA-APP+DB - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
S4HANA-APPSERVER - 941735 1771258 1984787 2993054 1656250 900929
S4HANA-DBSERVER - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
SAP-ASE - 941735 1410736 1680803 1771258 1984787 2993054 1656250
判断该操作系统上将安装什么SAP产品,如果要安装SAP BO,就选择solution BOBJ;如果要安装HANA,就选择solution HANA;如果要安装NETWEAVER,就选择solution NETWEAVER。。。以此类推,根据实际场景选择合适的solution。
本文以安装NETWEAVER为例,故选择solution NETWEAVER。
查看solution NETWEAVER包含哪些调整内容:
saptune solution simulate NETWEAVER
SAPTEST:~ # saptune solution simulate NETWEAVER
WARNING: Parameter 'kernel.shmmax' additional defined in the following sysctl config file /boot/sysctl.conf-4.12.14-122.113-default(0xffffffffffffffff).
WARNING: Parameter 'kernel.shmall' additional defined in the following sysctl config file /boot/sysctl.conf-4.12.14-122.113-default(0x0fffffffffffff00).
NOTICE: block device related section settings detected: Traversing all block devices can take a considerable amount of time.
If you run `saptune solution apply NETWEAVER`, the following changes will be applied to your system:
Parameter | Value set | Value expected | Override | Comment
-----------------------------+-----------------------------+-----------------------------+-----------+--------------
LIMIT_@dba_hard_nofile | @dba hard nofile 1048576 | @dba hard nofile 1048576 | |
LIMIT_@dba_soft_nofile | @dba soft nofile 1048576 | @dba soft nofile 1048576 | |
LIMIT_@sapsys_hard_nofile | @sapsys hard nofile 1048576 | @sapsys hard nofile 1048576 | |
LIMIT_@sapsys_soft_nofile | @sapsys soft nofile 1048576 | @sapsys soft nofile 1048576 | |
LIMIT_@sdba_hard_nofile | @sdba hard nofile 1048576 | @sdba hard nofile 1048576 | |
LIMIT_@sdba_soft_nofile | @sdba soft nofile 1048576 | @sdba soft nofile 1048576 | |
IO_SCHEDULER_sda | noop | noop | |
IO_SCHEDULER_sdb | noop | noop | |
IO_SCHEDULER_sdc | noop | noop | |
UserTasksMax | infinity | infinity | |
systemd:sysstat.service | start, disable | start | |
systemd:uuidd.socket | start, enable | start | |
vm.dirty_background_bytes | 314572800 | 314572800 | |
vm.dirty_bytes | 629145600 | 629145600 | |
vm.max_map_count | 2147483647 | 2147483647 | |
ShmFileSystemSizeMB | 39462 | 39462 | |
VSZ_TMPFS_PERCENT | 75 | 75 | | [15]
kernel.shmall | 1152921504606846720 | 1152921504606846720 | | [11]
kernel.shmmax | 18446744073709551615 | 18446744073709551615 | | [11]
[11] parameter is additional defined in sysctl config file /boot/sysctl.conf-4.12.14-122.113-default(0x0fffffffffffff00)
[11] parameter is additional defined in sysctl config file /boot/sysctl.conf-4.12.14-122.113-default(0xffffffffffffffff)
[15] the parameter is only used to calculate the size of tmpfs (/dev/shm)
配置solution NETWEAVER:
saptune solution apply NETWEAVER
SAPTEST:~ # saptune solution apply NETWEAVER
WARNING: Parameter 'kernel.shmmax' additional defined in the following sysctl config file /boot/sysctl.conf-4.12.14-122.113-default(0xffffffffffffffff).
WARNING: Parameter 'kernel.shmall' additional defined in the following sysctl config file /boot/sysctl.conf-4.12.14-122.113-default(0x0fffffffffffff00).
NOTICE: block device related section settings detected: Traversing all block devices can take a considerable amount of time.
All tuning options for the SAP solution have been applied successfully.
查看当前solutions的配置情况:
saptune solution list
SAPTEST:~ # saptune solution list
All solutions (* denotes enabled solution, O denotes override file exists for solution, C denotes custom solutions, D denotes deprecated solutions):
BOBJ - 941735 1771258 1984787 SAP_BOBJ 2993054 1656250
HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
D MAXDB - 941735 1771258 1984787
* NETWEAVER - 941735 1771258 1984787 2993054 1656250 900929
NETWEAVER+HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
S4HANA-APP+DB - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
S4HANA-APPSERVER - 941735 1771258 1984787 2993054 1656250 900929
S4HANA-DBSERVER - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
SAP-ASE - 941735 1410736 1680803 1771258 1984787 2993054 1656250
查看当前notes的配置情况:
saptune note list
SAPTEST:~ # saptune note list
All notes (+ denotes manually enabled notes, * denotes notes enabled by solutions, - denotes notes enabled by solutions but reverted manually later, O denotes override file exists for note, C denotes custom note):
1410736 TCP/IP: setting keepalive interval
Version 6 from 13.01.2020
1557506 Linux paging improvements
Version 14 from 10.08.2015
* 1656250 SAP on AWS: Support prerequisites - only Linux Operating System IO Recommendations
Version 31 from 02.12.2020
1680803 Sybase - SAP Adaptive Server Enterprise
Version 26 from 11.06.2021
* 1771258 Linux: User and system resource limits
Version 6 from 05.11.2021
1805750 SYB: Usage of HugePages on Linux Systems with Sybase ASE
Version 6 from 14.11.2017
1980196 Setting Linux Kernel Parameter /proc/sys/vm/max_map_count on SAP HANA Systems
Version 7 from 18.10.2017
* 1984787 SUSE LINUX Enterprise Server 12: Installation notes
Version 36 from 06.08.2020
2161991 VMware vSphere configuration guidelines
Version 26 from 02.12.2019
2205917 SAP HANA DB: Recommended OS settings for SLES 12 / SLES for SAP Applications 12
Version 61 from 12.11.2020
2382421 Optimizing the Network Configuration on HANA- and OS-Level
Version 38 from 29.06.2020
2534844 Indexserver Crash During Startup due to Insufficient Shared Memory Segment
Version 12 from 15.11.2017
* 2993054 Recommended settings for SAP systems on Linux running in Azure virtual machines
Version 2 from 12.07.2021
3024346 Linux Kernel Settings for NetApp NFS
Version 3 from 17.02.2021
* 900929 Linux: STORAGE_PARAMETERS_WRONG_SET and 'mmap() failed'
Version 7 from 31.07.2017
* 941735 SAP memory management system for 64-bit Linux systems
Version 11 from 04.05.2018
SAP_BOBJ operating system tuning for SAP Business OBJects (BOBJ)
Version 0 from 10.03.2017
current order of enabled notes is: 941735 1771258 1984787 2993054 1656250 900929
重新启动saptune服务:
saptune daemon start (saptune 2.0版本)
SAPTEST:~ # saptune daemon start
Starting daemon (tuned.service), this may take several seconds...
Daemon (tuned.service) has been enabled and started.
saptune service takeover (saptune 3.0版本)
SAPTEST:~ # saptune service takeover
NOTICE: Starting 'saptune.service', this may take some time...
NOTICE: Service 'tuned.service' disabled and stopped
NOTICE: Service 'saptune.service' has been enabled and started.
查看saptune的服务状态:
saptune daemon status (saptune 2.0版本)
SAPTEST:~ # saptune daemon status
Daemon (tuned.service) is running.
The system has been tuned for the following solutions and notes:
NETWEAVER
saptunestatus (saptune 3.0版本)
SAPTEST:~ # saptune status
saptune.service: enabled/active
saptune package: '3.0.2'
configured version: '3'
configured Solution: NETWEAVER
configured Notes:
order of enabled Notes: 941735 1771258 1984787 2993054 1656250 900929
applied Notes: 1656250 1771258 1984787 2993054 900929 941735
staging: disabled
staging area:
sapconf.service: disabled/inactive
tuned.service: disabled/inactive
system state: running
查看saptune配置文件/etc/sysconfig/saptune:
cat /etc/sysconfig/saptune
SAPTEST:~ # cat /etc/sysconfig/saptune
## Path: SAP/System Tuning/General
## Description: Global settings for saptune - the comprehensive optimisation management utility for SAP solutions
## ServiceRestart: saptune
## Type: string
## Default: ""
#
# When saptune is activated, apply optimisations for these SAP solutions.
# The value is a list of solution names, separated by spaces.
# Run "saptune solution list" to get a comprehensive list of solution names.
TUNE_FOR_SOLUTIONS="NETWEAVER"
## Type: string
## Default: ""
#
# When saptune is activated, apply tuning for these SAP notes in addition to those
# already recommended by the above list of SAP solutions.
# The value is a list of note numbers, separated by spaces.
# Run "saptune note list" to get a comprehensive list of note numbers.
TUNE_FOR_NOTES=""
## Type: string
## Default: ""
#
# When saptune is activated, apply tuning for the notes in exactly the below
# order
# The value is a list of note numbers, separated by spaces.
NOTE_APPLY_ORDER="941735 1771258 1984787 2993054 1656250 900929"
## Type: string
## Default: "3"
#
# Version of saptune
SAPTUNE_VERSION="3"
## Type: boolean
## Default: "false"
#
# Enable or disable staging of saptune internal Notes
# Disabled by default. To enable use 'saptune staging enable'
STAGING="false"
移除某个saptune solution
如果要移除saptune的某个已配置的solution(以S4HANA-APPSERVER为例),移除之前solution配置情况如下:
saptune solution list
SAPTEST:~ # saptune solution list
All solutions (* denotes enabled solution, O denotes override file exists for solution, C denotes custom solutions, D denotes deprecated solutions):
BOBJ - 941735 1771258 1984787 SAP_BOBJ 2993054 1656250
HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
D MAXDB - 941735 1771258 1984787
NETWEAVER - 941735 1771258 1984787 2993054 1656250 900929
NETWEAVER+HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
S4HANA-APP+DB - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
* S4HANA-APPSERVER - 941735 1771258 1984787 2993054 1656250 900929
S4HANA-DBSERVER - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
SAP-ASE - 941735 1410736 1680803 1771258 1984787 2993054 1656250
移除solution配置的命令如下:
saptune solution revert S4HANA-APPSERVER
SAPTEST:~ # saptune solution revert S4HANA-APPSERVER
Parameters tuned by the notes referred by the SAP solution have been successfully reverted.
查看当前solutions的配置情况:
saptune solution list
SAPTEST:~ # saptune solution list
All solutions (* denotes enabled solution, O denotes override file exists for solution, C denotes custom solutions, D denotes deprecated solutions):
BOBJ - 941735 1771258 1984787 SAP_BOBJ 2993054 1656250
HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
D MAXDB - 941735 1771258 1984787
NETWEAVER - 941735 1771258 1984787 2993054 1656250 900929
NETWEAVER+HANA - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
S4HANA-APP+DB - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
S4HANA-APPSERVER - 941735 1771258 1984787 2993054 1656250 900929
S4HANA-DBSERVER - 941735 1771258 1980196 1984787 2205917 2382421 2534844 2993054 1656250
SAP-ASE - 941735 1410736 1680803 1771258 1984787 2993054 1656250
查看saptune日志
不同版本的saptune的日志路径不一定,具体如下:
/var/log/tuned/tuned.log (saptune 2.0版本)
/var/log/saptune/saptune.log (saptune 3.0版本)
参考
参考SAP note 1275776 - Linux: Preparing SLES for SAP environments配置SUSE Linux操作系统(包含saptune)。
文章来自于网络,如果侵犯了您的权益,请联系站长删除!