`

jconsole远程jboss

    博客分类:
  • jmx
 
阅读更多
https://community.jboss.org/wiki/UsingJconsoleToConnectToJMXOnAS7

Using jconsole to connect to JMX on AS7
版本 12  
创建于: 2012-1-13 上午5:45 作者 Darran Lofthouse - 最后修改:  2013-4-11 下午10:37 作者 chrismiami
This article describes how to connect to the JBoss AS7 JMX MBeanServer from jconsole.

For the management of JBoss AS7 we expose access to the management operative over a native interface build on top of JBoss Remoting, as of the 13th January 2011 we also provide a JSR-160 connector with JBoss AS7 to make JMX remotely accessible over the same Remoting connection.  The first release to contain this will be JBoss AS 7.1.0.Final.

As we are using the same Remoting connection as the management interface the same security mechanisms that are used for domain management will be used for accessing JMX so this article describes how to achieve this with jconsole.

In JBoss AS 7.1.2 forward, this Remoting connection is also used to allow the integrated CLI GUI to send commands to a standalone AS server or domain controller.

Starting JConsole

In order to connect to the JMX MBeanServer using Remoting we have created a new JSR-160 connector, so that this can be used with jconsole the ClassPath being used by jconsole needs to be updated to include the additional classes - so that users do not need to manually construct these class paths we have included a jconsole.sh and jconsole.bat script within the AS7 distribution which will construct the correct ClassPath before starting jconsole.

NOTE: If you are running jconsole on a machine different than the server you need to have a local JBoss installation: the Java JRE's jconsole will not work out of the box (i.e., without additional jars in the classpath).  In addition, if you are on a remote machine and the target machine is not in DNS, you'll have to add it to your hosts file.


Before running these scripts you should ensure that the JAVA_HOME environment variable has been set to point to your Java installation, this is required as a couple of jars within the distribution but not normally on the classpath are required and to also delegate to the original jconsole executable after the new classpath has been constructed.

After running the JBOSS_HOME/bin/jconsole.sh (linux) or JBOSS_HOME/bin/jconsole.bat (windows) script you should be prompted with the usual connect dialogue: -


To connect to JMX the URL entered should be in the format

service:jmx:remoting-jmx://{host_name}:{port}

Standalone mode

where {port} is the native management interface of the AS7 installation being monitored (default=9999).

Domain mode

where {port} is the JMX subsystem interface of the AS7 installation being monitored (first server=4447, port-offset=150 next server).

Manual changes in Jboss-7.1.0.Final in domain.xml -thanks to https://community.jboss.org/thread/196236

<subsystem xmlns="urn:jboss:domain:jmx:1.1">
   <show-model value="true"/>
   <remoting-connector use-management-endpoint="false"/>
</subsystem>

Both modes

Outside localhost you have to set -Djboss.bind.address.management or inside xml (standalone.xml / host.xml).

Once connected the capabilities provided by jconsole can be used as normal.

Authentication

The connector is making use of JBoss Remoting to communicate with the server, for this reason the exact same authentication mechanisms as are used by the CLI will apply here.

Local

For processes running local to the AS7 installation we support a local authentication mechanism which allows clients to verify their identity by sharing a token on the filesystem with the server - this mechanism runs silently without any further user interaction required.

Username / Password

Where local authentication is not possible such as if the client is running as a different user than the AS7 process or is running on a remote installation by default the next mechanism to be used is username / password based.  Where this mechanism is used the username and password of a user in the ManagementRealm if using the default management connector (port 9999) or in the ApplicationRealm if using the remoting connector (port 4447) should be supplied in the boxes on the 'New Connection' screen before the 'Connect' button is clicked.

The $JBOSS_HOME/bin/add-user.sh (Linux) or $JBOSS_HOME/bin/add-user.bat (Windows) scripts can be used to add these users. Make sure to choose between Management User and ManagementRealm vs Application User and ApplicationRealm depending on whether you're using the default management connector or the remoting connector (usually used with domain mode or when connecting remotely).

TLS

Where the management interface has been configured with a keystore jconsole will need to be configured to use a trust store so that the connection can be verified.

A trust store can be specified by editing the jconsole script and adding the following properties: -

  -J-Djavax.net.ssl.trustStore=client.truststore -J-Djavax.net.ssl.trustStorePassword=truststore_password

The first property specifies the location of the truststore and the second property is the password to open it.

Please note that the properties are prefixed -J-D and not just -D, this is so that the jconsole executable will pass them to the underlying JVM that runs the console.

A keystore can also be specified in a similar way by editing the script and adding the following two properties: -

-J-Djavax.net.ssl.keyStore=client.keystore -J-Djavax.net.ssl.keyStorePassword=keystore_password

As before please note the -J-D form to specify the properties so the values are passed to the JVM.

Provided that the server is configured the authenticated based on the clients certificate the certificate in the keystore can now be used for authentication without needing to specify a username and password.






//=======

guys the procedure how to run jconsole in AS7.1 is described here https://community.jboss.org/wiki/UsingJconsoleToConnectToJMXOnAS7

please note that you need to run console via script that is provided in JBOSS_HOME/bin/jsonsole.bat/.sh
for AS7.1 you don't to add any additional configuration, just connect to port 9999 and that is it.

url for connecting to localhost is "service:jmx:remoting-jmx://localhost:9999" and user & password that you use to login into web console or other management interfaces.


分享到:
评论

相关推荐

    Jprofile资料——使用JConsole实现JBoss性能监控

    在JBoss的配置文件(通常是`standalone.xml`或`domain.xml`)中,你需要启用JMX远程访问,并设置安全策略。这通常涉及到开启MBean服务器,配置RMI端口,以及设置必要的安全认证。 接下来,启动JBoss服务器并确保...

    jconsole使用手册

    2. 启动Tomcat或JBoss服务器,使用jconsole连接到远程服务器,输入主机名或IP地址、端口号等信息。 3. 使用jconsole的图形化界面实时监控服务器的运行情况。 jconsole的优点包括: 1. 实时监控服务器的运行情况,...

    JBOSS启动顺序、JBOSS占用的端口

    例如,可以修改`standalone.xml`或`domain.xml`中的端口配置,或者使用`jboss-cli.sh`或`jconsole`等工具进行实时监控。正确理解和掌握JBoss的启动顺序和端口占用情况,能有效提高我们对系统的管理和故障排查能力。

    jboss-4.2.4.GA

    jboss-4.2.4,jboss安装工具包。远程通过jconsole连接监控,启动脚本配置

    Jboss

    4. **管理工具**:通过JMX(Java Management Extensions),JBoss提供了一套完整的管理工具,用于监控和管理服务器状态,如jconsole和hawtio。 5. **Web容器**:JBoss内嵌了Tomcat或Jetty作为Web服务器,支持...

    jboss-4.2.2

    在JDK的`bin`目录下运行`jconsole`,然后输入JBoss服务器的JMX连接地址(通常是`service:jmx:rmi:///jndi/rmi://&lt;hostname&gt;:&lt;port&gt;/jmxrmi`),进行远程连接。 7. **Eclipse集成**:对于开发环境,可以使用Eclipse ...

    Jboss基础.pdf

    - **JMX Console**:通过JConsole或VisualVM等工具,可以远程连接到JMX服务器进行监控和管理。 4. **应用部署** - **WAR部署**:对于Web应用程序,可以将WAR文件复制到`standalone/deployments`或`domain/...

    JBOSS 4.2.2GA 使用指南

    你可以通过JConsole、Web管理控制台(web-console)或其他JMX客户端工具访问这些功能。 3. **创建MBeans**:MBeans是JMX的核心组件,代表管理资源。你可以创建自定义MBeans并在JBOSS中注册,以便通过JMX接口进行...

    jboss部署成为linux服务

    此外,熟悉JBoss的控制台工具(如`jconsole`或`jvisualvm`)也有助于远程诊断和性能分析。 7. **安全性考虑**: 当JBoss作为服务运行时,必须考虑安全性。限制对JBoss端口的访问,配置防火墙规则,以及使用安全的...

    jboss资料大全,内容丰富,搜之不易

    部署方式有热部署、冷部署,也可以通过管理接口进行远程部署。理解应用部署的生命周期和部署文件结构能帮助开发者优化部署流程。 5. **EJB和JMS**:作为Java EE的一部分,EJB提供了服务器端组件模型,用于构建可...

    JBoss用户操作指南

    - **调试工具**:使用IDE的远程调试功能或JConsole进行问题排查。 通过《JBoss用户操作指南》的学习,读者将能够熟练地操作JBoss服务器,进行应用部署、配置、监控和优化,从而更好地利用这个强大的中间件平台服务...

    JBOSS使用指南,JMX原理和应用,EJB3.0使用说明

    2. 使用JConsole或JVisualVM:这些工具可以连接到JBoss实例,通过JMX接口查看和调整服务器配置,监控性能指标。 3. 自定义MBeans:开发者可以创建自己的MBeans,扩展管理功能。 三、EJB3.0使用说明 EJB(Enterprise...

    JBoss+Ejb

    7. **工具使用**:关于"工具"的标签可能意味着博客中会介绍如何利用各种开发工具,如Maven或Ant进行构建,或者使用JConsole或VisualVM等监控工具对运行时性能进行分析。 这个博客文章对于初学者理解EJB和JBoss的...

    JBOSS5.0.0.GA1安装部署手册.rar

    2. **JMX MBeans**: 通过管理控制台或远程JMX客户端查询MBeans信息。 3. **堆转储**: 通过`jmap`或JConsole生成堆转储,分析内存泄漏。 总结,JBoss 5.0.0.GA1的安装和部署涉及到多个步骤,包括系统配置、服务器...

    JBoss应用

    此外,还可以使用JMX(Java Management Extensions)进行远程管理和监控。 10. **持续集成与自动化**:JBoss可以与持续集成工具(如Jenkins)和自动化部署工具(如Ansible)集成,实现自动化的构建、测试和部署流程...

    使多个(JBoss)同时运行于同一主机

    1. **bindings.xml**: 这个文件位于`&lt;Install Drive&gt;\jboss-5.0.1.GA\server\pr\conf\bootstrap`目录下,它定义了JBoss的一些基础服务端口,如远程类加载服务、RMI/JRMP调用器、池化调用器和命名服务。 - **远程类...

    jmx_tomcat_jboss

    2. **示例脚本**:使用JMX客户端工具(如jconsole或jvisualvm)连接到Tomcat或JBoss服务器的示例。 3. **MBean定义**:可能包含自定义MBean的Java源代码,这些MBean可以扩展服务器的功能或提供特定的监控指标。 4. *...

    JBoss+4+Application+Server+Guide

    7. **监控和调试**:JBoss AS提供了JMX(Java Management Extensions)接口,通过管理控制台或远程客户端进行监控和管理。理解JMX模型和使用jconsole、jvisualvm等工具能有效诊断和优化应用性能。 8. **故障排查**...

Global site tag (gtag.js) - Google Analytics