Configure SLES 12/15 for SAP
Important
In the following steps, you need to update several configuration files. We recommend taking a backup of the files before you modify them. This will help you to revert to the previous configuration if needed.
-
After your instance is up and running, connect to the instance by using Secure Shell (SSH) and the key pair that you used to launch the instance.
Note
Depending on your network and security settings, you might have to first connect by using SSH to a bastion host before accessing your SAP HANA instance, or you might have to add IP addresses or ports to the security group to allow SSH access.
-
Switch to root user.
Alternatively, you can use
sudoto execute the following commands as ec2-user. -
Set a hostname and fully qualified domain name (FQDN) for your instance by executing the
hostnamectlcommand and updating the/etc/hostnamefile.hostnamectl set-hostname --static <your_hostname> echo <your_hostname.example.com> > /etc/hostname
Open a new session to verify the hostname change.
-
Ensure that the
DHCLIENT_SET_HOSTNAMEparameter is set to no to prevent DHCP from changing the hostname during restart.grep DHCLIENT_SET_HOSTNAME /etc/sysconfig/network/dhcp -
Set the
preserve_hostnameparameter to true to ensure your hostname is preserved during restart.sed -i '/preserve_hostname/ c\preserve_hostname: true' /etc/cloud/cloud.cfg -
Add an entry to the
/etc/hostsfile with the new hostname and IP address.<ip_address> <hostname.example.com> <hostname>
-
If you are using a BYOS SLES for SAP image, register your instance with SUSE. Ensure that your subscription is for SLES for SAP.
SUSEConnect -r <Your_Registration_Code> SUSEConnect -s
-
Ensure that the following packages are installed:
systemd,tuned,saptune,libgcc_s1,libstdc++6,cpupower,autofs,nvme-cli,libssh2-1,libopenssl1_0_0You can use the
rpmcommand to check whether a package is installed.rpm -qi <package_name>You can then use the zypper install command to install the missing packages.
zypper install <package_name>Note
If you are importing your own SLES image, additional packages might be required to ensure that your instance is optimally setup. For the latest information, refer to the Package List section in the SLES for SAP Application Configuration Guide for SAP HANA, which is attached to SAP OSS Note 1944799
-
Ensure that your instance is running on a kernel version that is recommended in SAP OSS Note 2205917
or 2684254 depending on your version. If needed, update your system to meet the minimum kernel version. You can check the version of the kernel and other packages by using the following command: rpm -qi kernel* -
Start
saptune daemonand use the following command to set it to automatically start when the system reboots.saptune daemon start -
Check whether the
force_latencyparameter is set in thesaptuneconfiguration file.grep force_latency /usr/lib/tuned/saptune/tuned.confIf the parameter is set, skip the next step and proceed with activating the HANA profile with
saptune. -
Update the
saptune HANAprofile according to SAP OSS Note 2205917, and then run the following commands to create a custom profile for SAP HANA. This step is not required if the force_latencyparameter is already set.mkdir /etc/tuned/saptune cp /usr/lib/tuned/saptune/tuned.conf /etc/tuned/saptune/tuned.conf sed -i "/\[cpu\]/ a force_latency=70" /etc/tuned/saptune/tuned.conf sed -i "s/script.sh/\/usr\/lib\/tuned\/saptune\/script.sh/" -
Switch the
tunedprofile to HANA and verify that all settings are configured appropriately.saptune solution apply HANA saptune solution verify HANA -
Configure and start the Network Time Protocol (NTP) service. You can adjust the NTP server pool based on your requirements; for example:
Note
Remove any existing invalid NTP server pools from
/etc/ntp.confbefore adding the following.echo "server 0.pool.ntp.org" >> /etc/ntp.conf echo "server 1.pool.ntp.org" >> /etc/ntp.conf echo "server 2.pool.ntp.org" >> /etc/ntp.conf echo "server 3.pool.ntp.org" >> /etc/ntp.conf systemctl enable ntpd.service systemctl start ntpd.serviceTip
Instead of connecting to the global NTP server pool, you can connect to your internal NTP server if needed. Or you can use Amazon Time Sync Service to keep your system time in sync.
-
Set the clocksource to
tscby updating thecurrent_clocksourcefile and the GRUB2 boot loader.echo "tsc" > /sys/devices/system/clocksource/*/current_clocksource cp /etc/default/grub /etc/default/grub.backup sed -i '/GRUB_CMDLINE_LINUX/ s|"| clocksource=tsc"|2' /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg -
Reboot your system for the changes to take effect.
-
Continue with storage configuration for SAP HANA.