Skip to content

Instantly share code, notes, and snippets.

@tlinnet
Last active July 26, 2023 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlinnet/4196fd9c7aa43e37ea71e69bdc40a7dd to your computer and use it in GitHub Desktop.
Save tlinnet/4196fd9c7aa43e37ea71e69bdc40a7dd to your computer and use it in GitHub Desktop.
Configure SAP HANA 2.0, express edition on Ubuntu 22.04 LTS Jammy

Install SAP HANA 2.0, express edition on Ubuntu

In the guide Install SAP HANA 2.0, express edition on a Preconfigured Virtual Machine, this will be a VM running SUSE Linux Enterprise Server (SLES) for SAP Applications 12 SP2. This server needs a license subscription and has no access to software repository.

Instead we will follow the guide Install SAP HANA, express edition on a Native Linux Machine.

We only install server-only virtual machine pack.

  • The host machine needs minimum 8 GB RAM, 2 cores, and 120 GB Disk space (we will try with 30 GB).
  • Java JRE 8 64bit or higher for the SAP download manager. Java can installed from here adoptium, and configure JAVA_HOME.

Then Download SAP HANA, express edition via registration page.

  • Get the Windows DM and open HXEDownloadManager_win.exe

In the Download Manager window, we download Platform:Linux/x86-64, Image:Binary Installer, and download Getting Started + Server only installer, which downloads Getting_Started_HANAexpress_VM.pdf and hxe.tgz.

Install Ubuntu 22.04 LTS and configure network

Get the jammy Server install image

Setup machine in VBox

  • Machine -> New....
    • Name: kerb-hana.test.me.
    • ISO image: Point to the downloaded image ubuntu-22.04.2-live-server-amd64.iso
    • Click Next, which should be an unattendedly install
    • user vboxuserhana and PW changeMe1234!
    • Hostname: hana
    • Domain Name: test.me
    • Enable Guest editions.
  • Next to set Hardware
    • Give it 8192 MB RAM and 2 CPUs. Enable EFI. Give it 30 GB disk.
  • Install with all default. Keyboard layout should match your host system.
    • Name: Server Hana
    • Server Name: hana
    • username vboxuserhana and PW changeMe1234!
    • Install ssh, as copy-paste will not work into the terminal. A full GUI is needed for that or use SSH.
    • Dont install other snaps

Login with vboxuserhana and set fixed IP.

cd /etc/netplan
sudo nano 00-installer-config.yaml

It should look like this

network:
  version: 2
  ethernets:
    enp0s3:
      dhcp4: no
      addresses:
       - 10.0.2.23/24
      routes:
       - to: default
         via: 10.0.2.1
      routes:
        - to: default
          via: 192.168.1.1
sudo netplan try
sudo shutdown now

Then in VBox, in Settings change network to NAT Network : NatNetwork. Then in VBox, File -> Tools -> Network Manager -> NAT Networks -> Port Forwarding. Create rule

  • Name:SSH, Protocol:TCP, Host IP:127.0.0.1, Host Port:2522, Guest IP:10.0.2.23, Guest Port:22.

Start the VM again. Then SSH from your host: ssh -p 2522 vboxuserhana@127.0.0.1

Set DNS

nslookup ad1.test.me
cat /etc/resolv.conf
# Insert before the line search
sudo sed -i '/^nameserver 127.0.0.53/i nameserver 10.0.2.20' /etc/resolv.conf
cat /etc/resolv.conf´
nslookup ad1.test.me
nslookup add1.a.test.me
nslookup aw1.a.test.me

Install SAP HANA 2.0, express edition on Ubuntu

In the download folder with hxe.tgz, copy the file to the server:

scp -P 2522 hxe.tgz vboxuserhana@127.0.0.1:/home/vboxuserhana/hxe.tgz`

Then ssh -p 2522 vboxuserhana@127.0.0.1 and then we follow Install SAP HANA 2.0, express edition

# Fix HANA scripts are not compatible with dash shell. /bin/sh is a softlink to /usr/bin/dash. 
sudo mv /bin/sh /bin/sh.orig
sudo ln -s /bin/bash /bin/sh
# Install missing packages. # See which version installed of libstdc++6: 12.1
sudo apt install libltdl7 zip unzip libstdc++6
apt-cache policy libstdc++6
# We need to create the group sapsys with id 79
# Else you get error: Ensure that no permissions are changed by the umask when extracting or copying the folders.
# First verify if already exists
getent group sapsys
getent group 79
# Then we create the group and set it as primary group
sudo groupadd -g 79 sapsys
sudo usermod -a -G sapsys vboxuserhana
sudo usermod -g sapsys vboxuserhana
# Login again and check primary group
su vboxuserhana
id
# Unpack and install
mkdir hanainstall
mv hxe.tgz hanainstall
cd hanainstall
tar -xvzf hxe.tgz
# Fix issue pin to libstdc++6-6.2 net in setup_hxe.sh
sed -i 's/libstdc++6-6.2/libstdc++6/g' ./setup_hxe.sh
# Before install, check there is 12 GB free on /
# https://packetpushers.net/ubuntu-extend-your-default-lvm-space/
df -h # Look for /
sudo vgdisplay # Look for: Free  PE / Size
sudo lvdisplay # Look for LV Size
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo lvdisplay # Look for LV Size changed
df -h # Look for /
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
df -h # Look for /
# Then fix error:
# Command line is: update-rc.d -n sapinit defaults
# update-rc.d: error: unknown option
# https://answers.sap.com/questions/13045107/sap-hana-express-edition-failed-installation-in-ub.html
# https://blogs.sap.com/2018/07/21/how-to-install-sap-hana-express-edition-2.0-on-ubuntu-18.04-bionic-beaver/
# Ubuntu 16.04 LTS Xenial : https://manpages.ubuntu.com/manpages/xenial/man8/update-rc.d.8.html#options
# -n     Don't do anything, just show what we would do.
# Ubuntu 22.04 LTS Jammy  : https://manpages.ubuntu.com/manpages/jammy/man8/update-rc.d.8.html#options
# -n 
sudo cp /usr/sbin/update-rc.d /usr/sbin/update-rc.d.orig
sudo sed -i '/^        usage("unknown option");/i \        \if (/^-n$/) { next }' /usr/sbin/update-rc.d
# Then install. Take all defaults.
sudo ./setup_hxe.sh
# If any problems, try also
cd ./HANA_EXPRESS_20/DATA_UNITS/HDB_SERVER_LINUX_X86_64
sudo ./hdblcm --ignore=check_signature_file

This should have installed with options

SAP HANA System ID: HXE
Instance Number: 90
Local Host Worker Group: default
System Usage: development
Location of Data Volumes: /hana/shared/data/HXE
Location of Log Volumes: /hana/shared/log/HXE
Directory containing custom configurations: /home/vboxuserhana/hanainstall/HANA_EXPRESS_20/DATA_UNITS/HDB_SERVER_LINUX_X86_64/configurations/custom
Certificate Host Names: hana -> hana
System Administrator Home Directory: /usr/sap/HXE/home
System Administrator Login Shell: /bin/bash
System Administrator User ID: 1001
ID of User Group (sapsys): 79
Restart system after machine reboot?: Yes
Inter Service Communication Mode: ssl
Remote Execution: ssh
Use single master password for all users, created during installation: Yes
Database Isolation: low
Install Execution Mode: optimized
Installation Path: /hana/shared
Local Host Name: hana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment