Wednesday 9 October 2013

HOWTO: script WebSphere AS 8.5.5 internet install

This post describes how to perform a scripted install of a WebSphere Application Server (WAS) development environment from the internet. This is adequate if you want automated installation that will be repeated infrequently. Prior knowledge of WAS, Eclipse and Linux is assumed.

IBM has at least three offerings for basic Java EE development:

  • WAS for Developers - the full-fat commercial WAS server
  • Liberty Profile - a lightweight, developer-friendly server
  • Community Edition - a blue-washed Apache Geronimo

The scripts described here install the first two options with IDE tooling and Java 7. Eclipse Juno is the latest release with this level of WDT support.

Formally, the following are installed:

  • IBM WebSphere Application Server for Developers 8.5.5.0
  • IBM WebSphere SDK Java Technology Edition 7.0.4.1
  • IBM WebSphere Application Server Liberty for Developers 8.5.5.0
  • IBM WebSphere SDK Java Technology Edition Version 7.0 for Liberty 7.0.4.1
  • Eclipse IDE for Java EE Developers (Juno Sr2; Eclipse 4.2)
  • WebSphere Application Server V8.5 Liberty Profile Tools
  • WebSphere Application Server V8.5 Tools

OS and configuration

I chose CentOS 6.4 32-bit as the platform as it is nearly identical to a supported Red Hat version.

I installed the OS onto VMWare Player 6.0.0 build-1295980 using CentOS-6.4-i386-LiveCD.iso. I left the OS packages as-is with the exception of adding support for the VMWare Tools. Command:

su
yum groupinstall 'Development Tools'

Files

The following files are used to perform the install:

All should be placed in the same directory.

agent.installer.linux.gtk.x86_1.6.2000.20130301_2248.zip is the IBM Installation Manager (IBMIM) and can be downloaded via the WASdev downloads page. Choose the HTTP download option to login to the IBM site with your IBM ID and locate the file.

masterpw.txt should contain an arbitrary password string of your own devising.

The other files are listed below or you can download them using the links.

Note: these scripts will not work with DEVELOPERSILAN.agent.installer.linux.gtk.x86.zip.

Installing

The provided scripts install the applications without the need for root access.

The install script can be invoked in the form:

./was_net_install.sh  youribmid@example.com  yourpassword

Scripts

install_was.xml is an IBMIM response file for silent installs:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE agent-input [
<!ENTITY home "USERHOMEDIR">
]>

<!--The "acceptLicense" attribute has been deprecated. Use "-acceptLicense" command line option to accept license agreements.-->
<agent-input acceptLicense='true'>
<server>
<repository location='http://www.ibm.com/software/repositorymanager/V85WASDeveloperILANL'/>
<repository location='http://www.ibm.com/software/repositorymanager/com.ibm.websphere.IBMJAVA.v70'/>
</server>
<profile id='IBM WebSphere Application Server V8.5' installLocation='&home;/IBM/WebSphere/AppServer'>
<data key='eclipseLocation' value='&home;/IBM/WebSphere/AppServer'/>
<data key='user.import.profile' value='false'/>
<data key='cic.selector.os' value='linux'/>
<data key='cic.selector.arch' value='x86'/>
<data key='cic.selector.ws' value='gtk'/>
<data key='cic.selector.nl' value='en'/>
</profile>
<install modify='false'>
<offering id='8.5.5.0-WS-WAS-IFPM89206' version='8.5.5000.20130528_1049' profile='IBM WebSphere Application Server V8.5' features='-'/>
<offering id='8.5.5.0-WS-WAS-IFPM89365' version='8.5.5000.20130528_1108' profile='IBM WebSphere Application Server V8.5' features='-'/>
<offering id='8.5.5.0-WS-WAS-IFPM90588' version='8.5.5000.20130607_0847' profile='IBM WebSphere Application Server V8.5' features='-'/>
<offering id='8.5.5.0-WS-WAS-IFPM93496' version='8.5.5000.20130723_1455' profile='IBM WebSphere Application Server V8.5' features='-'/>
<offering id='com.ibm.websphere.DEVELOPERSILAN.v85' version='8.5.5000.20130514_1044' profile='IBM WebSphere Application Server V8.5' features='core.feature,ejbdeploy,thinclient,embeddablecontainer,com.ibm.sdk.6_32bit' installFixes='none'/>
<offering id='com.ibm.websphere.IBMJAVA.v70' version='7.0.4001.20130510_2103' profile='IBM WebSphere Application Server V8.5' features='com.ibm.sdk.7' installFixes='none'/>
<offering id='com.ibm.websphere.liberty.DEVELOPERSILAN.v85' version='8.5.5000.20130514_1313' profile='WebSphere Liberty V8.5' features='liberty,embeddablecontainer,extprogmodels' installFixes='none'/>
<offering id='com.ibm.websphere.liberty.IBMJAVA.v70' version='7.0.4001.20130510_2103' profile='WebSphere Liberty V8.5' features='com.ibm.sdk.7' installFixes='none'/>
</install>
<profile id='WebSphere Liberty V8.5' installLocation='&home;/IBM/WebSphere/Liberty'>
<data key='eclipseLocation' value='&home;/IBM/WebSphere/Liberty'/>
<data key='user.import.profile' value='false'/>
<data key='cic.selector.os' value='linux'/>
<data key='cic.selector.arch' value='x86'/>
<data key='cic.selector.ws' value='gtk'/>
<data key='cic.selector.nl' value='en'/>
</profile>
<preference name='com.ibm.cic.common.core.preferences.eclipseCache' value='&home;/IBM/IMShared'/>
<preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/>
<preference name='com.ibm.cic.common.core.preferences.readTimeout' value='45'/>
<preference name='com.ibm.cic.common.core.preferences.downloadAutoRetryCount' value='0'/>
<preference name='offering.service.repositories.areUsed' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.ssl.nonsecureMode' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.http.disablePreemptiveAuthentication' value='false'/>
<preference name='http.ntlm.auth.kind' value='NTLM'/>
<preference name='http.ntlm.auth.enableIntegrated.win32' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.keepFetchedFiles' value='false'/>
<preference name='PassportAdvantageIsEnabled' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.searchForUpdates' value='false'/>
<preference name='com.ibm.cic.agent.ui.displayInternalVersion' value='false'/>
<preference name='com.ibm.cic.common.sharedUI.showErrorLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showWarningLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showNoteLog' value='true'/>
</agent-input>

The response file defines what to install, where and the repositories used to locate the software. It is possible to hand-code response files, but it is easier to record them using IBMIM's -record switch. The USERHOMEDIR string will be replaced with the user's home directory by the install script below; this version of IBMIM requires absolute directories.

masterpw.txt is an arbitrary password for generating credentials for authentication; example:

foobar

It is not possible to pass an IBM ID and password directly to the install process; it requires credentials in the form of a secure storage file. The script below uses the above password to secure the IBM ID using imutilsc.

was_net_install.sh is a Bash script that coordinates the install operations:

#!/bin/bash
set -e
if [[ -z "$1" ]] || [[ -z "$1" ]] ; then
  echo usage: ./was_net_install.sh ibmid@example.com yourpassword
  exit 1
fi

#install IBMIM
mkdir /tmp/ibmim
echo Extracting install manager
unzip -q -u agent.installer.linux.gtk.x86_1.6.2000.20130301_2248 -d /tmp/ibmim
echo Installing IBM Installation Manager
/tmp/ibmim/userinstc -acceptLicense
#rm -Rf /tmp/ibmim

#install WAS
TOOLS=~/IBM/InstallationManager/eclipse/tools
REPO=http://www.ibm.com/software/repositorymanager/V85WASDeveloperILANL/repository.xml
echo Setting $HOME in response file
sed -e "s#USERHOMEDIR#$HOME#g" install_was.xml > /tmp/install_was.xml
echo Generating credentials
$TOOLS/imutilsc saveCredential -url $REPO -userName $1 -userPassword $2 -masterPasswordFile masterpw.txt -secureStorageFile ~/secure_repo.dat
echo Installing WAS from internet...     may take some time
$TOOLS/imcl input /tmp/install_was.xml -log ~/wasinstall.log -acceptLicense -masterPasswordFile masterpw.txt -secureStorageFile ~/secure_repo.dat
rm ~/secure_repo.dat

#install Eclipse
JUNO=~/juno
JRE=~/IBM/WebSphere/AppServer/java
JUNOREPO=http://download.eclipse.org/releases/juno
WDTREPO=http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/updates/wdt/V8.5.5
ETAR=eclipse-jee-juno-SR2-linux-gtk.tar.gz
echo Downloading $ETAR
wget -O /tmp/$ETAR http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/juno/SR2/$ETAR
mkdir $JUNO
tar xzf /tmp/$ETAR -C $JUNO
#rm -Rf /tmp/$ETAR
echo Setting Eclipse JRE to WAS JDK
ln -s $JRE $JUNO/eclipse/jre
echo Installing WDT plugins from internet...  may take some time
FEATURES=com.ibm.osgi.wdt.feature.feature.group,com.ibm.wdt.webtools.top.feature.feature.group,com.ibm.websphere.wdt.st.v85.feature.group
FEATURES=$FEATURES,com.ibm.wdt.ast.ws.tools.feature.feature.group,com.ibm.websphere.wdt.server.tools.feature.group
$JUNO/eclipse/eclipse -nosplash -application org.eclipse.equinox.p2.director -repository $WDTREPO,$JUNOREPO -installIU $FEATURES
ln -s $JUNO/eclipse/eclipse ~/Desktop/eclipse

Here's a rough outline of what the above script does:

  1. Install WAS
    1. Unzip the IBMIM installer
    2. Install IBMIM into user-space using userinstc
    3. Set the HOME directory in the response file
    4. Generate the IBM repository credentials
    5. Install WAS using imcl
  2. Install Eclipse
    1. Download the Juno build using Wget
    2. Untar Juno
    3. Set the Eclipse JRE to the WAS JDK
    4. Use the Eclipse p2 director to install the WDT plugins

End notes

Installing WAS from the internet is slow, bandwidth intensive and subject to the vagaries of connectivity. These scripts make no allowance for proxies. If installs were going to be repeated frequently then offline repositories would be more appropriate; that is a topic for another post.

1 comment:

All comments are moderated