SAP Netweaver Evaluation (Test Drive) install on Ubuntu 9.04 / Debian

There is a SAP SDN blog entry from Dec 2006 by one Piers Harding for the Netweaver test drive of 2004S on Ubuntu 6.10. This page outlines the extra steps that I found myself executing to get 2004S working on Ubuntu 9.04 in August 2009.

The first step is obviously to download the installation software from the SDN download area (or request the DVD). The software can be downloaded in 7 CD sized lumps. Don't be fooled however. Whist the lumps are CD sized '.iso' files, they are not suitable to be cut onto a CD (the checksums fail). You need to concatenate all 7 files into one large 4 GB file and cut this to DVD (cat N4S_TestDrive_MaxDB.iso_Part_a* > N4S_TestDrive_MaxDB.iso).

The installation guide from SAP is the index.html file in the root directory of this DVD. This has become slightly outdated but the broad thrust remains unchanged.

Prerequisites

First of all you need a 64-bit Linux installation (SAP no longer 'does' server software for 32-bit op systems). This also means you need a 64-bit processor.

The SAP installation instructions say the install has been tested on SuSE Linux 10; SLES 9; SLES 10; Red Hat Enterprise Linux 4. As an individual without the luxury of commercial support, my Linux of choice these days is Ubuntu.

New 64 Bit Linux Partition

Given the occasionally patchy support for 64-bit desktop applications, my main desktop instance is 32-bit Ubuntu. This meant I had to create a new partition on my hard drive using the Ubuntu Live CD partition manager and then install the 64-bit version of the operating system. Note that you are 'recommended' to have a min 4GB swap partition and at least 20GB (I would say 25-30GB - read on for why) on the main 64-bit parition.

When setting up your host name: keep it short. Less than 10 characters. If, when _N4S_01 is added to the end, it is longer than 20 chars, your system won't start. It should also not have any domain: so mycomputer.mydomain.com needs to become mycomputer. You can use the hostname command to check.

Beyond a 64-bit processor & Linux operating system, the installation requirements are:

  • 1GB of Memory (2GB recommended) plus about a 4GB swap partition
  • 1GB of tmpfs
  • 20GB free disk space for server
  • 2GB for frontend (SAPGUI)

Once installed and active, the operating system and server uses 1.1GB of memory so, whist it may be possible to install with 1GB, the results may not be worth the effort. I installed 2GB memory in my 4 year old Compaq desktop (AMD64 Athlon 3000+) and had no major problems with resources on installation but performance is far from scintillating. Its is currently installed on a Quad core AMD with 4GB of memory and performance is much improved.

A default install of Ubuntu only gave me about 1GB of swap space. This means I had to run the Ubunutu Live CD and get active with the partition manager again. This is a time consuming process of shrinking and expanding partitions and took over an hour of disk churning. Note that I had to issue a 'sudo swapoff' command from a command line to deactivate the swap partitions before 'gparted' would play ball.

"tmpfs" is a temprorary file system. This uses memory and swap space rather than main hard disk to speed up data access. The tmpfs is normally linked to device /dev/shm and the link can be viewed using the command 'mount'.  If there are no tmpfs entries against /dev/shm you will need to add a record to /etc/fstab (see Piers' blog).

Check that the bin & sbin directories are in your path ("echo $PATH"). This will not be a problem if you've just installed the op system.

SAPGUI & 64 Bit Op System?

Now I have to say that I've not managed to get a GUI working on 64-bit Ubuntu - I've not tried very hard and others have managed it. Given the op system is Linux, you would have to use PlatinGUI (Platform independent GUI - formerly Java GUI) but SAP has not to my knowledge released a 64-bit version of PlatinGUI. The trick is to ensure that the JRE is a 32 bit JRE running on a 64 bit op system against a 32 bit PlatinGUI. Attempting to run the 32 bit version (with 64 bit Java) runs into trouble when it tries to call the graphics libraries with the message "Wrong ELF Class". You can also connect to the server from an external PC/laptop like I do.

Special version of IBM Java

You now have to download and install the SAP approved version of IBM's Java. The normal JDK from Sun will not do. SAP Note 1172419 outlines how to get hold of the JDK. You have to register with IBM and use the authentication code on the SAP note to gain access to the JDK. There are two versions. One is an RPM but as Ubuntu is based on Debian Linux, RPMs don't work directly (you could try using 'alien' to convert to the .rpm into a .debi if you're brave). The other is a compressed tar ball. This is what I used. Once uncompressed (tar -zxf <filename>) you need to create a symbolic link (sudo ln -s <your IBM JDK dir top dir> /usr/lib/java) from wherever you've placed the JDK to /usr/lib/java because this is where all the SAP scripts go looking for it by default.

So your system has the right hardware, has a 64-bit Linux operating system, has a suitable hostname without domain, is set up correctly in /etc/hosts (see SAP index.html), has 1GB tmpfs and has the IBM JDK on /usr/lib/java. You're ready to start the install!

DVD Trouble

The next problem that I encountered (I probably did something wrong!) was that the install.sh script on the DVD had permissions "r--r--r--". That is to say it did not have permissions to be executed. To avoid the hassle of playing around with DVDs and permissions, I copied the 4+GB DVD contents to the hard drive and installed from there (hence the wisdom of having 25-30GB of hard disk space) after updating the permissions to '555'.

On executing install.sh I got a number of errors like:

  • err_message[0]=Ok: not found
  • err_message[1]=Invalid Arguments.: not found

and

  • Syntax error: Bad substitution

It turns out that the install script, install.sh, uses the shell 'sh' which is not available in Ubuntu Linux. In his blog, Piers set up a link from the /bin/sh to /bin/bash and then set it back after running the script. Having the files on the hard drive, I just edited the first line of install.sh from "#!/bin/sh" to "#!/bin/bash".

The install script also encounters trouble when creating the default users in the maxdb database. The users are set up in a kind of quick look-up record known as an 'xuser' which is manipulated using a program of the same name in the sapdb/programs/bin directory. This program needs a C++ runtime which is not present by in the vanilla Ubuntu install. Make sure you have installed the appropriate C++ runtime using the command 'sudo apt-get install libstdc++5'.

Install Script Output

On execution of install.sh I got the following output:

 

#========================================== 
# 
# Installing SAP NetWeaver 7.0 -  TestDrive 
# 
#========================================== 
 
add user n4sadm
unpacking adm_env.tar.bz2
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
add user sdb
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
add user sqdn4s
unpacking sqd_env.tar.bz2
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
unpacking /usr/local/sapdisc/server/TAR/x86_64/SAPDB_I.tar.bz2
unpacking /usr/local/sapdisc/server/TAR/x86_64/SAPDB_II.tar.bz2
unpacking /usr/local/sapdisc/server/TAR/x86_64/SAPDB_III.tar.bz2
unpacking /usr/local/sapdisc/server/TAR/x86_64/SAPN4S.tar.bz2
Update the necessary information in sysctl.conf:
kernel.shmmax = 23136829430
kernel.shmall = 5242880
kernel.msgmni = 1024
fs.file-max = 32768
kernel.sem = 1250 256000 100 1024
/home/n4sadm/S99_n4shost.sh: 9: err_message[1]=No free IP Address found using the following list : 192.168.155.1 192.168.155.2 172.16.168.1 10.168.155.1: not found
grep: option requires an argument -- e
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Found interface: eth0 . Alias is eth0:0
ifconfig eth0:0 192.168.155.1 up
Ok

Install Issues

This is not a successful install. There are a couple of points in the install script that fail with the bash shell.

Stray chars in /etc/hosts

It seems it does not have a grep '-e' option (looking at the script its more like an 'echo -e' that gets caught up in a grep statement. Hence the advice towards the end of the output above about grep. This means that a record added to the end of the /etc/hosts file has a stray '-e'. You will have to edit '/etc/hosts' and remove the first two characters from the record (note your IP address may be different):

-e 192.168.155.1    n4shost

Missing/Incomplete Virtual Host

This record was written whilst attempting to create a "virtual host". That is a hostname (n4shost) which can be called but has no physical manifestation.  The set up for this on Ubuntu is not the same as that for the SuSE/Red Hat system. The script that does this, S99_n4shost.sh, is placed by the installation script in the home directory of the user n4sadm. You can tell if it worked by calling the command "netstat -ei". There will probably be a data set returned for eth0 (main ethernet network card) and lo (dummy loopback adapter). If there is also a set for eth0:0 then the script has worked. If there is no eth0:0 then the script has not worked and you need to explicity run it.

To set up the virtual host so that it will be available on reboot you will need to update your /etc/network/interfaces file (using sudo). Your file will start looking something like:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address <your IP.>
netmask 255.255.255.0 (or your netmask from 'netstat -ie')
gateway 192.168.1.1 (or your network gateway IP)

You will need to add the lines...

auto eth0:0
iface eth0:0 inet static
address 192.168.155.1 <or the virtual host IP address (same as /etc/hosts file)>
netmask 255.255.255.0

On reboot (or restart networking using "sudo /etc/init.d/networking restart"), the 'netstat -ie' should now include eth0:0 and you should be able to ping n4shost.

User n4sadm path

When starting SAP you have to be logged in as Linux user "n4sadm". It is worthwhile adding the following to the .bashrc file of n4sadm so that SAP scripts can be easily run: "export PATH=$PATH:/usr/sap/N4S/SYS/exe/run:/sapdb/programs/bin"

DB xuser

Next check that the xuser records were set up correctly. If you get 60 lines of output when you issue the command "/sapdb/programs/bin/xuser list" as n4sadm then all is well. If not then there are 4 lines in install.sh which are intended to create these user records but which have failed. Issue the command "grep xuser install.sh" to find the four lines and then manually execute the core of the commands in quotes (as n4sadm). Here are the 4 commands

  • /sapdb/programs/bin/xuser -U DEFAULT -u sapn4s,sapn4sadm -d N4S -n n4shost -S SAPR3 -t 0 -I 0 set
  • /sapdb/programs/bin/xuser -U c -u control,sapn4sadm -d N4S -n n4shost -S SAPR3 -t 0 -I 0 set
  • /sapdb/programs/bin/xuser -U c_J2EE -u control,sapn4sadm -d N4S -n n4shost -S SAPR3 -t 0 -I 0 set
  • /sapdb/programs/bin/xuser -U w -u superdba,sapn4sadm -d N4S -n n4shost -S SAPR3 -t 0 -I 0 set

This sets up the four required xuser records which are "c", "c_J2EE", DEFAULT and "w". This problem manifests itself with an unhelpful log entry on startup compaining that xuser "c" cannot be found.

Missing Environment Variables

If at this point you run the "startsap n4shost" command (as user n4sadm) you will probably have errors regarding (a) the availablity of "libsapu16.so" or (b) "SAPSYSTEMNAME unknown" returned. To move forward you need to set up three environment variables. You can do this in your terminal shell session (for a one-off) or by adding them to .bashrc file in the home directory of n4sadm (and restarting your terminal session).

  • export LD_LIBRARY_PATH=/sapdb/programs/lib:/usr/sap/N4S/SYS/exe/run
  • export SAPSYSTEMNAME=N4S
  • export dbms_type=ada

Now you can run "startsap n4shost" and see how it goes.

Licenses

Note that licenses are now handled exclusively through SAPGUI (transaction SLICENSE) and any mention of applying a license using the command line 'saplicense' application should be ignored because the license supplied will not work (you can still use "saplicense -get" to get the hardware key). If you are trying to follow the index.html instructions there is no need to start the db independently (though its useful as a test) nor is there a need to get an RPM (not that you would get one or be able to use one on a debian based system).

SAPGUI "Problems"

Once "startsap n4shost" appears to work you can attempt to connect with SAPGUI. Note the system number is 01 (NOT 00 even though port 3200 is available first). On the front end computer you will probably get a connection pop-up box with the phrase 'Waiting for response' (windows) or 'connecting' (PlatinGUI) that appears to hang. This means that all is not well on the server. To see what the problem is you will need to examine the log files in the /usr/sap/N4S/SCS00/work and /usr/sap/N4S/DVEBMGS01/work directory in detail. Start with the SCS00 directory: it has to be available first. There are many large log files so checking them will take some time. Don't expect it to be speedy.


It may take alot of effort to get the system working but once you do, you get a tremendous surge of satisfaction - and you have a working Netweaver system to play around with all the new toys.


Good Luck!


Previous page: SAP and Unicode