A different take on SAP HANA Express and Docker co...
Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
In this blog post we will learn to build a highly scalable application using SAP HANA and Docker Swarm cluster. This is first post in this series and more to come.
What will be the end result of our project?
We will able to deploy and scale an application on Docker Swarm cluster, the overall solution architecture would look like below:
Image icons courtesy to draw.io, docker.com, nginx.com
What software components we need for this project?
SAP HANA Express
HANA Client libraries
Docker
Opencart
Nginx
a few tools
How about hardware?
Hosts 2 or more
RAM 16GB minimum for one host others 4GB+
CPU/Cores 4 or more cores per host
HDD/SDD > 500GB
You can follow this development in two different ways, keep reading in the blog or watch the below video.
Image icons courtesy to draw.io, docker.com, nginx.com
Since you have chosen to follow here let's get started, first we will clone my git repository which contains all the scripts required for our project.
I have compiled multiple installation steps into these scripts, however, the installation process might differ in the future, so I have included links.txt file with the original links for installations.
Now we have everything in place, let's install docker container environment by running docker install script.
Note: These scripts are applicable to debian based linux distros for other you need to adjustaccordingly.
The script will install docker and relevant application packages and at the end system will reboot.
Next, HANA Express installation, if you prefer to follow official documentation please visit hub.docker.com and search for HANA Express(Database Server), The original installation guide is in great details, my script is based on it. so, all credit goes to SAP!
We need to update kernel parameters for HANA Express in /etc/sysctl.conf file, copy content from update_kernel_params.txt except /etc/sysctl.conf line, save file and perform reboot or run the following command.
#update kernel paramters with following command or reboot
sudo sysctl -p
We need to perform one more activity before we deploy HANA Express container, i.e maintain master password in a file or web URL and pass that as an argument to docker container deploy script.
I tried to follow file approach but it did not work for me, I have included index.json file which contains master password, feel free to update it for your own password choice.
We will use this file through a web URL by running python webserver module. Open another session and change directory to hanaexpress_install and run following command to start webserver.
#run web server in current directory
python3 -m http.server
That's it we are ready to deploy our HANA Express docker container, we will do that by running deploy script.
#deploy HXE container
./deployHanaExpress.sh
This script will launch docker container in detached mode, so we will not see installation log on console, we can follow container log by using following docker command.
We need ODBC driver for HDB, which is available to download on SAP HANA Express page please refere HANA Express installation guide. The opencart expects ODBC drivers under "/var/www/html/hdbclient/libodbcHDB.so" so make sure to copy client library accordingly.
We should have working ODBC connection by now, you can verify that by running dbHANA.php.
#change to install directory
cd hanaexpress_install
#run test
php dbHANA.php
We need two more changes before we lunch opencart installation, we need to adjust apache root directory and directory permissions.
The opencart installation process will prompt for any missing PHP extensions or configurations. We also need to supply HDB credentials along with HDB port as show in below picture.
Once installation is complete we will see installation complete message as show below:
This concludes installation of docker container environment, deployment of HANA Express on Docker and Opencart installation on SAP HANA database.
Finally, we will have a functional opencart on HANA Express.
Image icons courtesy to opencart.com
This was first part of overall solution to deploy opencart on Docker Swarm cluster, if you enjoyed this article, please keep following my profile for new contents.
In next article, we will containerize our opencart for docker swarm deployment.