Friday, April 26, 2013

Websphere Interview questions and answers

 Interview questions vary from company to company and also depends on the person.Some expect crisp answers while others expect detailed one.So its always better to understand any concepts in depth.

IBM  Websphere administrator Interview Questions:

1.Tell about your day to day work activities.
  Please explain the work you do regularly and you are more familiar with.Explain in detail
all the stuffs 
ex.Deployment and configuration of application,resource creations and performance management.

2.what is the maximum heap size can be set  for 32 bit and 64 bit JVM?
   2^32 that is equal to 4GB for 32 bit 
   2^64 that is equal to 32GB for 64 bit theoretically.
For better understanding for JVM heap allocation please check the link below

3.What is Garbage collection and the policy supported ?
It is process of freeing unused objects automatically by java and release the memory back for the application.
Refer ibm system mags link for tuning garbage collection
Tuning garbage collection for performance

4.Garbage collection Policy:
In each websphere application server it has default garbage collection policy.In older versions like 6 there is garbage collection policy likee optthruput was there .In optthruput there are no separate space for young and old objects so the pause time will be longer.To prevent this in higher versions a new policy was introduced called gencon (generational and conncurrent).
Refer the below link for details
Gencon garbage collection policy
IBM JVM tuning – gencon GC policy

5.How static content and dynamic content was serviced?
   Static content will be serviced by webserver to improve performance.If fileservingenabled property is set to 'false' in the  ibm-web-ext.xmi file of the web application then the static content will be serviced by webserver.If its set to true it will be serviced by application server.
Static and dynamic content webserver vs appserver

6.Vertical and horizontal clustering?
 In same machine its vertical if its spanned across different machines its horizontal.How to decide which topology is better.

7.Installation options for websphere application server?
GUI
silent install using response file

8.Datasource creation,messaging configuration?
 Datasource creation websphere




Wednesday, April 24, 2013

DataSource Creation in websphere




Go to JDBC provider-> New


You can select the database you want to use like Oracle,DB2 etc..

I had used Oracle for example.


In next step it will  ask for the path of ojdbc jar which is needed for oracle jdbc connections.Use the latest jars compatible with your database version.

Click on Finish and save to master config to complete jdbc provider creation.

Click on datasource ->new

I used the cell scope so it will be visible to all applications.

Enter the datasource name and jndi name



The database URL for Oracle will be in the format :
jdbc:oracle:thin:@[ip address]:[Oracle port (1521)]:[Oracle database name]
ex:jdbc:oracle:thin:@localhost:1521:testdb

DataSource Creation is completed.
The next step will be to configure J2C authentication


Click on JAAS-J2C authentication 


Enter username and password for the database schema connectivity



Last step to test the connection

Click on TestConnection. 
Other Useful links for datasource creation:
Datasource creation explained for oracle,mqsql

Install or deploy application in websphere

Thursday, April 11, 2013

Websphere Port Conflict


Unix Commands to find the process listening on port:
    lsof -i|grep port
    cat /etc/services|grep port

If  the process listening on the port is not  a useful one you can kill the process using the
command kill -9 processid

If the process is a needed one you have to change the port in serverindex.xml present in config/cells directory or in the adminconsole port details.Restart server after the changes.

Note:
Before you use any commands like manageprofiles,addNode etc...which use default ports if
not specified specifically,better to check the availability of port using the below  netstat command and pass the startingport argument to the websphere commands.
example:netstat -an|grep 1234[0-9] .This will tell the list  of 10 ports are free or not.

Tuesday, April 9, 2013

Stop Websphere without passing username and password to stopServer

Jython wsadmin scripting for websphere automation

Websphere administration Commands

 

VersionInfo Command 

1.Deployment Manager Profile Creation:

./manageprofiles.sh -create  -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/dmgr
-profileName Dmgr01 -profilePath /opt/IBM/WebSphere/AppServer/profiles/Dmgr01 -hostName servername

2.Federate a node:

  ./addNode.sh <dmgr_host> <dmgr_port>.Execute this command from the Appserver
bin directory which you want to federate to deployment manager.

 3.VersionInfo  Command

versionInfo.sh -file /tmp/version.txt
WVER0010I: Copyright (c) IBM Corporation 2002, 2012; All rights reserved.
WVER0012I: VersionInfo reporter version 1.15.1.48, dated 2/8/12
     
It is used to find the version of WAS and fixpack installed.The versionInfo command generates a report that includes a list of installed fix packs and interim fixes

4.ShowLog  Command

   ./showlog.sh activity.log /tmp/activity.txt

5.Check Websphere Application Server Status

   Go to the profile path and issue the command  ./serverstatus.sh server1(This is the server name)
This will tell whether the server is in stop state or it is started.





Thread and Heap dump Analysis

Thread States Explanation
Websphere Thread dump ,Heap dump generation commands
Hung thread detection in WebSphere Application Server

Jython Script to generate dump:


    JVM = AdminControl.completeObjectName(‘type=JVM,process=server1,*’)
    AdminControl.invoke(JVM,’dumpThreads’)
    AdminControl.invoke(JVM,’generateHeapDump’)