Host setup for IBM Db2 systems - Databases for SAP applications on AWS

Host setup for IBM Db2 systems

This section walks you through an example host setup for deploying an IBM Db2 system on AWS using Amazon FSx for NetApp ONTAP as the primary storage solution.

Architecture diagram

The following diagram presents the setup for IBM Db2 system with FSx for ONTAP.


          SAP System on IBM Db2 database

Linux kernel parameters

Create a file named 91-NetApp-DB2.conf with the following configurations in the /etc/sysctl.d directory.

net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.tcp_rmem = 4096 131072 16777216 net.ipv4.tcp_wmem = 4096 16384 16777216 net.core.netdev_max_backlog = 300000 net.ipv4.tcp_slow_start_after_idle=0 net.ipv4.tcp_no_metrics_save = 1 net.ipv4.tcp_moderate_rcvbuf = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_sack = 1

Increase the max sessions slots for NFSv4 to 180.

echo options nfs max_session_slots=180 > /etc/modprobe.d/nfsclient.conf

Set sunrpc.tcp_slot_table_entries = 128 in /etc/sysctl.conf.

You must reboot your instance for the kernel parameters and NFS settings to take effect.

Network File System (NFS)

Network File System (NFS) version 4 and higher requires user authentication. You can authenticate with Lightweight Directory Access Protocol (LDAP) server or local user accounts.

If you are using local user accounts, the NFSv4 domain must be set to the same value on all Linux servers and SVMs. Set the following parameters in the /etc/idmapd.conf file on the Linux hosts.

Domain = <domain name> Nobody-User = root Nobody-Group = root
Note

You must restart the nfs-idmapd.service service after making changes to the domain.

Create mount points

Create the following mount points on your Amazon EC2 instance.

mkdir -p /sapmnt mkdir -p /usr/sap mkdir -p /db2/db2<dbsid> mkdir -p /db2/<DBSID> mkdir -p /db2/<DBSID>/sapdata1 mkdir -p /db2/<DBSID>/sapdata<x> mkdir -p /db2/<DBSID>/saptmp1 mkdir -p /db2/<DBSID>/saptmp<x> mkdir -p /db2/<DBSID>/db2dump mkdir -p /db2/<DBSID>/log_dir mkdir -p /db2/<DBSID>/log_arch mkdir -p /db2backup

Mount file systems

The created file systems must be mounted as NFS file systems on Amazon EC2. The following table is an example recommendation of NFS options for different IBM Db2 file systems.

File systems NFS mount options
Common NFS version NFS transfer size nconnect
Db2 data rw,bg,hard,timeo=600,noatime, vers=4,minorversion=1,lock, rsize=262144,wsize=262144, nconnect=8
Db2 log rw,bg,hard,timeo=600,noatime, vers=4,minorversion=1,lock, rsize=262144,wsize=262144, nconnect=2
Backup rw,bg,hard,timeo=600,noatime, vers=4,minorversion=1,lock, rsize=262144,wsize=262144, nconnect=2
Db2 binary rw,bg,hard,timeo=600,noatime, vers=4,minorversion=1,lock, rsize=262144,wsize=262144, nconnect=2
  • Changes to the nconnect parameter take effect only if the NFS file system is unmounted and mounted again.

  • Client systems must have unique host names when accessing FSx for ONTAP. If there are systems with the same name, the second system may not be able to access FSx for ONTAP.

  • For RHEL operating system, the nconnect parameter is supported only on RHEL 8.3 or higher.

Example

Add the following lines to /etc/fstab to preserve mounted file systems during an instance reboot. You can then run mount -a to mount the NFS file systems.

<SVM NFSIP>:/<SID>-sapmnt /sapmnt nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<SID>-usrsap /usr/sap nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-db2dbsid /db2/db2<dbsid> nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-dbpath /db2/<DBSID> nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-sapdata1 /db2/<DBSID>/sapdata1 nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=8 <SVM NFSIP>:/<DBSID>-sapdata<x> /db2/<DBSID>/sapdata<x> nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=8 <SVM NFSIP>:/<DBSID>-saptmp1 /db2/<DBSID>/saptmp1 nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-saptmp<x> /db2/<DBSID>/saptmp<x> nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-logdir /db2/<DBSID>/log_dir nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-logarch /db2/<DBSID>/log_arch nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-db2dump /db2/<DBSID>/db2dump nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2 <SVM NFSIP>:/<DBSID>-backup /db2backup nfs rw,bg,hard,timeo=600,noatime,vers=4,minorversion=1,lock,rsize=262144,wsize=262144,nconnect=2