Technical Articles
HANA 2.0 Running inside Docker
![]() |
Intro
When I was searching for any SAP HANA 2.0 inside container, the only thing I was able to find was about SAP HANA Express edition, and some articles on how to pull images from docker hub with express SAP HANA inside. Nothing about how to create your own image… So here is my try :).
Below we will prepare Dockerfile with SAP HANA 2.0 inside. I will try to explain the concept, so it will be possible to enhance it with your custom configs, sql etc.
I know that SAP on-premise solutions are quite monolithic and not supposed to be executed as microservices inside containers and all this stuff… However, putting SAP HANA inside can be a nice step for building up a distributed development landscape that can be started any amount of times in 5 minutes and than will be clean after work is completed.
ABAP Part can be found via this link
Technical overview
I will skip core things about Docker and how to get it in your system, as this you can find either through official docker guide: https://docs.docker.com/get-started/ or by using google.com :).
So, once you have your docker daemon installed and ready, we will start to create the Dockerfile.
To achieve our goal, we will combine several images:
- Base OS images that you can get from suse registry for example.
- Adjusted OS image – that will be a combination of SUSE base image + required packets and some pre-work for SAP HANA installation.
Such approach will give us some more flexibility, and also we will be able to spend less time on rebuild process.
Now several words about my environment:
- I recommend to use latest Docker packet so you can benefit from new features. Also try to use new linux kernel, since container executions are based on the kernel, means we can benefit from new features and hopefully will have less possible issues.
- For the Dockerfile creation I am using ATOM IDE with Docker and GiT plugins.
- On the host where we will run our docker daemon and containers we should allocate some space in the /var/lib/docker folder, since all images will be running from that place by default:
- I am running host that is based on SLES 15 SP1 with 64GB of memory a 4 vCPU, this is plenty enough. You can try to run it also on the laptop with Linux installed and 16GB of RAM.
Step 1: Building base SAP OS image
Base SLES image that is available via SUSE registry is not enough to install SAP HANA. It is not containing required packets, so we have to identify what is missing. The most easy way to get all dependencies and to avoid spending time on rebuilding process is:
- Run base SLES image
- Install missing packets
- Try to install SAP HANA inside container
- Fail and identify missing packets
- Install all packets
- Install SAP HANA
Create Dockerfile
– Create base layer with FROM instruction
FROM registry.suse.com/suse/sle15:15.1
– Put some meaningful comments with LABEL instruction
# Extra metadata
LABEL version="1.0"
LABEL description="Base SLES 15 SP1 SAP image"
– Create some directories inside image with RUN instruction
RUN mkdir -p /etc/zypp/repos.d \
&& mkdir -p /jail
– Add SLES repo URLs with another RUN layer. I am using my own repos, you should use yours :).
To identify URI that are assigned in your current SLES OS you can use the following command:
> zypper lr -u command
– We will combine all repos in one layer by using && key:
RUN zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-SAP-Applications/15-SP1/x86_64/product/ SLE-Module-SAP-Applications_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-SAP-Applications/15-SP1/x86_64/update/ SLE-Module-SAP-Applications_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Basesystem/15-SP1/x86_64/product/ SLE-Module-Basesystem_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Basesystem/15-SP1/x86_64/update/ SLE-Module-Basesystem_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Containers/15-SP1/x86_64/product/ SLE-Module-Containers_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Containers/15-SP1/x86_64/update/ SLE-Module-Containers_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Development-Tools/15-SP1/x86_64/product/ SLE-Module-Development-Tools_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Development-Tools/15-SP1/x86_64/update/ SLE-Module-Development-Tools_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Legacy/15-SP1/x86_64/product/ SLE-Module-Legacy_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Legacy/15-SP1/x86_64/update/ SLE-Module-Legacy_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Packagehub-Subpackages/15-SP1/x86_64/product/ SLE-Module-Packagehub-Subpackages_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Packagehub-Subpackages/15-SP1/x86_64/update/ SLE-Module-Packagehub-Subpackages_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Server-Applications/15-SP1/x86_64/product/ SLE-Module-Server-Applications_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Server-Applications/15-SP1/x86_64/update/ SLE-Module-Server-Applications_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-SLES/15-SP1/x86_64/product/ SLE-Product-SLES-15-SP1_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-SLES/15-SP1/x86_64/update/ SLE-Product-SLES-15-SP1_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-SLES_SAP/15-SP1/x86_64/product/ SLE-Product-SLES_SAP_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-SLES_SAP/15-SP1/x86_64/update/ SLE-Product-SLES_SAP_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Public-Cloud/15-SP1/x86_64/product/ SLE-Module-Public-Cloud_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Public-Cloud/15-SP1/x86_64/update/ SLE-Module-Public-Cloud_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Web-Scripting/15-SP1/x86_64/product/ SLE-Module-Web-Scripting_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Web-Scripting/15-SP1/x86_64/update/ SLE-Module-Web-Scripting_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-HA/15-SP1/x86_64/product/ SLE-Product-HA_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-HA/15-SP1/x86_64/update/ SLE-Product-HA_update
– And this is how final Dockerfile can looks like:
FROM registry.suse.com/suse/sle15:15.1
# Extra metadata
LABEL version="1.0"
LABEL description="Base SLES 15 SP1 SAP image"
# Create zypper repos and empty folder
RUN mkdir -p /etc/zypp/repos.d \
&& mkdir -p /jail
# Add repsystem from my repo server
RUN zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-SAP-Applications/15-SP1/x86_64/product/ SLE-Module-SAP-Applications_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-SAP-Applications/15-SP1/x86_64/update/ SLE-Module-SAP-Applications_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Basesystem/15-SP1/x86_64/product/ SLE-Module-Basesystem_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Basesystem/15-SP1/x86_64/update/ SLE-Module-Basesystem_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Containers/15-SP1/x86_64/product/ SLE-Module-Containers_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Containers/15-SP1/x86_64/update/ SLE-Module-Containers_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Development-Tools/15-SP1/x86_64/product/ SLE-Module-Development-Tools_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Development-Tools/15-SP1/x86_64/update/ SLE-Module-Development-Tools_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Legacy/15-SP1/x86_64/product/ SLE-Module-Legacy_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Legacy/15-SP1/x86_64/update/ SLE-Module-Legacy_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Packagehub-Subpackages/15-SP1/x86_64/product/ SLE-Module-Packagehub-Subpackages_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Packagehub-Subpackages/15-SP1/x86_64/update/ SLE-Module-Packagehub-Subpackages_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Server-Applications/15-SP1/x86_64/product/ SLE-Module-Server-Applications_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Server-Applications/15-SP1/x86_64/update/ SLE-Module-Server-Applications_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-SLES/15-SP1/x86_64/product/ SLE-Product-SLES-15-SP1_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-SLES/15-SP1/x86_64/update/ SLE-Product-SLES-15-SP1_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-SLES_SAP/15-SP1/x86_64/product/ SLE-Product-SLES_SAP_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-SLES_SAP/15-SP1/x86_64/update/ SLE-Product-SLES_SAP_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Public-Cloud/15-SP1/x86_64/product/ SLE-Module-Public-Cloud_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Public-Cloud/15-SP1/x86_64/update/ SLE-Module-Public-Cloud_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Web-Scripting/15-SP1/x86_64/product/ SLE-Module-Web-Scripting_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Web-Scripting/15-SP1/x86_64/update/ SLE-Module-Web-Scripting_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-HA/15-SP1/x86_64/product/ SLE-Product-HA_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-HA/15-SP1/x86_64/update/ SLE-Product-HA_update
# Update repos and install missing packages:
RUN update-ca-certificates && zypper ref -s && zypper update -y
Build Image and run the container
Once Dockerfile created, we can build our base image with:
> docker build -t base_os .
Now we can run our container and proceed with inside container operations:
> docker run -i –add-host=”saphost1.docker.gap.corp saphost1:172.17.0.2″ –ipc=host –privileged -t -h saphost1 base_os
Prepare SAP HANA media
Ok, container is working fine and you can play inside.Once it is stopped, all changes will be erased. In order to play with SAP HANA installation, we should
1. Download SAP HANA distribs
2. Adjust them – delete none used folders
3. Add new layer in our docker file with SAP HANA distrib inside.
…. After we’ve finished with SAP HANA distribs download, we can delete unused folders inside SAP HANA extracted archive. We need only files inside our root SAP HANA archive and 2 folders inside DATA:
Ok, greate! Now we should prepare SAP HANA for unattended installation, so we can put it in the image during build phase. Unattended installation how-to guide can be found here.
So now you should have the following things:
- Adjusted SAP HANA media
- SAP HANA config file – required for the unattended installation
- SAP HANA password file – required during unattended installation
Adjust Dockerfile
I will add additional COPY layer inside my Dockerfile in order to copy required files inside our container:
# Copy Installation files and HANA config
COPY /tools/ /jail/
I have SAP HANA media and config files inside my tools folder, so I want to copy host folder tools to the image folder jail.
Ok, now we are rebuilding our image with this new COPY layer. Once it is done, you can run it and find out that required files are inside:
Fine, we should try to execute SAP HANA installation in order to capture missing Linux packets (if there some). After we will identify all of them, we can adjust our Dockerfile.
Finalize Dockerfile
…. After several iterations, you will identify the list of required packets for SAP HANA installation, and now we can finalize our docker file by adding final RUN layer where will install all missing dependencies:
RUN zypper in --force-resolution -y -n -t pattern devel_basis \
&& zypper rm --force-resolution -y -n container-suseconnect \
&& zypper in --force-resolution -y -n bc \
&& zypper in --force-resolution -y -n chrony \
&& zypper in --force-resolution -y -n clamsap \
&& zypper in --force-resolution -y -n cryptctl \
&& zypper in --force-resolution -y -n expect \
&& zypper in --force-resolution -y -n libgtk-2_0-0 \
&& zypper in --force-resolution -y -n libicu60_2 \
&& zypper in --force-resolution -y -n libjpeg62 \
&& zypper in --force-resolution -y -n libpng12-0 \
&& zypper in --force-resolution -y -n libssh2-1 \
&& zypper in --force-resolution -y -n libyui-ncurses9 \
&& zypper in --force-resolution -y -n numactl \
&& zypper in --force-resolution -y -n patterns-sap-hana \
&& zypper in --force-resolution -y -n tcsh \
&& zypper in --force-resolution -y -n python3-six \
&& zypper in --force-resolution -y -n libpython3_6m1_0 \
&& zypper in --force-resolution -y -n saptune \
&& zypper in --force-resolution -y -n iputils
Ok, looks like all is inside, and now we can prepare our first base os image. Dockerfile will looks like this:
FROM registry.suse.com/suse/sle15:15.1
# Extra metadata Layer
LABEL version="1.0"
LABEL description="Base SLES 15 SP1 SAP image"
# Environmant Layer
ENV container docker \
TERM=xterm \
HOME=/root \
LC_CTYPE=en_US \
SHELL=/bin/bash
# Zypper and empty folder layer
RUN mkdir -p /etc/zypp/repos.d \
&& mkdir -p /jail
# Add repsystem from SAP repo server: https://reposerver.cloud.com/suse/SUSE
RUN zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-SAP-Applications/15-SP1/x86_64/product/ SLE-Module-SAP-Applications_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-SAP-Applications/15-SP1/x86_64/update/ SLE-Module-SAP-Applications_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Basesystem/15-SP1/x86_64/product/ SLE-Module-Basesystem_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Basesystem/15-SP1/x86_64/update/ SLE-Module-Basesystem_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Containers/15-SP1/x86_64/product/ SLE-Module-Containers_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Containers/15-SP1/x86_64/update/ SLE-Module-Containers_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Development-Tools/15-SP1/x86_64/product/ SLE-Module-Development-Tools_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Development-Tools/15-SP1/x86_64/update/ SLE-Module-Development-Tools_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Legacy/15-SP1/x86_64/product/ SLE-Module-Legacy_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Legacy/15-SP1/x86_64/update/ SLE-Module-Legacy_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Packagehub-Subpackages/15-SP1/x86_64/product/ SLE-Module-Packagehub-Subpackages_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Packagehub-Subpackages/15-SP1/x86_64/update/ SLE-Module-Packagehub-Subpackages_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Server-Applications/15-SP1/x86_64/product/ SLE-Module-Server-Applications_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Server-Applications/15-SP1/x86_64/update/ SLE-Module-Server-Applications_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-SLES/15-SP1/x86_64/product/ SLE-Product-SLES-15-SP1_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-SLES/15-SP1/x86_64/update/ SLE-Product-SLES-15-SP1_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-SLES_SAP/15-SP1/x86_64/product/ SLE-Product-SLES_SAP_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-SLES_SAP/15-SP1/x86_64/update/ SLE-Product-SLES_SAP_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Public-Cloud/15-SP1/x86_64/product/ SLE-Module-Public-Cloud_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Public-Cloud/15-SP1/x86_64/update/ SLE-Module-Public-Cloud_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Module-Web-Scripting/15-SP1/x86_64/product/ SLE-Module-Web-Scripting_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Module-Web-Scripting/15-SP1/x86_64/update/ SLE-Module-Web-Scripting_update \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Products/SLE-Product-HA/15-SP1/x86_64/product/ SLE-Product-HA_product \
&& zypper ar https://reposerver.cloud.com/suse/SUSE/Updates/SLE-Product-HA/15-SP1/x86_64/update/ SLE-Product-HA_update
# Update repos and install missing packages:
RUN zypper in --force-resolution -y -n -t pattern devel_basis \
&& zypper rm --force-resolution -y -n container-suseconnect \
&& zypper in --force-resolution -y -n bc \
&& zypper in --force-resolution -y -n chrony \
&& zypper in --force-resolution -y -n clamsap \
&& zypper in --force-resolution -y -n cryptctl \
&& zypper in --force-resolution -y -n expect \
&& zypper in --force-resolution -y -n libgtk-2_0-0 \
&& zypper in --force-resolution -y -n libicu60_2 \
&& zypper in --force-resolution -y -n libjpeg62 \
&& zypper in --force-resolution -y -n libpng12-0 \
&& zypper in --force-resolution -y -n libssh2-1 \
&& zypper in --force-resolution -y -n libyui-ncurses9 \
&& zypper in --force-resolution -y -n numactl \
&& zypper in --force-resolution -y -n patterns-sap-hana \
&& zypper in --force-resolution -y -n tcsh \
&& zypper in --force-resolution -y -n python3-six \
&& zypper in --force-resolution -y -n libpython3_6m1_0 \
&& zypper in --force-resolution -y -n saptune \
&& zypper in --force-resolution -y -n iputils
Ok, done, now you can build your base os image that we will use for the SAP HANA image creation.
docker build -t sap_sles .
I am using private docker repository – jFrog to store my images, so I will push created image there:
STEP 2: Building HANA_DB image
SAP HANA Docker file will be quite straightforward:
- We will use FROM layer with our base os image that we created on previous step
- We will create RUN layer with unattended SAP HANA installation.
Create Dockerfile
We will use one trick in the Dockerfile in order to bypass issue with hostname (by default, during build process, docker daemon will use dynamic hostname and this dynamic hostname will be used by SAP HANA installer. This we do not need). So we should pass hostname parameter on the same docker layer:
FROM mydocker.repo:8080/sap_sles:v2.0
# Some info regarding image
LABEL version="1.0" \
system.hostname="saphost1" \
system.HANA.sid="BFG"
# Create HOST environment
ENV HOSTNAME saphost1
# Copy Installation files and HANA config
COPY /tools/ /config/* /jail/
COPY /config/network/* /etc/
# HANA installation is doing hostname check, however during build process dynamic hostname is generated # by docker. In order to bypass this we will pipeline hostname creation in the same Docker layer. This will # be rewrited by docker during starting og the image.
RUN echo $(grep $(hostname) /etc/hosts | cut -f1) saphost1 >> /etc/hosts && cat /jail/configfile.xml | /jail/HANA20SP4/DATA_UNITS/HDB_SERVER_LINUX_X86_64/hdblcm --sid=BFG --read_password_from_stdin=xml --configfile=/jail/configfile.cfg -b
This is it. Now you can build your image.
> docker build -t sap_hana .
Run SAP HANA Docker image
Now we can run our image. In order to make it possible to connect to the SAP HANA from outside we should expose network ports. So our command will look like this:
docker run -i -d –rm -e “container=docker” –add-host=”saphost1.docker.gap.corp saphost1:172.17.0.2″ –ipc=host –privileged -t -h saphost1 -p 30100-30199:30100-30199 -p 50100-50199:50100-50199 -p 1128:1128 -p 1129:1129 sap_hana:latest
With this command we are starting out container and we are exposing ports (-p key). With such way we can connect with SAP HANA studio once this container will be started.
now we can connect to SAP HANA either via hdbsql inside container:
> hdbsql -n saphost1 -i 01 -d SystemDB -u SYSTEM -p yourpassword
Or with SAP HANA studio outside. When you will use SAP HANA studio you should use your host ip, the one where docker installed, not 172.17.0.2 as this one belong to docker network.
Great, we are done! Now you have HANA image that can be started in 2 – 3 minutes.
Afterwords
We did quite simple things in terms of docker. And much more things can be added inside that will simplify and automate other things. For example:
- You can create custom script that will create test users for SAP HANA and will install SAP HANA license
- You can automate SAP HANA start by putting start in the systemd in order to have your SAP HANA running once container is started
- You can think on using Jenkins to automate docker build process.
As next step I will think on creating SAP ABAP application part (maybe SAP S/4 HANA 1909) with abapGit or gCTS in the container, so we can get development infrastructure on demand with GiT as version control system, this will enable us with possibility to do ф parallel development in ABAP, and will move us slightly to the CI\CD :))
Hi Maxim Afonin
Very impressive post.
Thank you
Emmanuel
Excellent post, Maxim.
Kudos to you.
Thanks a lot Maxim for the excellent post.
Is this supported by SAP , for any further issues noticed after build using Kubernetes?
Also, please help if it is possible to adjust the HANA memory needs post build.
Many thanks in advance!!
Phani
Hello Phani.
- you can set memory limits during build procedure: you can create your custom config file specify it with custom_cfg parameter (reference to memory config SAP Note 1999997 - FAQ: SAP HANA Memory)
- you can build your own script that will adjust parameters after HANA was started
Docker container can be started with memory limits parameters. So you can run with several iterations reducing memory limit, until you find the minimum one.
Maxim, thank you very much!!
Right on time: My next toy after NW, HXE in Docker and K8s
Best regards
Mitch
Nice work! Hostname check is so annoying, I ended up creating my images with shell scripts rather than Dockerfiles to overcome it.
One note: rather than start systemd in the container, wwhich requires --privileged, you should use some startup program like tini or catatonit
PS: How much memory does this need at startup?
It was ~ 10 Gb for empty DB with SAP S/4 Foundation 1909 it was ~ 17GB.
I hope I will able to reduce this amount.
Dear Maxim,
An Afterword to the Afterwords 1 creating test users:
The hana-dev-cli
https://github.com/SAP-samples/hana-developer-cli-tool-example
or
This is nice one, Especially if it is wrapped into container, in order to enable classic container execution (start - run - destroy)
However, user creation is also possible with SAP Host agent. For example this query will create user in the hdbuser store and will assign required roles:
/usr/sap/hostctrl/exe/saphostctrl -dbname <SID>-SYSTEMDB -dbinstance HDB<instnr> -dbtype hdb -dbuser SYSTEM -dbpass <dbpassword> -function SetDatabaseProperty DBCredentials=SET -dboption User=SAPDBCTRL -dboption Password=<desiredPassword>
Cheers,
Max
Thank you Max,
Mass option of hana-cli is about +25 Users or as much as your system/container might bear.
You might apply SID, instr, dbpswd, ...to the mass creation syntax.
We might create containerGuest with 11 users and containerHome with 11 users for a virtual soccer tournament..... Kickoff!
Cheers, Mitch
Very nicely explained Afonin 🙂
Hello thank you for this post!.
I try to get misses packets for Suse, but the repository is not available.
Is there other repository?
Regards
Johan
Hi Maxim,
thanks a lot also from my side!
Could you please elaborate a little bit more on what is in the
/config/network/
folder you're using in your sap_hana Dockerfile?
BR
Kurt
Hello Kurt!
I have created hosts file that contains mapping ip <--> FQDN. HOwever this is not mandatory as we can pass this parameters during docker run command.
Hi Maxim.
Excellent post. appreciate it.
Kudos