Files Prepare Deploy Troubleshooting Related Topics
Managed Coherence Servers provide a tight integration between Weblogic Server and Coherence, allowing for a simplified and streamlined development and management environment for distributed applications. The functionality allows you to build a new archive type, called a Grid Archive (GAR), which can be deployed and managed on WebLogic Server in a manner similar to other Java EE artifacts. Developers can now streamline their build artifacts to generate GARs, and the operations departments can have a standardized way of deploying Coherence in test and production environments.
This example shows how to perform a thread dump for managed Coherence servers in a WebLogic domain. A thread dump is a snapshot of the state of all threads that are running as part of a Managed Server. This information is useful when trying to diagnose problems with an application.
The example uses a WLST script that can be run against a WebLogic cluster that contains storage-enabled and disabled Coherence members.
Directory Location: @EXAMPLES_HOME/examples/src/examples/coherence/managed-coherence-servers/common/resource/wlst
File | Description |
---|---|
coherence_thread_dump.py | WLST script that, after copied to the ORACLE_HOME/wlserver/common/wlst directory, effects a thread dump based upon a number of arguments passed. |
Before working with this example, install Oracle WebLogic Server, including the examples, if you have not already done so.
Copy the coherence_thread_dump.py
file from the @EXAMPLES_HOME/examples/src/examples/coherence/managed-coherence-servers/common/resource/wlst
directory to the ORACLE_HOME/wlserver/common/wlst
directory. This file contains the WLST functions that must be made available to the other WLST scripts in this example.
To run this example, you must have an existing WebLogic Server environment configured with Coherence. Your environment must have a Coherence cluster defined, with one or more Managed Servers associated with that cluster. If you do not have an environment available, you can use the environment that is created by building and running the multi server Coherence example, which is described in Managed Coherence Servers - Multi Server. See Prepare the Example for information about how to build and run the multi server example.
After you have set up the environment for running the example, complete the steps in Deploy the example.
The coherence_thread_dump.py
script makes the following WLST function available for use:
coherenceThreadDump(dumpDirectory, targetName='All' ,targetType='ManagedServer')
This function has the following arguments:
Argument | Description |
---|---|
dumpDirectory |
(Required) Name of the directory to contain the thread dumps. For example, /home/oracle . |
targetName |
Represents the name of the target on which the the thread dump is run. The target is a Managed Server, WebLogic cluster, or Coherence cluster, depending on the targetType specified. |
targetType |
Type of target on which to run the thread dump. This argument can be specified as one of the following:
|
To deploy the example, complete the following steps:
ORACLE_HOME/wlserver/server/bin
directory, where ORACLE_HOME
represents the central support
directory for all WebLogic products installed on your machine. For example, C:\Oracle\Middleware
.. ./setWLSEnv.sh
setWLSEnv.cmd
java weblogic.WLST
connect()
connect
command, WLST prompts you for the host name and listen address of the server to which you want to connect, the administrator username, and the administrator password.coherenceThreadDump('directory')
directory
represents the path to an existing directory on your machine in which the thread dump file is to be created. For example, C:\home\coherence
.
coherence_thread_dump.py
script, a thread dump is created on all Managed Servers. Output similar to the following is displayed:The Thread Dump for server ms1 has been successfully written to /home/coherence/ms1_threaddump.txt ****************************** All thread dumps completed. Managed server AdminServer, thread dump=/home/coherence/AdminServer_threaddump.txt Managed server storage2, thread dump=/home/coherence/storage2_threaddump.txt Managed server storage2, thread dump=/home/coherence/storage1_threaddump.txt Managed server client2, thread dump=/home/coherence/client2_threaddump.txt Managed server client1, thread dump=/home/coherence/client1_threaddump.txtThe dump files are named
ServerName_threaddump.txt
in the directory specified.
Note: The thread dump is also sent to stdout because this is the default
behavior for the threadDump()
WLST command.
coherenceThreadDump('/home/coherence','storage1')
coherenceThreadDump('/home/coherence','StorageTier','WebLogicCluster')
coherenceThreadDump('/tmp','MyCoherenceCluster','CoherenceCluster')The preceding command also invokes the Coherence
ClusterMBean.logCLusterState()
method, which dumps threads to the server logs and dumps Coherence ouststanding poll information as well.
(Internet connection required.)
Copyright © 2012, 2020, Oracle and/or its affiliates. All rights reserved.