oracle / coherence-visualvm

The Coherence-VisualVM Plugin provides management and monitoring of a single Coherence cluster using the VisualVM management utility.
Other
11 stars 9 forks source link
coherence management visualvm visualvm-plugin

Coherence VisualVM Plugin

Coherence CE

CI Build Release Sonarcloud

The Coherence-VisualVM Plugin (the Plugin) provides management and monitoring of a single Coherence cluster using the VisualVM management utility.

The Plugin aggregates Coherence MBean data and shows a concise operational view of a single Coherence cluster. Some management information is presented over time, which allows real-time analysis and troubleshooting. You can connect to clusters via JMX or via management over REST with Coherence versions 12.2.1.4 or above.

The Plugin is an ideal tool for monitoring and managing Coherence clusters during the development and testing lifecycle and supports connecting to both Community Edition and Commercial versions of Coherence.

NOTE: The most current version of the Plugin requires VisualVM release 2.1 or later which is available from https://visualvm.github.io/.

Coherence VisualVM Plugin

Table of Contents

  1. Supported Coherence Versions
  2. Installation
  3. Connecting to a Coherence Cluster
  4. Changing the Plugin Behaviour via the Options Tab
  5. Monitoring Capabilities
  6. Using Coherence with the Tracer framework
  7. Building the Plugin

Supported Coherence Versions

The Plugin will connect to and display data for the following Coherence versions:

Note: If you wish to connect to Coherence version 12.2.1.4.x via REST you should have Coherence version 12.2.1.4.7 or greater.

Note: Support for versions older than Commercial Edition 3.7, and Community Edition 21.12 is now deprecated and no longer supported. The plugin may still work with these older versions, but is not guaranteed to continue to. Please upgrade to the latest Coherence versions available for continued support.

Installation

The Coherence VisualVM Plugin is available from the list of plugins in VisualVM versions 2.0.6 and above.

Note: It is recommended to install VisualVM version 2.1.5 or later. This will ensure you can install the most up-to-date Coherence Plugin.

To install the Plugin carry out the following:

  1. Choose Tools -> Plugins from the main menu.
  2. The Plugin will be displayed as VisualVM-Coherence. If it is not present in the list then click on the Check for Newest button
  3. In the Available Plugins tab, select the Install checkbox for the VisualVM-Coherence. Click Install.
  4. Step through and complete the plugin installer.

Coherence VisualVM Plugin Install

Note: If you already have an older version of the plugin installed, click on Check For Newest and follow the prompts.

For more information about using the Coherence VisualVM plugin see the official Coherence Documentation.

Other useful resources:

Connecting to a Coherence Cluster

1. Connecting Directly to a Process

Once the Plugin is installed, you can double-click on a Coherence process in the left pane, usually com.tangosol.net.DefaultCacheServer, after which a Coherence tab will be displayed.

2. Connecting via Management over REST

You can also connect via Coherence Management over REST by right-clicking on the Coherence Clusters tree item and choose Add Coherence Cluster.

Provide a name for the cluster and use the following URL based upon what type of cluster you are connecting to:

  1. Standalone Coherence - http://<host>:<management-port>/management/coherence/cluster

  2. WebLogic Server - http://<admin-host>:<admin-port>/management/coherence/<version>/clusters - You can use latest as the version.

Note: To enable Management over REST for a stand-alone cluster, please see the Coherence Documentation

3. Connecting to Coherence in WebLogic Server via the Admin Server

If you have Coherence running within WebLogic Server using the Managed Coherence Servers functionality you can either connect via REST as described above or if you want to connect to the domain runtime MBean server, use the instructions below.

  1. Ensure you have the same version of WebLogic Server installed locally as the instance you are connecting to.

  2. Use the following (on one line) to start VisualVM replacing WLS_HOME with your WebLogic Server home.

    /path/to/visualvm --cp WLS_HOME/server/lib/wljmxclient.jar:WLS_HOME/server/lib/weblogic.jar
      -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
      -J-Dcoherence.plugin.visualvm.disable.mbean.check=true

    Note: On a Mac, the default VisualVM installed is usually /Applications/VisualVM.app/Contents/MacOS/visualvm. For Windows ensure that you use visualvm.exe and change the / to \ and change the classpath separator from : to ;.

  3. From the VisualVM Applications tree, right-click Local and select Add JMX Connection. The Add JMX Connection dialog box displays.

  4. Use either of the following connect strings depending upon the WebLogic Version you are connecting to.

    For WebLogic Server 14.1.1.X and above use t3 protocol:

    service:jmx:t3://hostname:port/jndi/weblogic.management.mbeanservers.domainruntime

    For WebLogic Server 12.2.1.5 and below use iiop protocol:

    service:jmx:iiop://hostname:port/jndi/weblogic.management.mbeanservers.domainruntime

    Note: in WebLogic Server 14.1.1.x and above the wljmxclient.jar no longer exists and will be ignored in the classpath. You may remove it from the above --cp statement if you like.

  5. Click Use security credentials and enter the WebLogic Server username and password.

  6. Check Do not require SSL connection if your connection is not SSL and select Connect Immediately.

  7. Right-Click on the connection and select Open. The Coherence tab will be displayed.

    If you wish to secure access to the REST endpoints or via JMX, please refer to either the Coherence Documentation or relevant JMX security documentation.

Changing the Plugin Behaviour via the Options Tab

In the VisualVM Plugin, you can change the behaviour of the plugin by using the Options pane. To open the options choose the following depending upon your platform:

  1. Mac: VisualVM -> Preferences and select the Coherence tab.

  2. Windows/Linux: Tools -> Options and select the Coherence tab.

You will see the preferences as shown below:

Coherence CE

There are tool tips for each of the preferences, but a summary is shown below.

Coherence VisualVM Preferences

Preference Default Usage
Data Refresh Time 30 Time (in seconds) between refreshing data from the cluster. Do not set too low as this could adversely affect performance in large clusters.
Log Query Times false Enables logging of query times to the VisualVM logfile when retrieving data.
Disable MBean Check false Disables the MBean check when connecting to WebLogic Server. This allows the plugin to startup without checking for Cluster MBean.
REST Request Timeout 30000 The request timeout (in ms) when using REST to connect to a cluster.
Enable REST Debug false Enables HTTP request debugging when using REST to connect to a cluster.
Disable SSL Certificate Validation false If selected, will disable SSL certificate validation. Note: You should only use this option when you are sure of the identity of the target server.
Enable Persistence List true Enables dropdown list of snapshots rather than having to enter the snapshot when performing snapshot operations.
Enable Zoom on Graphs false Enables additional zoom function for all graphs.
Enable Cluster Snapshot tab false Enables experimental Cluster Snapshot tab. This tab is useful for seeing all the relevant cluster information on one page in a text format.
Enable Cluster Heap Dump false Enables the cluster heap dump button on the Cluster Overview tab.
Analyze Unavailable Time in LogFile Provides the ability to analyze log files where Partition Events Logging has been enabled for logs generated from Coherence versions 21.06 and above. See here for more details. Note: You select a Coherence log file to analyze and don't need to be connected to a running cluster.

Monitoring Capabilities

For all Coherence clusters, the following tabs are displayed:

Depending upon the edition and functionality you are using, the following optional tabs may be displayed:

Using Coherence with the Tracer framework

Version 1.7.0 of the Coherence VisualVM Plugin introduces initial integration with the VisualVM Tracer framework.

From the VisualVM website:

The VisualVM Tracer framework provides detailed monitoring and analyzing Java applications. Using various probes, the Tracer gathers metrics from an application and displays the data in a timeline. The data are displayed both graphically and in a table and can be exported to common formats for further processing by external tools.

After installation, when you connect to a cluster via JMX, you will see the Tracer tab as shown below:

Tracer Tab

There are a number of expandable groups allowing you to choose Coherence related probes to display on the timeline including:

To start recording tracer data, select the tracer probes that you wish to display and click Start.

Note: The data displayed is the same as is display on the various Coherence tabs.

Tracer Tab

Building the Plugin

If you wish to build the Plugin from scratch please follow the instructions below.

Pre-requisites

You must have the following:

  1. Java JDK 11 Only - To build and test the plugin
  2. Maven 3.6.3+
  3. Git

Clone the Repository

  1. Clone the Coherence VisualVM repository

    git clone https://github.com/oracle/coherence-visualvm.git

Build the VisualVM Plugin

  1. Ensure you have JDK11 or above in your PATH.

  2. Build the Plugin

    From the coherence-visualvm directory:

    mvn clean install -DskipTests

    If you wish to run the Community Edition tests then leave out the -DskipTests.

  3. Install the Plugin

    The plugin will be available in the location coherence-visualvm-plugin/target/coherence-visualvm-plugin-{version}.nbm

    Follow the instructions here to install the plugin manually.

Contributing

This project is not accepting external contributions at this time. For bugs or enhancement requests, please file a GitHub issue unless it’s security related. When filing a bug remember that the better written the bug is, the more likely it is to be fixed. If you think you’ve found a security vulnerability, do not raise a GitHub issue and follow the instructions in our security policy.

Security

Please consult the security guide for our responsible security vulnerability disclosure process

License

Released under the GNU General Public License (GPL)