http://blog.akquinet.de/2012/11/01/connecting-visualvm-with-a-remote-jboss-as-7-eap6-jvm-process/
VisualVM is a useful tool for monitoring and simple profiling of JVM processes. It integrates various command line tools of the JDK such as jstat, jinfo, jstack into a graphical UI. The tool is part of the JDK since 1.6.0_07.
VisualVM discover local and remote JVM processes. There are two different way to connect a remote host and JVM processes:
- jstatd connection
- jmx connection
To auto discover remote processes it is necessary to start a jstat daemon with the appropriate security policy for native permissions. But this is out of scope in this post. We will cover and explain how to create a JMX connection to an EAP6 instance or respectively a JBoss AS7 instance with VisualVM. This has also the benefit, that we can use more capabilities of VisualVM and we get more information for profiling.
Connecting a remote EAP6 / AS7 JVM process
Connecting VisualVM to a remote EAP6 / AS7 JVM process is quit easy. The application server supports the JMX Remote API for remote management and monitoring (JSR 160). Therefor, JBoss implements a JSR 160 compliant JMXConnector instead of an RMI interface to establish a connection to a JMX MBeanServer form a remote client. There is no need for any additional JVM options. The JMXConnector uses under the hood JBoss Remoting for the transport and by default the native management endpoint of the AS7 if the server is running in the standalone mode. To access the management endpoints a management user in the realm ManagementRealm is required. If no user exists, you can use the add-user script from the EAP6 / AS7 distribution. You can create a user as follows:
$JBOSS_HOME/bin/add-user.sh username password
If you are running your server or multiple server instances in the domain mode the JMXConnector uses the remoting connector. To establish a connection over the remoting connector a user in the realm ApplicationRealm is required. You can create a user for the ApplicationRealm with the option -a as follows:
$JBOSS_HOME/bin/add-user.sh -a username password
The configuration is located in the JMX subsystem. You can use the command line interface (CLI) of the application server to see a full description of all possible configurations:
$JBOSS_HOME/bin/jboss-cli.sh
[disconnected /] connect --controller
...
[standalone@hostname:9999 /] /subsystem=jmx :read-resource-description(recursive=true)
Note that the management interface must be accessible in both modes from a remote client. You can bind the management interfaces at server startup by setting this system property:
Standalone Mode
$JBOSS_HOME/bin/standalone.sh –Djboss.bind.address.management=
Domain Mode
$JBOSS_HOME/bin/domain.sh –Djboss.bind.address.management=
Starting VisualVM with the necessary libraries to connect JMX over JBoss Remoting
As already mentioned before, the JMX MBeanServer is accessible using JBoss Remoting through the management connection. Therefore, it is necessary to add the following libaries from the modules directoriy of the EAP6 / AS7 distribution to the classpath of VisualVM:
- org/jboss/remoting3/remoting-jmx
- org/jboss/remoting3
- org/jboss/logging
- org/jboss/xnio
- org/jboss/xnio/nio
- org/jboss/sasl
- org/jboss/marshalling
- org/jboss/marshalling/river
To start VisualVM, you can also use the attached script and copy it into the bin directory of the EAP6 / AS7 distribution.
$JBOSS_HOME/bin/visualvm.sh
Configure VisualVM for a remote connection
The next step is to add a Remote Host as shown in the following screenshots of VisualVM.
After that you need to configure a JMX connection as shown in the screenshot below. We need to use a JMX Service URL to identify the JSR-160 compliant JMXConnectorServer of the AS7 to establish a connection from VisualVM with the form service:jmx:PROTOCOL://IP:PORT.
The service URL begins always with service:jmx: followed by the protocol, host and port. The protocol is JBoss specific and named remoting-jmx. If you are running the server in the standalone mode the default port of the native management interface is 9999. The default port of the remoting connector in the domain mode is 4447 plus port offset, if configured.
For authentication the credentials of the management user in standalone mode or the credentials of the application user in domain mode are required.
After a successful connection via JMX, you should see the following screen.
相关推荐
SAP Process Orchestration The Comprehensive Guide, 2nd Edition SAP流程编制综合指南 1 Introduction to SAP Process Orchestration 1.1 Historical Overview and Evolution 1.1.1 SAP Process Integration ...
在Delphi 7开发环境中,如果你使用Indy 9组件进行网络通信并希望实现SSL(Secure Sockets Layer)加密,那么必须了解如何正确地集成OpenSSL库。标题中提到的"Delphi7 indy9 ssl使用的两个动态库"指的是OpenSSL的两个...
New features include: - Virtual machine connect-to-console support - Smart groups - Support for credential encryption with certificates - Windows 8 remote action support - Support for Windows 8, ...
delphi7 indy9 接口调用解决这2个问题(17个版本):“cound not load ssl library 、 error connecting with ssl”
Copying a local file into Outlook (running in a remote session) now adds the file as an attachment. Fixed an issue that was slowing down pasteboard-based file transfers if the files originated from a ...
在本案例中,我们关注的是如何在Delphi7中使用Indy进行此类操作,并确保所有必要的DLL已正确引入。 首先,Indy的核心是IdHTTP组件,它负责发送HTTP请求。为了支持HTTPS,我们需要导入两个关键的DLL:libeay32.dll ...
static const GUID IID_ITraceServiceManager={0x6d14efe6,0x892a,0x4a48,0x0092,0xc9,0xdb,0xea,0x92,0xdd,0xd5,0x13}; #else #define VER_ITraceServiceManager INTERFACE_VERSION(1,1) static const GUID IID_...
static const GUID IID_ITraceServiceManager={0x6d14efe6,0x892a,0x4a48,0x0092,0xc9,0xdb,0xea,0x92,0xdd,0xd5,0x13}; #else #define VER_ITraceServiceManager INTERFACE_VERSION(1,1) static const GUID IID_...
Copying a local file into Outlook (running in a remote session) now adds the file as an attachment. Fixed an issue that was slowing down pasteboard-based file transfers if the files originated from a ...
static const GUID IID_ITraceServiceManager={0x6d14efe6,0x892a,0x4a48,0x0092,0xc9,0xdb,0xea,0x92,0xdd,0xd5,0x13}; #else #define VER_ITraceServiceManager INTERFACE_VERSION(1,1) static const GUID IID_...
static const GUID IID_ITraceServiceManager={0x6d14efe6,0x892a,0x4a48,0x0092,0xc9,0xdb,0xea,0x92,0xdd,0xd5,0x13}; #else #define VER_ITraceServiceManager INTERFACE_VERSION(1,1) static const GUID IID_...
static const GUID IID_ITraceServiceManager={0x6d14efe6,0x892a,0x4a48,0x0092,0xc9,0xdb,0xea,0x92,0xdd,0xd5,0x13}; #else #define VER_ITraceServiceManager INTERFACE_VERSION(1,1) static const GUID IID_...
static const GUID IID_ITraceServiceManager={0x6d14efe6,0x892a,0x4a48,0x0092,0xc9,0xdb,0xea,0x92,0xdd,0xd5,0x13}; #else #define VER_ITraceServiceManager INTERFACE_VERSION(1,1) static const GUID IID_...
drozer is able to maximise the permissions available to it by installing a full agent, injecting a limited agent into a running process, or connecting a reverse shell to act as a Remote Access Tool ...
It is meant as a description of the project, with an overview of how the different processes are executed. It is an introduction to how the FreeBSD project works. The FreeBSD project model will be ...
(This is a little bit of a white lie, as modern routers sometimes act as firewalls or caching components, and process Transport layer as well.) Link layer switches process link and physical layers ...
Using QTextBrowser as a Simple Help Engine Using Qt Assistant for Powerful Online Help Part III: Advanced Qt Chapter 18. Internationalization Working with Unicode Making Applications ...