解释JMX URL [英] Explain JMX URL

查看:209
本文介绍了解释JMX URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解JMX服务网址。

I am trying to understand a JMX service URL.

service:jmx:rmi://192.168.30.10:1234/jndi/rmi://192.168.30.10:2344/jmxrmi

如果有人的话会很棒可以帮我理解这一点。

It would be great, if someone can help me understand this.

谢谢

推荐答案

我会重复使用我之前为这个问题写的答案:无法连接到Tomcat的MBeanServer通过Java6中的jconsole

I will reuse an answer I wrote up earlier for this question: Cannot connect to Tomcat's MBeanServer via jconsole in Java6

它不完整,但可能会有所帮助:

It's not complete, but might help:

假设你有使用RMI REGISTRY PORT和 JMX上的 RMI注册表端口在TARGET MACHINE上运行的JMX服务器(别名'JMX代理'别名'您要连接的JVM') 'JMX RMI SERVER PORT'的RMI服务器端口

Suppose you have the JMX Server (alias 'JMX Agent' alias 'the JVM you want to connect to') running on 'TARGET MACHINE' with the RMI registry port at 'RMI REGISTRY PORT' and the JMX RMI server port at 'JMX RMI SERVER PORT'.

注意:


  1. RMI注册表告诉JMX客户端在哪里发送和 JMX RMI服务器端口;信息可以在密钥 jmxrmi 下获得。

  2. RMI注册表端口通常被称为已设置通过JVM启动时的系统属性。

  3. JMX RMI服务器端口通常,因为JVM随机选择它(如果没有采取其他预防措施)。

  1. The RMI registry tells JMX clients where to find the JMX RMI server port; information can be obtained under key jmxrmi.
  2. The RMI registry port is generally known as it is set through system properties at JVM startup.
  3. The JMX RMI server port is generally not known as the JVM chooses it at random (if no other precautions are taken).

以下URI将导致成功连接(已测试)

The following URI will lead to successful connection (tested)

service:jmx:rmi://< TARGET_MACHINE>:< JMX_RMI_SERVER_PORT> / jndi / rmi://< TARGET_MACHINE>:< RMI_REGISTRY_PORT> / jmxrmi

这看起来很讨厌。让我们把它分开。

This looks nasty. Let's cut it apart.

这个URI是RFC2609服务位置协议URL(嗯,它真的是一个URI,对吗?)

This URI is an RFC2609 "Service Location Protocol URL" (well, it's really an URI, right?)

它由以下内容组成:


  • service - a常量

  • jmx:rmi - 服务类型由以下组成:抽象类型 jmx URL计划 rmi

  • 其余的 - sap (服务访问协议规范)

  • service - a constant
  • jmx:rmi - the service type composed of: abstract type jmx and URL scheme rmi
  • the rest - the sap (service access protocol specification)

sap 是分解为:


  • //< TARGET_MACHINE>:< JMX_RMI_SERVER_PORT> - ipsite

  • / jndi / rmi://< TARGET_MACHINE>:< RMI_REGISTRY_PORT> / jmxrmi - 网址

  • //<TARGET_MACHINE>:<JMX_RMI_SERVER_PORT> - ipsite
  • /jndi/rmi://<TARGET_MACHINE>:<RMI_REGISTRY_PORT>/jmxrmi - URL part

一个消息灵通的JMX客户端连接到ipsite以进行JMX-over-RMI交换;但是什么JMX客户端不知道该端口?耐心...

A well-informed JMX client connects to the "ipsite" to do JMX-over-RMI exchanges; but what of the JMX client that doesn't KNOW that port? Patience...

URL部分被分解为:


  • / jndi / - 这似乎告诉JMX客户端它可以在后面的位置获取查找信息

  • rmi://< TARGET_MACHINE>:< RMI_REGISTRY_PORT> / jmxrmi - 是的,我们在查找键<$下获取有关RMI注册表中JMX RMI服务器的信息c $ c> jmxrmi

  • /jndi/ - This seems to tell the JMX client that it can get lookup information at the location that follows
  • rmi://<TARGET_MACHINE>:<RMI_REGISTRY_PORT>/jmxrmi - Yep, we get information about the JMX RMI Server at the RMI registry, under the lookup key jmxrmi

这有点像马车,因为必须联系 RMI注册表首先由SLP URL的后者部分提供。

This is somewhat cart-before-horse, as one has to contact the RMI registry given by the latter part of the SLP URL first.

在直觉之后,让我们试试吧:

After scratching head, intuitively, let's try:

service:jmx:rmi://< TARGET_MACHINE> / jndi / rmi://< TARGET_MACHINE>:< RMI_REGISTRY_PORT> / jmxrmi

是的,这有效!从注册表中很好地获得了JMX RMI服务器端口。再想一想,目标机器也应该从注册表中获取,因此:

Yes, that works! The JMX RMI server port is nicely obtained from the registry. On second thoughts, the target machine should also be obtained from the registry, thus:

service:jmx:rmi :/// jndi / rmi://< TARGET_MACHINE>:< RMI_REGISTRY_PORT> / jmxrmi

更好的是,这也有效!

参考文献:


  1. http://download.oracle.com/javase/6/docs/api /javax/management/remote/rmi/package-summary.html

  2. http://download.oracle.com/javase/6/docs/api/javax/management/remote/JMXServiceURL.html

  3. http://mx4j.sourceforge.net/docs/ch03s04 .html

  4. http://download.oracle.com/javase/6/docs/technotes/guides/management/agent.html#gdevg

  5. http://www.rfc-editor.org/rfc/rfc2609.txt

  1. http://download.oracle.com/javase/6/docs/api/javax/management/remote/rmi/package-summary.html
  2. http://download.oracle.com/javase/6/docs/api/javax/management/remote/JMXServiceURL.html
  3. http://mx4j.sourceforge.net/docs/ch03s04.html
  4. http://download.oracle.com/javase/6/docs/technotes/guides/management/agent.html#gdevg
  5. http://www.rfc-editor.org/rfc/rfc2609.txt

这篇关于解释JMX URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆