Thursday 13 April 2017

Installing IBM HTTP Server silently on Linux (using imcl)


To install IBM HTTP Server, we will follow the same process that we followed to install IBM WebSphere Application Server.
We need to have IBM Installation Manager installed in order to install IBM HTTP Server 8.5.
After installing IBM Installation Manager, follow below steps :

1) Navigate to $Installation_manager_dir/eclipse/tools and trigger below command to check the available packages in the repositories.

./imcl listAvailablePackages -repositories <IHS_repository_path>





2) Then, install the IBM HTTP Server, by below command.

./imcl -s install <Offering_ID> -repositories <IHS_Repository_path> -installationDirectory <IHS_installation_Path> -properties user.ihs.httpPort=80 -acceptLicense -sP

Here, user.ihs.httpPort will specify on which port http server will listen,




3) Verify the installation using versionInfo.sh



Tuesday 11 April 2017

Applying or Rolling back Fixpacks on IBM WebSphere Application Server 8.5.5 (using imcl)

Here, we will learn how to install fixpacks on IBM WAS.

Installed Version : 8.5.0.0


Available Fixpack version : 10 (8.5.5.10)

Please perform below steps to install fixpacks.

1) Stop all the WAS Services
2) Take the backup of all profiles using backupConfig.sh from each profile

    ./backupConfig.sh



3) Check the available package/offering ID from the repository using below command :
  
   $InstallationMgr_Path/eclipse/tools/imcl listAvailablePackages -repositories <Fixpack_repository>



4) Install fixpack using below command :

   $InstallationMgr_Path/eclipse/tools/imcl -s install <Offering_ID> -repositories <Fixpack_repository> -installationDirectory <WAS_install_dir> -acceptLicense -sP



5) Verify the installation using versionInfo.sh


We have now updated Fixpack version to 10.

Now we will learn to rollback the fixpack to previous version. In this case, we will remove the fixpack 10 and roll it back to previous version 8.5.5.0. To achieve this, we will use below steps.

1) Get the package/offering ID from the fixpack repository.
 
./imcl listAvailablePackages -repositories <Fixpack_repository_path>



2) Rollback to previous version using below command.

./imcl rollback <previous_version_offering_id>  -repositories <previous_version_repository_path> -installationDirectory <WAS_install_dir> -acceptLicense -sP



3) Verify the installation using versionInfo.sh



Now we have rolled back the fixpack from 8.5.5.10 to 8.5.0.0

Creating cluster in WAS

Cluster is a logical group of servers. There are 2 types of clusters - Vertical cluster and Horizontal cluster. Vertical cluster is a cluster where all the members are on one physical server; whereas, Horizontal cluster is a cluster where the members are distributed across different physical structure.

In this section, we will learn to create a vertical cluster. Perform below steps to achieve the same.

1) Login to WAS Admin console
2) In the left navigation pane, navigate to Servers -> Clusters -> WebSphere application server clusters and click "New".



 3) Enter Cluster Name and click Next.


4) Enter Member Name for the first Cluster member. Select Node from the drop down menu, on which you are creating the member. Click Next.



 5) Enter Member Name for the second cluster member and click Add Member. You may add as many members you wish. Click Next once you have added the member.


6) Review summary and click Finish.


 7) Click Review


 8) Select "Synchronize changes on Nodes" and click Save.


9) Click OK.


10) Select the newly created cluster and click Start.


11) Click on the cluster name and click Cluster Members. You will find the member list.



Our vertical cluster is created.

Monday 10 April 2017

Generating heapdumps and thread dumps in WAS

Heapdumps and Thread dumps/Javacores play a major part in troubleshooting issues with WAS. In this section, we will learn how to generate heapdumps and thread dumps/java cores.

1) Generating Thread dumps

We can generate thread dumps using below kill command.

kill -3 <pid_of_WAS_JVM>

This will generate javacore.yyyymmdd.hhmmss.pid.part.txt file in profile_root directory.


Another way to generate javacores is using wsadmin. Login to wsadmin and trigger below commands :

wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=JVM_name,*]

wsadmin>$AdminControl invoke $jvm dumpThreads



We can also create java core from admin console (WAS 8.5 and later)



2) Generating heap dumps

We can generate heapdumps using wsadmin like below.

wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=JVM_name,*]

wsadmin>$AdminControl invoke $jvm generateHeapDump





Alternatively, we can generate heapdumps using Admin Console.



Creating JVMs (using Admin console and wsadmin)

1) Creating JVM/Application Server using WAS Admin console

Access admin console using below URL:

http://<ip_address>:9060/admin

where <ip_address> is the ip address of the machine where dmgr is running and 9060 is the default port.


Navigate to Servers -> Server Types -> WebSphere application servers


 Select Node from the drop down menu. Click next.


Enter server name. Click next.


Select template. Click next.


Select "Generate Unique Ports". Click next


Click Finish.


Click Review.


Select "Synchronize changes with Nodes"


Click OK


Select the newly created JVM and click start.


You will see the JVM status as green. You may check $AppSrv_Home/logs/TEST01/SystemOut.log and search for e-business.

 2) Creating JVM/Application Server using wsadmin 

a) Using jacl

Navigate to $DMGR_home/bin directory and trigger below command :

./wsadmin.sh <dmgr_host_or_IP> <SOAP_Port>

This will enter wsadmin prompt. Please ensure, dmgr is running before you enter wsadmin.

On wsadmin prompt, trigger below wsadmin command to create JVM.

wsadmin>set node [$AdminConfig getid /Node:AppSrvNode01/]

wsadmin>$AdminTask createApplicationServer AppSrvNode01 {-name TEST02 -templateName default}

wsadmin>$AdminConfig save


  
b) using jython

Enter wsadmin using below command.

./wsadmin.sh -lang jython

Input below scripts on wsadmin prompt:

wsadmin>AdminTask.createApplicationServer('AppSrvNode01', '[-name TEST03 -templateName default -genUniquePorts true]')

wsadmin>AdminConfig.save()


Start the JVM using ./startServer.sh <JVM_name>


Federating Node with DMGR

Now, we have come to a stage where we will use the actual concept of Network Deployment. By federating nodes to the deployment manager we can administer all the application servers through one deployment manager console.

Go to AppSrv profile root and navigate to bin directory and trigger below command:

./addNode.sh <dmgr_host> -connType SOAP -port 8879

where -connType and -port are optional parameters, default connType will be SOAP and default port will be 8879

Ensure dmgr is up and running before triggering the command.





Now, our node is federated with DMGR. You may check using ps -ef | grep Dwas and you will find a nodeagent is created and running. Nodeagent helps in communication between App Server and DMGR.






Stopping and Starting JVMs

1) Stopping dmgr

Go to DMGR_HOME/bin and trigger below command :

./stopManager.sh



2) Starting dmgr

Go to DMGR_HOME/bin and trigger below command :

./startManager.sh


3) Stopping server1 (which is created by default when we create AppSrv profile)

Go to AppSrv_HOME/bin and trigger below command :

./stopServer.sh server1



4) Starting server

Go to AppSrv_HOME/bin and trigger below command :

./startServer.sh server1




Creating Deployment Manager and AppServer profile

After installing IBM WAS, we will proceed further to create profiles. We will use manageprofiles.sh utility under WAS_HOME/bin directory to create profiles.
We will consider WAS_HOME as /opt/IBM/WebSphere/AppServer

1) Creating DMGR profile :
Go to /opt/IBM/WebSphere/AppServer/bin and trigger the below command :

./manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/cell/dmgr -profileName Dmgr01 -nodeProfilePath /opt/IBM/WebSphere/AppServer/profiles -cellName `hostname`Cell01 -nodeName `hostname`DMGRNode01

where `hostname` will fetch and apply hostname automatically. You may use the values of your own.



2) Creating AppSrv01 profile :

 Go to /opt/IBM/WebSphere/AppServer/bin and trigger the below command :

./manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default -profileName AppSrv01 -ProfilePath /opt/IBM/WebSphere/AppServer/profiles -nodeName AppSrvNode01



We have both of our profiles ready.

3) Creating a Custom/managed profile :

 Go to /opt/IBM/WebSphere/AppServer/bin and trigger the below command :

./manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/managed -profileName CustomProfile01  -ProfilePath /opt/IBM/WebSphere/AppServer/profiles -nodeName Custom_Node01 -hostname `hostname` -federateLater true