简体   繁体   English

许多带有mbeans的java进程,如何管理jmx端口

[英]Many java processes with mbeans, how to manage jmx ports

I'm build up a deployment where I've got many java processes on one machine. 我正在建立一个部署,其中在一台计算机上有许多Java进程。 I'd like to be able to connect to their JMX mbeans from the comfort of my laptop. 我希望能够从我的笔记本电脑舒适地连接到他们的JMX mbean。

To do this, I'm apparently faced with two choices: 为此,我显然面临两种选择:

  1. Use VNC to get onto the machine and thus avoid assigning JMX ports. 使用VNC进入计算机,从而避免分配JMX端口。
  2. Keep track of a statically-assigned JMX remote port for each service, supplied in the -D on the launch command line. 跟踪在启动命令行的-D中提供的每个服务的静态分配的JMX远程端口。

I don't really like either, so I'm hoping that someone can offer me one or more others that I haven't thought of yet. 我也不喜欢,所以我希望有人可以提供我尚未想到的一个或多个其他人。 Is there any way for code inside the process to interact with the JMX agent and enable, and set the port for, remote access? 有没有什么办法的过程与JMX代理交互并启用,并设置端口,远程访问内部的代码? Then I could at least use my service backbone to negotiate port assignments for all of these processes. 然后,我至少可以使用我的服务主干来为所有这些进程协商端口分配。

Could consider starting a JMX client locally as a proxy so you only have a single port 可以考虑在本地启动JMX客户端作为代理,因此您只有一个端口

Use the attach API to connect to all the local JVM's with active MBean servers running This way no JVM's need remote access configured except your proxy instance. 使用附加API连接到运行中的活动MBean服务器的所有本地JVM。这样,除了您的代理实例之外,不需要配置任何JVM的远程访问。

Don't expect it will be easy to find off the shelf, so there will be some coding involved. 不要指望容易找到现成的东西,因此会涉及一些编码。 Perhaps this will give you a head start. 也许这会给您一个领先的开始。

http://blogs.oracle.com/jmxetc/entry/proxying_a_jmx_connection_adapting http://blogs.oracle.com/jmxetc/entry/proxying_a_jmx_connection_adapting

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM