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

发布于 2024-10-06 03:08:39 字数 307 浏览 0 评论 0原文

我正在构建一个部署,其中一台机器上有许多 java 进程。我希望能够从我的笔记本电脑上舒适地连接到他们的 JMX mbean。

为此,我显然面临两种选择:

  1. 使用 VNC 进入计算机,从而避免分配 JMX 端口。
  2. 跟踪每个服务的静态分配的 JMX 远程端口,在启动命令行的 -D 中提供。

我不太喜欢其中任何一个,所以我希望有人能为我提供一个或多个我还没有想到的其他选择。进程内部的代码是否有任何方法可以与 JMX 代理交互并启用远程访问并设置端口?然后我至少可以使用我的服务主干来协商所有这些进程的端口分配。

I'm build up a deployment where I've got many java processes on one machine. I'd like to be able to connect to their JMX mbeans from the comfort of my laptop.

To do this, I'm apparently faced with two choices:

  1. Use VNC to get onto the machine and thus avoid assigning JMX ports.
  2. Keep track of a statically-assigned JMX remote port for each service, supplied in the -D on the launch command line.

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? Then I could at least use my service backbone to negotiate port assignments for all of these processes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

脸赞 2024-10-13 03:08:39

可以考虑在本地启动 JMX 客户端作为代理,这样您就只有一个端口

使用附加 API 连接到所有正在运行的活动 MBean 服务器的本地 JVM
这样,除了您的代理实例之外,JVM 不需要配置远程访问。

不要指望它很容易找到现成的,因此会涉及一些编码。
也许这会给你一个良好的开端。

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

Could consider starting a JMX client locally as a proxy so you only have a single port

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.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文