HANA Cockpit on Docker Container
HANA cockpit is a mandatory HANA DB administration tool to be used going forward in all organizations. And every company will have an additional task to implement HANA cockpit to administrate HANA instances.
So thinking about simplifying HANA cockpit implementation with minimal effort and cost, some idea came up in my mind and i would like to share with you all what i have achieved.
Have imagined and achieved the implementation via Docker Container.
Build a docker image with automated HANA cockpit installation using my GitHub repository and create a HANA cockpit docker image to run HANA cockpit containers in one go.
Memory: 24GB Minimum
CPU: 4 Minimum
Host OS: Any OS which can run docker engine
Docker engine version 19.0+
- Download the latest HANA cockpit installer from SAP support website. The file name will look like “SAPHANACOCKPIT11_11-70002299.SAR”. Also download SAPCAR for extracting the .SAR file.
- Install git to your windows/mac desktop or any other Linux machine where docker engine is up and running. Please refer this link for Git installation steps. If you don’t have a running Docker engine installed please refer to the link on how to install Docker for your windows/mac/Linux.
- Next clone the GitHub repository to a local directory using a Linux terminal or windows PowerShell “git clone https://github.com/girid333/hckptoncont.git”
#>git clone https://github.com/girid333/hckptoncont.git
- A folder with name “hckptoncont” will be created.
- Perform “cd hckptoncont” and you can see Dockerfile and a folder with name sapdownloads inside hckptoncont folder.
- Extract the downloaded HANA cockpit .SAR file into sapdownloads folder (ex:- SAPCAR -xvf SAPHANACOCKPIT11_11-70002299.SAR -R …/hckptoncont/sapdownloads)
SAPCAR -xvf SAPHANACOCKPIT11_11-70002299.SAR -R .../hckptoncont/sapdownloads
- From hckptoncont folder execute “docker build -t hanackpt:2.0 .”
#>docker build -t hanackpt:2.0 .
- Wait until build is over with image name “hanackpt:2.0“, then the image with HANA cockpit installed is ready for use. (it may take upto 4-6 hours approximately based on the hardware)
- Next we can run a docker container using our built image “docker run -p 8000:8000 -p 443:443 -p 3300-3399:3300-3399 -p 3200-3299:3200-3299 -p 51020-51040:51020-51040 -p 39015:39015 -p 39032:39032 -h hckptn01 –name hckptn1 -it hanackpt:2.0 /bin/bash”
#>docker run -p 8000:8000 -p 443:443 -p 3300-3399:3300-3399 -p 3200-3299:3200-3299 -p 51020-51040:51020-51040 -p 39015:39015 -p 39032:39032 -h hckptn01 --name hckptn1 -it hanackpt:2.0 /bin/bash
- Once container is up and running with above command it will login to container guest shell. From there switch to user h4cadm with “su – h4cadm”
#hckpnt01>su - h4cadm
- Now start HANA database with command “HDB start” wait untill HANA gets started. (First time HANA startup may fail without any reason, wait for 15 mins and perform graceful stop “HDB stop“. Once all process stopped, then start HANA DB again, it will start.)
- Once HANA is up and running check “HDB info“for the HANA process status and wait for 15-20 mins for XS apps to get started.
- Then we can Launch SAP HANA cockpit manager by opening the url from browser https://hckptn01:51029 (or with actual port that gets displayed during build) , use XSA_ADMIN as user and the password (can be found in the hana install config-file under sapdownloads of git clone) for login. Note:- Need to add host entry for hckptn01 with docker host ipaddress from where url is called.
- We have to setup user roles during first login then we can add resource for HANA cockpit administration. (Even we can add the same HANA cockpit DB for example)
- Once required HANA DB resource is added then Launch SAP HANA cockpit administration launchpad by opening url in browser https://hckptn01:51027 (or the port that gets displayed during build)
!!!! Kudos enjoy !!!!!
Additional Instructions for advanced users
If you want to modify hostname, password, SID and instance number based on your needs then you should to adjust the values in Docker file from the main folder and h4c_config file from inside sapdownloads folder by searching existing value and replace it with your desired values.
Once you are done using HANA cockpit and Docker, just remember to stop the HANA database gracefully with “HDB stop” command and exit the container.
Next time you want to continue just start the container with “docker start -i hckptn1” and start HANA with h4cadm using command “HDB start”.
#>docker start -i hckptn1
…and check in HANA logs if there is any startup issue.
Will do more research on the containers topic and stay tuned for more exiting results.