There are times when it is desirable to run LDAS on a stand-alone machine instead of over a distributed network. One such example is the convenience of running LDAS jobs on a laptop. The following instructions describe how to build, install and run LDAS on a stand-alone Linux machine.
Due to the development nature of the software, at any given time the released versions of LDAS, LAL, and LAL Wrapper may not be compatible with each other or with the required tools in LDCG. This may require retrieving the software from the CVS repository instead of from a release distribution. This document does not attempt to describe the steps necessary to retreive and build any software from a CVS repository. The instructions mentioned in this document regarding software building only describe building from a release distribution. Consult the corresponding web site for information on retreiving and building software from a CVS repository.
This document is written from the viewpoint of installing and building all the software from scratch, starting with the operating system. If you already have a computer with the correct version of the OS installed, or you already have a current installation of the LDCG tools, take caution when skipping the instructions that don't apply.
Start the RedHat installation, choose Custom Install and install ALL the packages (Everything). After the install is complete, follow RedHat's instructions on upgrading the kernel to the version indicated in the Requirements section. Install any dependencies required by the rpm utility when upgrading the kernel.
To prevent conflicts with the version of LAM installed with the LDCG tools, uninstall the LAM rpm package installed by RedHat:
Note: Some of the above instructions may have already been performed by the RedHat installation.
Login as root and execute the following commands to set up the necessary user accounts.
Assign a password to each new user.
In the root user home account, create a file named cshrc. A working sample is available here. Copy it into the home directory of each user, renaming it to .cshrc.
The following adds search users for mpi/wrapper jobs. The example below creates 16 search user accounts (search01 - search16). Adjust the value of the max variable to your specific needs.
In order to remotely view the HTML log files generated by the LDAS APIs, a web server must be configured. By default, the RedHat installation does NOT start a web server. To configure a web server, login as root and perform the following commands. From now on, a web server will be started at boot time.
To monitor the API log files, enter a URI like http://machine.domain.suffix/ldaslogs/ into your favorite web browser. To view the LDAS documentation, use a URI like http://machine.domain.suffix/ldasdoc/.
The following steps are simplified from a more general document on installing DB2. That document is written in the context of a distributed/networked LDAS installation. It includes instructions for Solaris systems and for migrating from a DB2 7.2 installation. Be aware that some of the information there may not apply to a stand-alone environment.
Unless otherwise specified, all the following steps must be performed as root.
Depending on how you obtained the DB2 software will determine where the installation files are located. If you received the software on CD-ROM, you will need to mount it on the stand-alone system. (Placing it in the CD-ROM tray and running a command like mount /mnt/cdrom will usually do the trick). Make sure the CD-ROM includes "DB2 Universal Database Enterprise Server Edition" and is for the Linux operating system. If you downloaded the software from IBM's web-site, you will need to extract the archive somewhere on the local filesystem (the root user home directory is as good a place as any).
Change to the top-level directory of the DB2 installation files, which were prepared in the previous step. Type ./db2_install to start the installer script. When the installer prompts for a product code, enter DB2.ESE. When the installation completes, run the following command to install the license file.
You can now safely unmount or remove the installation files.
Download FixPak 5 from IBM's FTP server. Run the following commands from the root user home directory to extract the archive and install the FixPak. After the update completes, you can safely remove the extracted files.
Modify the kernel parameters by adding the following lines to /etc/sysctl.conf:
Run the following command to apply the new settings:
An instance is a single DB2 database manager running under a specific Unix username. Each instance may contain one or more databases. Perform the following command to create an instance for user ldasdb:
It is no longer necessary to be logged in as root. Perform the following commands as user ldasdb:
Log in as ldasdb and run the following command to create a sample database. This can take a few minutes to process. There is no completion message; when the shell prompt returns, the process is complete.
Enter the following commands to connect to the sample database, retrieve a list of all the employees that work in department 20, and reset the database connection.
The query above should return the following information:
After you have verified the installation, remove the sample database.
In order to build and run successfully, LDAS relies on various third-party software packages. To build these packages, login as user install. Follow the instructions on building the software packages used by LDAS.
Two additional packages must be built in order to run wrapperAPI jobs in LDAS. The DB2 include files and libraries must also be copied to the LDCG directory.
To build LDAS, login as user install. Follow the instructions on retrieving the LDAS source code and view the build options for building LDAS. Before you begin the build process, it is a good idea to shutdown any currently running LDAS system. Also, unstow any previously installed LDAS software and rename the installation directory if you are rebuilding the same version. If this is the first time you are building LDAS on this machine, you can skip the following example.
To build and install the LDAS source code, perform the following commands.
Note: The LDAS installation no longer supports changing the prefix at install time by specifying the prefix= option on the make install command line. LDAS will always be installed in the subdirectory stow_pkgs/ldas-1.14.0 relative to the value given to the --prefix= option specified on the build_ldas command line.
The following commands are condensed from a more detailed document on creating LDAS databases. That document is written in the context of a distributed/networked LDAS installation. Some of the information may not apply to a stand-alone environment. To create an LDAS database, perform the following commands as user ldasdb. Replace any occurrence of ldas_tst with your choice of a database name.
To configure LDAS for stand-alone operation, perform the following commands as user ldas.
To link the database to LDAS, perform the following commands. The dbDsnames utility will display a dialog box where you provide the passwords for the database users. This will create the file LDASdsnames.ini which contains the encoded passwords.
Examine the LDASdsnames.ini file and verify that it contains the proper list of available databases. Remove any references to a database you do not wish to expose to the LDAS system.
Modify each of the following resource files accordingly.
/ldas_outgoing/LDASapi.rsc
/ldas_outgoing/diskcacheAPI/LDASdiskcache.rsc
/ldas_outgoing/mpiAPI/LDASmpi.rsc
/ldas_outgoing/cntlmonAPI/LDAScntlmon.rsc
/ldas_outgoing/cntlmonAPI/LDASdb2utils.rsc
LDAS uses an ssh-agent to authenticate the communication between APIs, and when running wrapper jobs in the search user accounts. To configure SSH for the ldas account, run the following commands as user ldas. Accept the default name and path for the file in which to save the key when prompted by ssh-keygen (/usr1/ldas/.ssh/id_rsa). For security reasons, it is important to provide a non-blank passphrase when prompted by ssh-keygen. Remember the passphrase as you will need it when starting LDAS.
To complete the SSH configuration, perform a 'loopback' ssh connection to the stand-alone machine.
If a message like the following is displayed, answer 'yes' at the prompt. This will add the hostname to the ~/.ssh/known_hosts file. This message, which can interfere with LDAS communications, will not be displayed in the future.
The authenticity of host 'xxxx (123.456.789.00)' can't be establihed.
DSA key fingerprint is 0a:1b:2c:3d:4e:5f:6a:7b:8c:9d:ae:bf:ca:db:ec:fd.
Are you sure you want to continue connecting (yes/no)?
Continue to hit the <Enter> key until the shell prompt comes back. (Disregard all the password prompts.)
To configure SSH for the search users, the public key of the ldas account must be added to the authorized_keys file of each search user. Login as the root user and perform the following commands. Adjust the value of the max variable to match what was used when creating the search user accounts above (in the User Accounts section).
To start the LDAS system, perform the following command as user ldas. The MGRKEY is a password key which the managerAPI will use to authenticate commands (like shutting down LDAS, or restarting APIs). Provide any alpha-numeric string for this key.
The runLDAS command will try to connect to an already running ssh-agent. Otherwise, it will start a new ssh-agent and will prompt you for the passphrase you provided during ssh configuration.
While LDAS is starting, it writes log information to two sets of files, which can be monitored. The first set is the api.log files found in /ldas_outgoing/apiAPI directories. These files are the stdout and stderr of the APIs. Make sure there are no error messages in any of the files.
The second set is the LDASapi.log.html and APIstatus.html files found in /ldas_outgoing/logs. These files can be viewed with any Web browser. (If the http server was configured correctly above, these log files can also be viewed remotely.) They contain continuing information about the APIs and the jobs that are running. They should be monitored on a regular basis.
General information about configuring/starting LDAS is available in another document. Be aware that the information in that document is for running LDAS in a distributed/networked environment. Some of the information may not apply in a stand-alone environment.
Telnet to the managerAPI's emergency port on the stand-alone machine. The emergency port is two ports higher than the value of BASEPORT in the LDASapi.rsc file. For example, if BASEPORT is set to 12000, telnet to port 12002. Then type the following command at the telnet prompt. MGRKEY is the key you provided on the command line when starting LDAS; username and password are the name and password of a control user included in the control_group list specified in the /ldas_outgoing/LDASapi.rsc file.