|
| Problem | This document discusses the usage of the DrAdmin utility with the WebSphere Application Server. | | | | Solution | What is DrAdmin?DrAdmin is a service, provided by each of the servers, to enable and disable tracing. Each time a server starts, DrAdmin registers itself on a different port number, using the next available port. There are no output messages associated with DrAdmin. The DrAdmin entries in the console messages area are generated to tell users the port number where DrAdmin is listening.
Tech Note:How to define a static "Dr Admin" port for the Admin Server and Application Server(s)/Clone(s) http://www-1.ibm.com/support/docview.wss?uid=swg21141446 When to use DrAdmin?You should always use the administrative console trace facilities to debug a problem. DrAdmin is a diagnostic tool to be used when you have no other choices. It was designed to provide IBM support personnel with another way of obtaining traces. Use DrAdmin in these situations only:
When input to the administrative console is not accepted
When the administrative server is in a wait state
When the administrative server is not responding (e.g., in an infinite loop or hung state)
When you have to dump the thread stacks in a server
When the administrative client topology tree disappears DrAdmin trace function:The DrAdmin interface is the same on all platforms. Since DrAdmin is another way of turning on a trace, the tracing mechanism is the same as the one used by the administrative console trace facilities.
To specify the DrAdmin trace output in the admin.config file:
In the admin.config file located in the <WAS_HOME>\bin directory, append the following property where the file name consists of an absolute path and the file that you want to create:
com.ibm.ejs.sm.adminServer.traceOutput=<filename>
Restart the administrative server. The trace file specified in the admin.config file should be created during startup of the administrative server. The administrative server might not start if the path specified for file name does not exist, or if the directory permissions where the trace file is to be created, are incorrect or insufficient.If the administrative server starts but the trace file is not created, ensure the traceOutput parameter in the admin.config file is correct, and the path to the file exists. DrAdmin thread dumps:
The DrAdmin function generates thread dumps.
UNIX:
The IBM JDK allows users to send signals to force javacore.txt files to be created in the application server's working directory. The application server continues to run and a sequence of javacore files are created. These files can help in debugging "loop" or "system hang" problems.
Windows:
To generate thread dumps similar to the javacore files, especially on a Windows NT platform, use the DrAdmin function.A unique DrAdmin port is generated each time an application server starts.
To generate a thread dump for that port:
1. View the console messages area or the trace file for message SMTL0018I "DrAdmin available on port."
2. Enter the following command:
DrAdmin <port number> -dumpThreads
3. Review the stderr log for the thread dump. How to find the DrAdmin port:The next step is to identify the port number for either the administrative server or a application server. The port number is different for the administrative server and each of the application server(s). The port number values are contained in the standard out files for each of these processes. Information on how to find these files and the port number are described below.
After starting the administrative server, you should obtain the DrAdmin port number within the .\logs\tracefile file inside the message:
DrAdmin available on port xxxx
After starting the application server (for example, default server), you should obtain the DrAdmin port number provided in the standard output file for the application server. The message within the file containing the port number is:
DrAdmin available on port xxxx How to locate the thread dump:
The administrative server thread information is placed in .\logs\adminserver_stderr.log file. Because this file is not closed, it's length of 0 will not change. The application server thread information is placed in the standard error file.
In order to view the thread information, copy the above files into a new file. Edit the new file with an HTML editor, which will display the thread information. Some editors (that is, emacs and vi) will allow you to view the thread information directly from the .\logs\adminserver_stderr.log file or the standard error file.
For Application Server thread dump review the corresponding stderr log. How to invoke DrAdmin in WebSphere V3.5.x:
1. Go to the <WAS_HOME>\bin\debug> directory
2. Copy adminserver.bat/sh to DrAdmin.bat/sh
3. Replace the following line in the DrAdmin.bat/sh file:
%JAVA_HOME%\bin\java -mx128m com.ibm.ejs.sm.server.AdminServer -bootFile %WAS_HOME%\bin\admin.config %restart% %1 %2 %3 %4
with
%JAVA_HOME%\bin\java com.ibm.ejs.sm.util.debug.DrAdmin %1 %2 %3 %4 %5 %6 %7 %8 %9
4. Save and close the DrAdmin.bat/sh file
5. From a command prompt in the <WAS_HOME>\bin\debug> directory, type DrAdmin [options] where options are:
-help [shows the help message]
-serverHost <Server host name> [Specify the host name of the server... defaults to local host]
-serverPort <Server port number> [Required... enter the port number where DrAdmin is listening]
-setTrace <Trace specification> [Specify any valid traceString, for example, "com.ibm.ejs.sm.*=all=enabled"]
-setRingBufferSize <Number of ring buffer entries in k> [Specify the number of trace entries to store in the main memory buffer... the default is 8k]
-dumpRingBuffer <Name of file to dump the ring buffer> [Defaults to file name JMONDump.xxxxxxxxxxxx where xxxxxxxxxxxx is a combination time of day and unique PID identifier extension] NOTE: On Windows NT, if the administrative server is started as a service, the default DrAdmin dump file will be located in the <Winnt\system32> directory. -dumpState <dumpString> [Specify a unique identifier for this dump]
-stopServer [Stops the administrative server]
-stopNode [Does not apply unless the node is connected to the administrative server]
-dumpThreads [Dumps the threads in the server]
How to invoke DrAdmin in WebSphere V4.0.x:In WebSphere V4.0.x the DrAdmin.bat/sh file exists in <WAS_HOME>/bin directory.
How to collect a Thread Dump:
A. Application Server
From a command prompt situated at the location of the DrAdmin file (see version specific locations above), type in the following command:
DrAdmin -serverHost <Node Name> -serverPort <port#> -dumpThreads
where <port#> is the port number that DrAdmin is listening on. Example:
DrAdmin -serverHost MyHostServer -serverPort 3685 -dumpThreads
This command will then dump the threads (Java thread information) information to the standard error file, which by default is <WAS_HOME>/logs/Application_Server_stderr.log
B. Admin Server
From a command prompt situated at the location of the DrAdmin file (see version specific locations above), type in the following command:
DrAdmin -serverHost <Node Name> -serverPort <port#> -dumpThreads
Example:
DrAdmin -serverHost MyHostServer -serverPort 3678 -dumpThreads
This command will then dump the threads (Java thread information) information to the standard error file, which by default is the adminserver_stderr.log in the <WAS_HOME>/logs directory. How to collect Traces:
A. Application Server during hung state
1. Set the Trace
From a command prompt situated at the location of the DrAdmin file (see version specific locations above), type in the following command:
DrAdmin -serverHost <Node Name> -serverPort <port#> -setTrace "com.ibm.ejs.sm.*=all=enabled"
Example:
DrAdmin -serverHost MyHostServer -serverPort 3685 -setTrace "com.ibm.ejs.sm.*=all=enabled" 2. Dump the Trace
From the same command prompt location issue the dump command:
DrAdmin -serverHost <Node Name> -serverPort <port#> -dumpRingBuffer <WAS_HOME>\logs\AppServer_sm_trace.txt
Example:
DrAdmin -serverHost MyHostServer -serverPort 3685 -dumpRingBuffer e:\was40\bin\logs\AppServer_sm_trace.txt B. Admin Server during hung state
1. Set the Trace
From a command prompt situated at the location of the DrAdmin file (see version specific locations above), type in the following command:
DrAdmin -serverHost <Node Name> -serverPort <port#> -setTrace "com.ibm.ejs.sm.*=all=enabled"
Example:
DrAdmin -serverHost MyHostServer -serverPort 3678 -setTrace "com.ibm.ejs.sm.*=all=enabled" 2. Dump the Trace
From the same command prompt location issue the dump command:
DrAdmin -serverHost <Node Name> -serverPort <port#> -dumpRingBuffer <WAS_HOME>\logs\AdminServer_sm_trace.txt
Example:
DrAdmin -serverHost MyHostServer -serverPort 3678 -dumpRingBuffer e:\was40\bin\logs\AdminServer_sm_trace.txt | | | | |
| |
|
Product categories: Software, Application Servers, Distributed Application & Web Servers, WebSphere Application Server, General Operating system(s): Multi-Platform Software version: 3.5, 4.0 Software edition: Advanced Reference #: 1141474 IBM Group: Software Group Modified date: 2003-11-16
(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.
|