Monday 10 May 2010

*REFERENCE MATERIAL* - scripting basics

Looping through results of an ls command, and performing a copy / name change action on each one of those results:


Example:

for FILE in `ls *PP*ESB*.properties`; do cp $FILE `echo $FILE | sed 's/PP/LIVE/g'`; done


Explanation:

FILE is the token for each line returned from the command `ls *PP*ESB*.properties`. For each one of these results, the file is copied and the name changed from 'PP' to 'LIVE'

Wednesday 15 April 2009

WebSphere Fabric on Ubuntu

Install process for WebSphere Business Services Fabric environment on Ubuntu Intrepid (Lenovo T60, 1Gb RAM):

Firstly, this is not a supported environment for WebSphere Business Services Fabric (either the server or the IDE) - this was just done because I needed it in my environment. However, this has been running for a while and seems to be pretty stable, and runs supprisingly well on a 1 Gb machine (although using the IDE and Server stack at the same time is not recommended).

So the software you will need is (you can get this from IBM if you have a partnerworld account - I've put the download images next to the products):

Fabric Server
WAS 6.1 Linux x86 32 (C88STML)
WAS 6.1 Supplements x86 32 (C88T0ML)
Process Server Linux x86 32 (C1M4XML)
Fabric Foundation Pack (C1RC2ML)
[I also grabbed all the industry specific content packs]

Fabric Tools
WID 6.2 (parts 1-4) (C1Q24ML, C1Q25ML, C1Q26ML, C1Q28ML)
Websphere Fabric Tools Pack (C1RR3ML)


Additional
WSRR 6.2 (C1W2NML)

DB2 9.5 Express for Linux 32-bit (personal use version - you'll have to get this from the IBM site, it's free to download)


Preparation:

Next are the usual suspects when running IBM Java apps on Ubuntu:

1. You'll need to replace Dash with Bash, do this by entering

sudo dpkg-reconfigure dash


and choosing no when prompted

2. I, as a matter of course, Install Sun Java 1.6
sudo apt-get install sun-java6-jdk

3. You'll need to have this environment variable set to allow AWT to display within Ubuntu (I don't know whether it's gnome or compiz that causes this problem)

export AWT_TOOLKIT=MToolkit

If you put it in the profile for both root and your standard user then you won't have to worry about it again.

4. Enable and log in as root, you have to do it all while logged in as root - sudo as your regular user just won't cut it.

(You can create launchers for the server and IDE in your main account by using gksudo before the commands in your scripts, that will return a graphical sudo password entry field so you don't have to bring up a command prompt every time.)



Unpack all the downloaded packages into Fabric/Server and Fabric/Tools directories.




Install WAS and Process Server:

I used the installer in Fabric/Server/WAS-6.1-Linux/launchpad.sh and Fabric/Server/Process_Server/launchpad.sh and they completed fine. I created default profiles for each product (explaining why my ports are a little random later)




Install DB2 9.5 linux 32 (Express):

You'll need to get some extra packages for DB2 Express to run in ubuntu.

sudo apt-get install libstdc++5
sudo apt-get install libaio-dev

then run Fabric/Server/DB2E/db2setup

I used Username / Group / Password (s):
db2admin / db2admin / db2admin
db2inst1 / db2insts / db2inst1
db2fenc1 / db2fencs / db2fenc1



Install WebSphere Business Services Fabric:

Run installer in Fabric/Server/Fabric_Foundation_Pack/launchpad.sh
Create new profile (WBSFabric01)
typical installation completed with no problems




Install WebSphere Services Registry and Repository: - you're going to need the Registry and Repository to store your services:

Install WSRR using Fabric/Server/WSRR/install_linux_x86.bin

Set location to /opt/IBM/WebSphere/ServiceRegistry
installs files to filesystem, but no database or deployment to WAS - we'll do this bit manually next.

to start db2 ->
su - db2inst
db2start
exit

Edit the following values in /opt/IBM/WebSphere/ServiceRegistry/install/wsrrdeployment.properties:

# Database username
db.user=db2inst1

# DB2 Install directory
db2.home=/opt/IBM/DB2/V9.5

# WAS Base Installation Directory
was.installdir=/opt/IBM/WebSphere/AppServer/6.1

# WAS PROFILE NAME
was.profile=WBSFabric01

# WAS SOAP CONNECTOR ADDRESS PORT
# This is the SOAP port for the target server
# If installing to a cluster then this should be set to the SOAP port of
# the deployment manager (normally 8879)
was.port=8883 (1 is AppSrv01, 2 is ProcSrv01, 3 is WBSFabric01)

# WAS Admin Username
# leave set to null if security is disabled
was.user=wasadmin


Run ./installall.sh -configdb true -configwas false
[enter db2inst1 password when prompted - and await "Installation Complete"]


If you hit this issue: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=255676&tstart=90, you might need to update the value of com.ibm.SOAP.requestTimeout in .../profiles/WBSFabric01/properties/soap.client.props to 5200.

The default of this value is 180, but this process takes over an hour (well it did on my machine) so better to set the value higher so you don't have to go through it more than once.




Install WSRR ears into WAS:

./installall.sh -configdb false -configwas true
[when prompted enter wasadmin and db2]

***************** I GOT *******************

[wsadmin] Backing up and deleting any existing default or governance profiles
[wsadmin] WASX7017E: Exception received while running file "/opt/IBM/WebSphere/ServiceRegistry/install/./jython/verifywas.py"; exception information: javax.management.MBeanException
[wsadmin] java.lang.Exception: java.lang.Exception: GSR0109E: Unable to locate Admin EJB using lookup name "ejb/ejb/com/ibm/serviceregistry/6_2/ServiceRegistryAdminHome".


BUILD FAILED
/opt/IBM/WebSphere/ServiceRegistry/install/installsr.xml:323: The following error occurred while executing this line:
/opt/IBM/WebSphere/ServiceRegistry/install/installsr.xml:597: Java returned: 105

Total time: 161 minutes 21 seconds

***********************************************

But it was in the post install testing phase, and didn't seem to cause any problems in starting and running the server - will see if I get any further issues and amend the post if I need to do anything.





Setup users and groups for Fabric:

Users and Groups -> Manage Groups
Create a group called FabricAdminGroup

Users and Groups -> Manage Users
Create a username/password; fabadmin / fabadmin (firstname Fabric, surname Administrator).

[obviously you can create as many groups and users as you like within the WMM - or externalise to an LDAP if you like]

Now you can log in as fabadmin/fabadmin to http://localhost:9083/BusinessSpace.





Install Industry Specific Content Packs:

/Fabric/Server/[ContentPack]/Lauchpad.sh - click Install.
Install Set = Custom (+configure +installReferenceApp) -> Next
/opt/IBM/WebSphere/Fabric/Banking/Payments -> Next
/opt/IBM/WebSphere/AppServer/6.1 -> Next
WBSFabric01 -> Next
Put in the details you need to access the Fabric BusinessSpace application - mine was https / localhost / 9446 / wasadmin / wasadmin




Install the Fabric IDE and Tools:

Run the file Fabric/Tools/WID_6.2/disk1/launchpad.sh

select the appropriate destination (I installed the SDPShared directory to /opt/IBM/Rational/ and the WID product to /opt/IBM/WebSphere/Integration/Developer/)

Once installed, run the Installation Manager and install any updates that are available for the installed products.


The installer for Fabric Tools will not work (Currently Win32 only), so I copied the contents of repository/plugins and repository/features to the same folders in /opt/IBM/WebSphere/IntegrationDeveloper, then copied the 'native', 'atoc' and 'Offerings' directories from repository to /opt/IBM/WebSphere/IntegrationDeveloper.

Open WID and see that you have the 'Business Service' perspective. If you then open the Servers view, you can create a new server and in the list there should be an entry under IBM named 'WebSphere Business Services Fabric v6.2 Server'. You can then enter the details of your WBSF Server and have that available locally within your environment.



And that should be it - Have fun! Let me know if there are any problems with the steps and I'll amend.