Sei sulla pagina 1di 28

WebSphere Application Server 101 Lab

Exercises

Jason T. Moore
Jason_moore@us.ibm.com
Accelerated Value Program | Field Support Services

Copyright IBM Corporation 2011. All rights reserved.

What this Lab exercise is about


This hands-on session is for anyone wanting to learn the basic skills to install, configure
and administer an application based on WebSphere Application Server (WAS). This
introductory exercise will walk you through the installation of WebSphere Application
Server, IBM HTTP Server, and the WebSphere Application Server plug-in. The student
will then apply maintenance packages to each component followed by setting up the
IBM HTTP Server to direct traffic to the back-end WebSphere Application Server. This
exercise will include installing WebSphere in a cell configuration so the student will
become familiar with the features of Network Deployment.

Lab Requirements
An interest in learning how to use WebSphere Application Server

Setup
This lab will utilize the following software packages. 7.0.0.11 was chosen for this lab
because at the time it was the supported release of WSAS for Lotus Connections 3.0.
The concepts covered in this lab will apply to any fixpack of WAS 7.0.
The following software packages will be used in this package. The first packages
marked with a * are available through your passport advantage download website. The
others are publicly available fixpacks found on FixCentral at www.ibm.com.
*C1G32ML.tar WebSphere Application Server Network Deployment V7.0
*C1G33ML.tar IBM HTTP Server and WebSphere Application Server Web Server Plugins V7.0
7.0.0.11-WS-UPDI-LinuxIA32.zip = WebSphere Update Installer
7.0.0-WS-WASSDK-LinuxX32-FP0000011.pak WebSphere JAVA SDK Fixpack
7.0.0-WS-IHS-LinuxX32-FP0000011.pak - IBM HTTP Server Fixpack
7.0.0-WS-PLG-LinuxX32-FP0000011.pak WebSphere Application Server Web Server Plugin Fixpack
7.0.0-WS-WAS-LinuxX32-FP0000011.pak WebSphere Application Server Fixpack

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 2 of 28

Copyright IBM Corporation 2011. All rights reserved.

Agenda

Task 1: Install WebSphere Application Server (WSAS)


Task 2: Save Administrator Credentials in the SOAP Properties File
Task 3: Install IBM HTTP Server (IHS)
Task 4: Configure IBM HTTP Server with Web Server Plug-in
Task 5: Apply Maintenance to WSAS, IHS, and WASPLG
Task 6: Basic Operations
Task 7: Problem Determination

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 3 of 28

Copyright IBM Corporation 2011. All rights reserved.

Exercise Instructions

Task 1: Install WebSphere Application Server (WAS)


1. Locate the File Browser on your desktop. This shortcut will take you to an

interface much like Windows Explorer.


2. Browse to /installationmedia/C1G32ML_WAS/ and doubleclick launchpad.sh. If

a dialog window appears select the Run option.


3. Select WebSphere Application Server Installation from the left hand menu.
4. Select Launch the installation wizard for the WebSphere Application Server

Network Deployment
5. Click Next, accept the terms and conditions, click next. You may be prompted
with a screen regarding the failure of the OS pre-requisite checking. Ignore this
and click next.
6. Now you will be prompted to install that sample applications. Normally you

wouldn't install these in a production environment, but for our purposes today you
will want these applications. Please check the box next to Install the sample
applications.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 4 of 28

Copyright IBM Corporation 2011. All rights reserved.

7. Next you will be asked for the installation directory. Accept the default of
/opt/IBM/WebSphere/AppServer

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 5 of 28

Copyright IBM Corporation 2011. All rights reserved.

8. Now that we are passed all the easy stuff we finally get to an important screen.

Most of the time the Application Server environment will be selected. However,
in this case we are going to select Cell. This is so you can learn about the
features of Network Deployment. When selecting Cell the installer will do the
following steps: Install WAS Network Deployment, Create a Deployment
Manager Profile, Create an Application Server Profile, and federate the
Application Server Profile to the Deployment Manager.

9. Staring with WAS 6.1 the administrator is allowed to configure Administrative

Security during the installation process. In prior versions this step could only be
done during post installation configuration. The account you create in this step
can be changed or modified after installation. Please enter wasadmin as the
username and any password you like (password is perfectly acceptable in this
lab environment). Also you will need to set a password for the samples user to
interact with the sample applications. Choose any password you like then hit
next.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 6 of 28

Copyright IBM Corporation 2011. All rights reserved.

10. Do not check Create a repository for Centralized Installation Managers.


11. Now you will be on the Installation Summary screen. Uncheck Verify my

permissions to perform the installation. Click next to begin the installation.


You can expect the installation to take 10 to 20 minutes. You are welcome to
take a break to grab water or your favorite caffeinated beverage.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 7 of 28

Copyright IBM Corporation 2011. All rights reserved.

12. Once installation is complete you will see the following screen. Look for the

green Success message on the top left to ensure that the install completed
successfully.

Ensure that the Launch the First steps console check box is selected then
click Finish.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 8 of 28

Copyright IBM Corporation 2011. All rights reserved.

13. Select Start the deployment manager from the First steps window.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 9 of 28

Copyright IBM Corporation 2011. All rights reserved.

14. Once the deployment manager (dmgr) starts then you can proceed to launching

the nodeagent and the application server. The application server cannot be
started until the nodeagent is running. Open a terminal (icon on the desktop) and
execute
cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/
then execute
./startNode.sh

15. Now that the deployment manager and nodeagent are running we can use the

Integrated Solutions Console (a.k.a. ISC or WAS Admin Console) to start the
application server. Launch the ISC in a browser by going to
http://ibmlab.avp.ibm.com:9060/ibm/console
16. Since security is enabled the browser will be redirected to SSL. During the
installation of WAS a self signed dummy keyfile was created. Therefore, your
browser will throw a warning asking you to accept the SSL certificate. Please
accept the certificate and continue. Login using the credentials you entered
during the installation.
User ID: wasadmin
Password: <your password>

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 10 of 28

Copyright IBM Corporation 2011. All rights reserved.

17. Using the Integrated Solutions Console navigate to Servers -> Server Types
Application Servers. Place a checkmark in the box next to server1 then click
the Start button.
18. When using Lotus Domino you had a server console to monitor the server startup
messages. WebSphere does not have a console, but you can mimick the
Domino console by tailing the SystemOut.log. Using a terminal run the following
commands.
cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1
tail -f SystemOut.log
(Note*** If you installed WebSphere to a different path than the cd command will
need to be updated to point to your path)
19. You will now have a live look at the SystemOut log file. This is the main
WebSphere log file and will be useful to monitor during troubleshooting.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 11 of 28

Copyright IBM Corporation 2011. All rights reserved.

20. Use the Top command to view the running WebSphere processes. Once Top
is started type a capital M to sort by memory usage. You should have three java
processes which represent the dmgr, nodeagent, and server1. As in this
screenshot:

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 12 of 28

Copyright IBM Corporation 2011. All rights reserved.

21. Now let's figure out which java belongs to which WebSphere process. This is
necessary for troubleshooting. You'll need to know which process is which when
you want to see how much CPU or Memory is being consumed or if you need to
kill the process. Open File Browser then browse to the logs directory for the
Deployment Manager ->
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr. Open
startServer.log and scroll to the bottom of the file. You should find some output
similar to this example:
[3/8/10 11:48:58:562 CST] 0000000a AdminTool
Dmgr01 profile
[3/8/10 11:48:58:562 CST] 0000000a AdminTool
server: dmgr
[3/8/10 11:49:02:281 CST] 0000000a AdminTool
initialization status.
[3/8/10 11:49:35:843 CST] 0000000a AdminTool
business; process id is 1876

A ADMU0128I: Starting tool with the


A ADMU3100I: Reading configuration for
A ADMU3200I: Server launched. Waiting for
A ADMU3000I: Server dmgr open for e-

Notice that the process id (PID) for the dmgr process is available in this log. Now
you can take this PID and compare it with the java processes in Top.
Now do the same thing for the nodeagent. The logs for these servers will be in
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/. Server1 will not have a
startServer.log if you started via the dmgr console.
22. Verify that the servers are up and running through the use of WebSphere
command lines.

To check the nodeagent and server1 run this command from the AppSrv01 bin directory:
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/serverStatus.sh -all -username
wasadmin -password password

To check the dmgr run this command from the Dmgr01 bin directory:
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/serverStatus.sh -all -username
wasadmin -password password

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 13 of 28

Copyright IBM Corporation 2011. All rights reserved.

Task 2: Save Administrator Credentials in the SOAP Properties File


When running WebSphere command line tasks the administrator will have to enter
credentials if security is enabled. This can be done on the command line using the
-username and -password switches or through an authentication dialog box that will
appear if you do not use the switches. This can become tedious when working through
the command line interface. Therefore, an option is provided to allow the administrator
to store encrypted credentials for use with WebSphere commands. This exercise will
walk you through this configuration.
1. Navigate to /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/properties/
2. Right click on soap.client.props and select Open in Text Editor

3. Set the following two options to match the credentials for your WebSphere
Administrator:

com.ibm.SOAP.loginUserid=wasadmin

com.ibm.SOAP.loginPassword=password

4. Save soap.client.props
5. Open a terminal and change to

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin
6. Execute the following command to use the Properties File Encoder to encrypt
your password. This command is all on one line and is CASE sensitive:
./PropFilePasswordEncoder.sh <there is a space here>
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/properties/soap.client.props <there is
a space here too> com.ibm.SOAP.loginPassword

7. Reopen
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/properties/soap.client.props
in a text editor. You should now see that your password is encrypted like the
following the example:
com.ibm.SOAP.loginPassword={xor}Lz4sLCgwLTs/=
8. For further information reference the infocenter at

http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.n
d.doc/info/ae/ae/tsec_protplaintxt.html

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 14 of 28

Copyright IBM Corporation 2011. All rights reserved.

9. Now you can run console commands like serverStatus.sh without entering

credentials. Try the command from the previous exercise. To check the
nodeagent and server1 run this command from the AppSrv01 bin directory
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/serverStatus.sh -all

Task 3: Install IBM HTTP Server (IHS)


A HTTP server is an integral part of any WebSphere Application Server environment. In
this exercise we will install and configure the IBM HTTP Server (IHS).
1. Browse to /installationmedia/C1G33ML_IHS/ and doubleclick launchpad.sh.
2. Click Launch the installation wizard for IBM HTTP Server

3. Note: If you have personal firewall software installed it may ask you to allow java
access to the network. Please grant it access. It is only making a local
connection.
4. When the installer launches click next then accept the terms and conditions.
5. You may be prompted with a screen regarding the failure of the OS pre-requisite
checking. Ignore this and click next.
6. Set the install location to /opt/IBM/HTTPServer
7. Accept the default ports of 80 and 8008.
8. Configure the Windows Service Definition. In this lab the password for Administrator is
password. Enter the password and click next.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 15 of 28

Copyright IBM Corporation 2011. All rights reserved.

9. Next you will be asked to create an administration account for the IHS admin server. Use
ihsadmin and password.
10. Using the following properties, install the IBM HTTP Server Plug-in for WebSphere
Application
Ensure that the check box is checked
Web Server Definition: webserver1
Host Name: ibmlab.avp.ibm.com
11. Click Next and/or Finish till you complete the installation process
Task 4: Configure IBM HTTP Server with WebSphere Application Server
Starting with WebSphere Application Server 6.0 it is now possible to administer IBM HTTP
Server from the Deployment Manager console. This linkage can be setup manually in the
console or it can be done using a script that is created during the installation of the web server
plug-in. In this exercise we will use the plugin to create the web server definition and map the
existing applications.

1. Copy configurewebserver1.sh from /opt/IBM/HTTPServer/Plugins/bin to


/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin
2. Open a command prompt and change to
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin then execute the
following command:
configurewebserver1.sh -profileName Dmgr01 -user wasadmin
-password password -ihsAdminPassword password
This command script uses wsadmin to connect to the Deployment Manager
to configure the web server definition and setup the plugin-cfg.xml. The
credentials passed in the -user and -password switches are your
WebSphere admin credentials.
3. Examine the output for any errors. If the last line is Configuration save is
complete then the process completed successfully.
4. Verify the script performed the desired operations by launching the ISC in a
browser. Http://ibmlab.avp.ibm.com:9060/ibm/console/
5. Navigate to Servers -> Web Servers. Check for webserver1. You can now start

your web server by clicking the check box next to webserver1 and clicking Start.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 16 of 28

Copyright IBM Corporation 2011. All rights reserved.

If the webserver1 starts successfully you will see a green arrow in the Status
section.
6. Now that you have a definition for webserver1 and webserver1 has been mapped
to the existing applications, you can generate and propagate the Plug-in
configuration file. This file is used by the web server plugin to determine what
HTTP URIs will be passed on to WebSphere. Put a checkmark next to
webserver1 and click Generate Plug-in then repeat the process for Propagate
Plug-in.
7. Open /opt/IBM/HTTPServer/Plugins/config/webserver1/plugin-cfg.xml with a web
browser.
Notice that the plugin-cfg.xml contains URIs for the sample applications that are
installed. UriGroup Name="server1_Cluster_URIs"

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 17 of 28

Copyright IBM Corporation 2011. All rights reserved.

8. The URIs defined in plugin-cfg.xml are determined by the application mappings

configured on WebSphere. When we ran configurewebserver1.sh it


automatically mapped all of the existing applications. Let's take a look at where
this configuration takes place. Open your WebSphere ISC (aka admin console)
and navigate to Applications - Enterprise Applications. Click on the
SamplesGallery application name (Don't put a checkmark just click on the
name). Select the Manage Modules link on the top right. You'll see that the
application modules are mapped to server1 and webserver1 (example
screenshot of application mapping is below). If this was a cluster the applications
would be mapped to a cluster name and one or more web servers. Here is an
example of a clustered application from the Profiles service of Lotus Connections

9. Let's explore what would happen if you remove the mapping for webserver1.

First make a copy of the existing plugin-cfg.xml in


/opt/IBM/HTTPServer/Plugins/config/webserver1/ so that we can compare it to
the new plugin config we will be generating.
Go back to looking at the Manage Modules configuration. Place a check next to
Samples Gallery Web Application and select the entry ending with
server=server1 in the upper dialog then hit apply. Notice that webserver1
disappears from the list of servers for this application. Click Ok then click Save
at the top of the page.
10. Regenerate the plugin-cfg.xml. Go to Servers - Web Servers, place a

checkmark next to webserver1 and hit Generate Plug-in. Check for the
following output at the top of the screen:
PLGC0005I: Plug-in configuration file =
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/ibmlabCell01/nodes
/ibmlabNode01/servers/webserver1/plugin-cfg.xml
PLGC0052I: Plug-in configuration file generation is complete for the Web server
ibmlabCell01.ibmlabNode01.webserver1.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 18 of 28

Copyright IBM Corporation 2011. All rights reserved.

11. Next propagate your plugin config file to the web server. Place a checkmark next

to webserver1 then hit Propagate Plug-in. Check for the following output which
indicates success:
PLGC0062I: The plug-in configuration file is propagated from
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/ibmlabCell01/nodes
/ibmlabNode01/servers/webserver1/plugin-cfg.xml to
/opt/IBM/HTTPServer/Plugins/config/webserver1/plugin-cfg.xml on the Web
server computer.
PLGC0048I: The propagation of the plug-in configuration file is complete for the
Web server ibmlabCell01.ibmlabNode01.webserver1.
12. Open /opt/IBM/HTTPServer/Plugins/config/webserver1/plugin-cfg.xml in a text
editor or web browser. Open the copy of plugin-cfg.xml in a separate browser or
text editor. Notice that the Wssamples has been removed from the URI Group.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 19 of 28

Copyright IBM Corporation 2011. All rights reserved.

Task 5: Installing Maintenance Packages

1. Stop all running IBM HTTP Server and WebSphere processes. Execute the
following commands in a command prompt.
1. /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/stopManager.sh
2. /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopServer.sh server1
3. /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopNode.sh
4. The icon for stopping the HTTP server can be found in the start menu under
IBM HTTP Server and it can also be stopped using Windows services.
2. Extract /installationmedia/7.0.0.11-WS-UPDI-LinuxIA32.zip
3. In /installationmedia/7.0.011-WS-UPDI-LinuxIA32/UpdateInstaller run install

4. Accept the terms and conditions. Click next until you get to the install location.
5. Complete the installation.
6. When the installation completes there will be a check box for Launch IBM

Update Installer for WebSphere Software on exit. Make sure that box is
checked then click Finish.
7. The Update Installer will relaunch. Click Next.

8. The Update Installer should automatically find the available software that can be
updated. You should see the following paths in the drop down dialog for
Directory Path:
/opt/IBM/HTTPServer
/opt/IBM/HTTPServer/Plugins
/opt/IBM/WebSphere/AppServer
9. Let's upgrade WebSphere first so select /opt/IBM/WebSphere/AppServer from the dialog
box. Hit next.
10. Select Install Maintenance Package. Click Next.
11. Now you will need to go copy the following files from /installationmedia/ to
/opt/IBM/WebSphere/UpdateInstaller/maintenance.
7.0.0-WS-IHS-LinuxX32-FP0000011.pak
WebSphere Application Server 101
IBM Software Accelerated Value Program

Page 20 of 28

Copyright IBM Corporation 2011. All rights reserved.

7.0.0-WS-PLG-LinuxX32-FP0000011 .pak
7.0.0-WS-WASSDK-LinuxX32-FP0000011.pak
7.0.0-WS-WAS-LinuxX32-FP0000011 .pak
12. Accept the default of /opt/IBM/WebSphere/UpdateInstaller/maintenance for the
maintenance directory.
13. The Update Installer will automatically determine which packages apply to the software
you are upgrading. In the case of WebSphere Application Server the following packages
should be checked.
7.0.0-WS-WAS-LinuxX32-FP0000011.pak
7.0.0-WS-WASSDK-LinuxX32-FP0000011.pak
14. Click next to begin the installation. This process will take 10 15 minutes to complete.
15. When the installation finished make sure you see the green Success message in the top
left corner.
16. Click the Relaunch button to restart the Update Installer and we'll continue with updating
the IHS server and WAS Plugin.
17. This go round we will update the IBM HTTP Server. Select /opt/IBM/HTTPServer as the
Directory Path for Product Selection. Hit next.
18. Select Install Maintenance Package. Hit next.
19. Accept the default of /opt/IBM/WebSphere/UpdateInstaller/maintenance for the
maintenance directory. Hit next.
20. The Update Installer will automatically determine which packages apply to the software
you are upgrading. In the case of IBM HTTP Server the following packages should be
checked.
7.0.0-WS-IHS-LinuxX32-FP0000011.pak
7.0.0-WS-WASSDK-LinuxX32-FP0000011.pak
21. Hit next. If you get a warning about apache running then you'll need to stop IBM HTTP
Server. You can do stop IHS by running /opt/IBM/HTTPServer/apachectl stop and
/opt/IBM/HTTPServer/adminctl stop. Once you reach the Installation Summary screen
select next to begin the upgrade.
22. When the upgrade completes click Relaunch to continue with updating the WebSphere
Application Server Web Server Plug-in.
23. Select /opt/IBM/HTTPServer/Plugins for the path for Product Selection.
24. Select Install Maintenance Package. Hit next.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 21 of 28

Copyright IBM Corporation 2011. All rights reserved.

25. Accept the default of /opt/IBM/WebSphere/UpdateInstaller/maintenance for the


maintenance directory. Hit next.
26. The Update Installer will automatically determine which packages apply to the software
you are upgrading. In the case of IBM HTTP Server the following packages should be
checked.
7.0.0-WS-PLG-LinuxX32-FP0000011 .pak
7.0.0-WS-WASSDK-LinuxX32-FP0000011.pak
27. Click Next to get to the Installation Summary then Next to begin the upgrade.
28. Once the upgrade is complete check for the green Success message in the top left.
Click finish to close the Update Installer.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 22 of 28

Copyright IBM Corporation 2011. All rights reserved.

Task 6: Basic Operations


This section takes a look at some of the commons administrative tasks in WebSphere
Application Server.
Change JVM heap size
Change number of Web Container threads
1. Use the steps outlined in Step 11 - 15 of Task 1 to restart your Deployment
Manger, nodeagent, and server1.
2. The JVM heap size is a property this is commonly altered in new WebSphere

deployments. This property controls the minimum (or initial) and maximum size
of the JVM heap. Using the ISC navigate to server - Application Servers server1 - Java and Process Management - Process Definition - Java Virtual
Machine. Set the following values:
- Initial Heap Size: 128
- Maximum Heap Size: 512
While you are on this page take time to notice the following settings
Verbose garbage collection Many WebSphere customers run with this
enabled even in critical production applications. Verbose GC is an excellent
indicator of server health and is commonly used by IBM Support to diagnose
performance related PMRs. See http://www-01.ibm.com/support/docview.wss?
rs=180&uid=swg21114927
Generic JVM arguments - This field is commonly used to alter the behavior of
the JVM either by performance related to switches or to load third party modules.
Click Apply. The page will refresh then click Save at the top of the screen. This
second Save action is required to save the change to the Master Repository.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 23 of 28

Copyright IBM Corporation 2011. All rights reserved.

3. Some applications require more Web Container threads than others. If you have

ever worked with a Lotus Domino Web Server then you may already be familiar
with this concept. In a Domino Web Server the default number of Web Container
threads is 40. WebSphere has a minimum of 10 and a maximum of 50 for the
default. In some cases IBM recommends setting the minimum and maximum to
be equal. This is done to increase performance. The overhead of creating 50
threads is moved to the startup sequence as opposed to having to create them
on the fly.
Edit the minimum number of Web Container threads to be 50 using the ISC. Go
to Application Servers - server1 - Thread Pools - WebContainer. Change
minimum from 10 to 50. Click apply then save. You would have to restart the
server to make this change take effect.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 24 of 28

Copyright IBM Corporation 2011. All rights reserved.

Task 7: Problem Determination


Knowing how IBM Support troubleshoots a problem will save you time during a crisis
situation. This task will walk you through some of the basic steps to collect diagnostic
information from WebSphere Application Server.
The first thing we will do is produce a Java Thread Dump also known as a Javacore. In
a Unix environment this would be very easy. All you have to do is run a kill -3 on the
PID of WAS. Windows is not that easy so we'll have to do is through wsadmin. You
can use this wsadmin procedure on any platform.
Javacore

1.

Use your web browser to run the snoop servlet


http://localhost:9080/snoop
This will cause a WebContainer thread to be created otherwise the javacore
would not contain the threads we are trying to learn about.

2. Open a terminal (or command line) and change to


/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin. Start the wsadmin
scripting tool by running ./wsadmin.sh
3. You should see the following output during wsadmin.sh startup. Notice that it
connects to the dmgr process. This is expected when running in a Network
Deployment scenario. If this was a standalone environment the connection
would be made to a local server such as server1.
WASX7209I: Connected to process "dmgr" on node ibmlabCellManager01 using
SOAP co nnector; The type of process is: DeploymentManager WASX7029I:
For help, enter: "$Help help"
wsadmin>

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 25 of 28

Copyright IBM Corporation 2011. All rights reserved.

4. Run the following commands at the wsadmin> prompt.


set jvm [$AdminControl completeObjectName
node=ibmlabNode01,type=JVM,process=server1,*]
You should see this output output ->
WebSphere:name=JVM,process=server1,platform=proxy,node=ibmlabNode01,j2eeT
ype=JVM
,J2EEServer=server1,version=6.1.0.23,type=JVM,mbeanIdentifier=JVM,cell=ibmlab
Cel l01,spec=1.0

$AdminControl invoke $jvm dumpThreads


There will be no output for this command unless an error occurs. Now go check in
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01 to see if a javacore was created.
Open the javacore####.txt file.

5. Review the following lines


1CICMDLINE - JVM Command Line
1TISIGINFO - Why the javacore was generated - The user requested it.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 26 of 28

Copyright IBM Corporation 2011. All rights reserved.

6.

Search for WebContainer until you come to the following output. If you were
experiencing a server hang then you would review all of the WebContainer
threads to see if you could find a hung thread or a commonality between several
hung threads. This thread is idle and waiting for work.
3XMTHREADINFO
"WebContainer : 1" (TID:0x14635900, sys_thread_t:0x14A42EF8, state:CW, native
ID:0x00001334) prio=5
4XESTACKTRACE
at java/lang/Object.wait(Native Method)
4XESTACKTRACE
at java/lang/Object.wait(Object.java:231(Compiled Code))
4XESTACKTRACE
at com/ibm/ws/util/BoundedBuffer.waitGet_(BoundedBuffer.java:191(Compiled
Code))
4XESTACKTRACE
at com/ibm/ws/util/BoundedBuffer.take(BoundedBuffer.java:555(Compiled Code))
4XESTACKTRACE
at com/ibm/ws/util/ThreadPool.getTask(ThreadPool.java:817(Compiled Code))
4XESTACKTRACE
at com/ibm/ws/util/ThreadPool$Worker.run(ThreadPool.java:1480)

Here is an actual example of a production server thread:


3XMTHREADINFO
"WebContainer : 111" (TID:0x30547768, sys_thread_t:0x5E57E228, state:MW, native ID:0xB459)
prio=5
4XESTACKTRACE
at com.ibm.ejs.ras.SharedLogWriter.logMessage(SharedLogWriter.java(Compiled Code))
4XESTACKTRACE
at com.ibm.ejs.ras.SharedLogWriter.processEvent(SharedLogWriter.java(Compiled Code))
4XESTACKTRACE
at
com.ibm.ws.logging.cbe.CBEWsHandlerAdapter.processEvent(CBEWsHandlerAdapter.java(Compiled Code))
4XESTACKTRACE
at com.ibm.ws.logging.WsHandlerWrapper.publish(WsHandlerWrapper.java(Compiled Code))
4XESTACKTRACE
at java.util.logging.Logger.log(Logger.java(Compiled Code))
4XESTACKTRACE
at com.ibm.ejs.ras.Tr.logToJSR47Logger(Tr.java(Compiled Code))
4XESTACKTRACE
at com.ibm.ejs.ras.Tr.fireEvent(Tr.java(Compiled Code))
4XESTACKTRACE
at com.ibm.ejs.ras.Tr.logJrasEvent(Tr.java(Compiled Code))
4XESTACKTRACE
at
com.ibm.websphere.ras.WsJrasMessageLogger.logTextMessageToTr(WsJrasMessageLogger.java(Compiled Code))
4XESTACKTRACE
at
com.ibm.websphere.ras.WsJrasMessageLogger.textMessage(WsJrasMessageLogger.java(Compiled Code))

We can't tell if this thread is hung unless we collect multiple javacores back to
back. This will be a common request from IBM Support. Generally you will run
three javacores with 2 minutes in between each one.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 27 of 28

Copyright IBM Corporation 2011. All rights reserved.

Enabling Trace
Open the ISC at http://localhost:9060/admin
Expand the Troubleshooting section then click on Logs and Trace
Select server1
Select Diagnostic Trace
Make sure that Enable Log is checked then click Change Log Detail Levels
Expand com.ibm.ws.*
Find com.ibm.ws.security.* in this list, click the name and a menu should
appear. Select All Messages and Traces.
8. Scroll back to the top of the screen. The box at the top should now contain this
string
*=info: com.ibm.ws.security.*=all
9. Click apply at the bottom of the screen then save at the top of the screen.
10. Expand System Administration then select Nodes.
11. Synchronize ibmlabNode01
12. Now Expand Servers then select Application Servers. Stop and Start server1.
13. After you initiate the start process browse to
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1. Notice that
trace.log has appeared.
14. The trace we enabled is very verbose and will generate a 2.5MB file just from
startup. In this exercise we won't go too deep into reading the trace, we'll leave
that for support engineers. One thing that may come in handy when reviewing a
trace.log is make sure that the correct trace was enabled. When the server
starts it will output the current trace string. You should see this line as the first
line following the log header in your file.
1.
2.
3.
4.
5.
6.
7.

[3/17/10 12:23:10:740 CDT] 0000000a ManagerAdmin I TRAS0017I: The


startup trace state is *=info:com.ibm.ws.security.*=all.
When collecting trace for IBM Support you may want to verify the server is using
the correct trace before sending in your logs.
If you are interested in debugging a problem yourself you can find all of the
relevant trace strings in the manual data collection section of MustGather
technotes. Just do a web search for IBM MustGather.

WebSphere Application Server 101


IBM Software Accelerated Value Program

Page 28 of 28

Potrebbero piacerti anche