【问题标题】:call jmx operation on a local running process在本地运行的进程上调用 jmx 操作
【发布时间】:2013-04-29 14:13:39
【问题描述】:

我在 linux 服务器上有一个 java 进程,它使用以下选项运行:-Dcom.sun.management.jmxremote

所以我不能只通过在我的本地电脑上运行的 jconsole 连接到这个进程(因为既没有设置端口也没有设置 -Dcom.sun.management.jmxremote.ssl=false 选项)。

但是,我怎样才能连接到应用程序并在它的某些 MBean 上运行一些操作?这可能吗?我可以通过 ssh 访问服务器,并且能够在服务器上“本地”运行它(但遗憾的是没有更改选项)

【问题讨论】:

    标签: jmx jconsole mbeans


    【解决方案1】:

    根据 JMX documentation -Dcom.sun.management.jmxremote 选项

    Enables the JMX remote agent and local monitoring via JMX connector published on a private
    interface used by jconsole. The jconsole tool can use this connector if it is executed by 
    the same user ID as the user ID that started the agent. No password or access files are 
    checked for requests coming via this connector.
    

    命名有点遗憾,因为它实际上只启用了本地监控。

    由于您无法更改选项但可以通过 SSH 访问服务器,因此唯一的选择是使用 X 服务器转发 (ssh -X ...) 并运行 jconsole(或者更好的是 jvisualvm,它具有针对远程运行的特定优化)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      • 1970-01-01
      相关资源
      最近更新 更多