Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Introduction

We will go through step by step hands-on scenario to build virtual appliance for SAP HANA on AWS in this hands-on. It includes how to install SAP HANA on AWS and we will go through the steps required to install and configure SAP HANA on AWS. I hope the information contained in this hands-on provide you basic idea about what AWS services are and how to configure SAP HANA on AWS environment.

The hands-on is composed of following posts:

  1. Prior knowledge

  2. EC2 instance creation

  3. EC2 instance configuration

  4. SAP HANA installation for the master

  5. Adding worker to SAP HANA landscape


This post handles fourth part of the hands-on.

We will try most steps in command line (awscli) but you should know that all tasks in this hands-on could be done on AWS console too.

4. SAP HANA installation - for Master


So far, we’ve created and configured EC2 instance. In SAP HANA’s point of view, EC2 instance will act as one Linux server. It’s the time to discuss the main topic, “SAP HANA installation”. In this post, we will handle the installation on the master only.

We will utilize AWS S3 service for uploading/downloading SAP HANA installation image files.

4.1. Prepare SAP HANA image files


EC2 instance has been created and storage (file systems) has been configured. Next, we will install SAP HANA on EC2 Instance.

You can follow the general steps for downloading SAP HANA installation images. SAPCAR needs to be downloaded in case SAP HANA installation image files are SAR compressed. SAPCAR is not necessary when those are RAR compressed because we already installed unrar.

Memo.

You can download SAPCAR from software download center (https://support.sap.com/en/my-support/software-downloads.html), Support Packages > Patches A - Z > Index S > SAPCAR.

Once you download required files in your laptop, you can upload these files onto EC2 instance’s /media directory by winscp (scp in Linux). But, S3 service from AWS is useful and it shows quite good uploading /downloading performance when used with awscli.

You can jump to "4.2. HANA installation - hdbldm" if you want to move installation image files via winscp (or scp) not via AWS S3 service.

4.1.1. Moving files to S3 bucket


We will try to use AWS S3 service for uploading and downloading SAP HANA installation image files to/from S3 bucket.

As the first step, you need to create S3 bucket for holding SAP HANA installation image files.
yourLinux:~ # aws s3api create-bucket --bucket mysaphanamedia --region ap-northeast-2 --acl private --create-bucket-configuration LocationConstraint=ap-northeast-2
yourLinux:~ # aws s3api list-buckets
{
"Owner": {
"ID": "a8c53aed20415a66f40bda187095d1b40e57377bebde324938470dda89e59742"
},
"Buckets": [
{
"CreationDate": "2018-06-22T03:49:27.000Z",
"Name": "mysaphanamedia"
}
]
}













Information Value
S3 bucket name S://mysaphanamedia


Memo.

In case you want to remove buckets, you can remove buckets with either of below commands.
yourLinux:~ # aws s3 rb s3://mysaphanamedia --force
yourLinux:~ # aws s3api delete-bucket --bucket mysaphanamedia --region ap-northeast-2

S3 bucket is created and you can upload SAP HANA installation image files onto the bucket, s3://mysaphanamedia. To do this in Windows, you need to follow below steps under the directory where SAP HANA installation image files are located (I assume all files were already downloaded from SAP software download center to your laptop).

aws configure” is required because it is the first time to connect to AWS services from your laptop. Access Key ID and Secret Access Key are the same as when you did “aws configure” in Linux.
C:\imageFiles> aws configure
AWS Access Key ID: <Your Access Key ID>
AWS Secret Access Key: <Your Secret Access Key>
Default region name: <Your region name>
Default output format [None]: <return>

Once “aws configure” is done, you can synchronize your current directory on laptop to S3 bucket.
C:\imageFiles> aws s3 sync ./ s3://mysaphanamedia
upload: .\SAPCAR to s3://mysaphanamedia/SAPCAR
Completed 61.7 MiB/11.8 GiB (10.2 MiB/s) with 4 file(s) remaining
……..

This command will synchronize all files under the current directory (“./”) to S3 bucket, “s3://mysaphanamedia”.

Memo.

aws s3 sync” command is for synchronizing the whole directory content to s3 bucket. If you want to upload files one by one, you can use “aws s3 cp”. You can list files on s3 bucket with “aws s3 ls” command.

4.1.2. Moving files from S3 bucket to EC2 instance


We will copy SAP HANA installation image files from S3 bucket to “/media” file system on EC2 instance.

Run “aws configure” from your EC2 instance. This step is required because it’s the first time for EC2 instance to use S3 service as a client.

You are on EC2 instance.
imdbmaster:~ # aws configure
AWS Access Key ID: <Your Access Key ID>
AWS Secret Access Key: <Your Secret Access Key>
Default region name [None]: <Your region name>
Default output format [None]: <return>

Run “aws s3 sync” to synchronize all SAP HANA installation image files from S3 bucket onto your EC2 instance.
imdbmaster:~ # cd /media
imdbmaster:~ # aws s3 sync s3://mysaphanamedia ./
download: s3://mysaphanamedia/SAPCAR to ./SAPCAR
………………..

If all steps go through without an issue, you will find all required files in “/media” directory.

4.2. HANA installation – hdblcm


At last, you have all files required to install SAP HANA. From now on, you can go forward to installing SAP HANA.

You can extract the compressed files with SAPCAR command (or unrar command in case those files are in RAR compression) and initiate HDBLCM (HANA Database Life Cycle Manager). It’s a normal SAP HANA installation.
imdbmaster:/media # chmod +x SAPCAR
imdbmaster:/media # ./SAPCAR -xf IMDB_SERVER20_024_2-80002031.SAR
imdbmaster:/media # cd SAP_HANA_DATABASE/
imdbmaster:/media/SAP_HANA_DATABASE # ./hdblcm

You can go forward single node installation.

I assume you know well about SAP HANA installation, so I don’t explain the steps in detail in this hands-on.

4.3. HANA configuration


Once you successfully install SAP HANA, you need a couple of configurations on SAP HANA. It’s also possible to configure SAP HANA based on other best practices.

Firstly, you need to edit two INI files, global.ini and daemon.ini.

imdbmaster:/ # su – tstadm

In /usr/sap/<SID>/SYS/global/hdb/custom/config/global.ini
[persistence]

basepath_shared = no

savepoint_interval_s = 300

basepath_databackup = /backup/data/<SID>

basepath_logbackup = /backup/log/<SID>

[communication]

listeninterface = .global

ssl = systempki

In /usr/sap/<SID>/HDB<instance number>/<hostname>/daemon.ini
[scriptserver]

instances = 1

tstadm@imdbmaster:/usr/sap/TST/home> hdbnsutil -reconfig --hostnameResolution=global

tstadm@imdbmaster:/usr/sap/TST/home> HDB stop

tstadm@imdbmaster:/usr/sap/TST/home> HDB start

I recommend you to check below SNOTEs about parameter recommendation. I hope you note that the recommendations in SAP HANA configuration keep improving and above recommendations would change or new recommendations come.

  • SAP Note 2600030 - Parameter Recommendations in SAP HANA Environments

  • SAP Note 2186744 - FAQ: SAP HANA Parameters


4.4. SAP HANA Studio connection


SAP HANA database has been created. You will connect to it from SAP HANA Studio. To make our consideration simple, we assumed that SAP HANA database server would be in public subnet. Therefore, no further considerations are required regarding NAT gateway configuration.

Memo.

When SAP HANA database server is in private subnet and you plan to isolate it from public access, further considerations are required, for example, NAT gateway and iptables (for port mapping, forwarding).

You can check the configuration of EC2 instance with “aws ec2 describe-instances” command as below to find public IP address on your EC2 instance:
yourLinux:~ # aws ec2 describe-instances --instance-id i-0a8eb78dbab3d9353
"NetworkInterfaceId": "eni-0e5aef69b3a2f525a",
"PrivateIpAddresses": [
{
"PrivateDnsName": "ip-172-31-128-21.ap-northeast-2.compute.internal",
"Association": {
"PublicIp": "52.78.39.220",
"PublicDnsName": "ec2-52-78-39-220.ap-northeast-2.compute.amazonaws.com",
"IpOwnerId": "786447197291"
},
"Primary": true,
"PrivateIpAddress": "172.31.128.21"
}
],

With the public IP address (eg, 52.78.39.220), you can add new system in SAP HANA Studio.



If connection fails, you can check …

  • If “InstanceState” is “running” and both “InstanceStatus” and “SystemStatus” are “passed”.



yourLinux:~ # aws ec2 describe-instance-status --instance-ids i-0a8eb78dbab3d9353



  • If HANA instance is started or not.

  • If necessary ports are enabled in your Security Group, eg.30015


4.5. Post-installation


This section handles post-installation actions. You need to follow below actions.

4.5.1. SAP HANA instance autostart setting.


This step is required when you want to start SAP HANA instance automatically when EC2 instance starts.

You need to edit “/usr/sap/<SID>/SYS/profile/<SID>_HDB<instance number>_<hostname>” file to modify “Autostart“ from 0 to 1:

Autostart = 1

Change /etc/init.d/sapinit for ensuring that autofs starts before SAP upon system reboot:
imdbmaster:~ # sed -i '/# Required-Start:/ c\# Required-Start: $network $syslog $remote_fs $time autofs' /etc/init.d/sapinit

“insserv” command is used to control the start and stop order of the services that are on a Linux system:
imdbmaster:~ # insserv sapinit
imdbmaster:~ # chkconfig sapinit on

Memo.

After insserv command, you can verify that “sapinit” is added to the startup list:

# chkconfig --list |grep sapinit

sapinit                   0:off 1:off 2:off 3:on   4:off 5:on   6:off

4.5.2. Install AWS Data provider.


For full support, we must enable built-in SAP monitors to retrieve information about configuration and resource utilization from the underlying AWS infrastructure.

The Amazon Web Services (AWS) Data Provider for SAP is a tool that collects performance-related data from AWS services. It makes this data available to SAP applications to help monitor and improve the performance of business transactions. The AWS Data Provider for SAP uses operating system, network, and storage data that is most relevant to the operation of the SAP infrastructure.

Refer to SNOTE 1656250 about SAP enhanced monitoring.

To install AWS Data provider, you need to follow below commands:
imdbmaster:~ # mkdir /root/install/
imdbmaster:~ # cd /root/install/
imdbmaster:~ # aws s3 cp s3://aws-data-provider/bin/aws-agent_install.sh ./
imdbmaster:~ # chmod +x aws-agent_install.sh
imdbmaster:~ # ./aws-agent_install.sh

We’ve installed SAP HANA on AWS for the master. What do you think installing SAP HANA for the worker for scale-out? It's time to go to https://blogs.sap.com/2018/07/04/hands-on-configure-sap-hana-on-aws-part5/.