无法将远程主机连接到VisualVM [英] Not able to Connect a Remote Host to the VisualVM

查看:456
本文介绍了无法将远程主机连接到VisualVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java新手,在将远程主机连接到JVisualVM时遇到问题.

I am new to Java and I'm facing a problem in connecting a Remote Host to the JVisualVM.

我已经搜索了Internet,并按照此处提到的所有步骤进行操作,但仍然无法解决问题.我遵循的步骤是:

I've searched the Internet and followed all the steps mentioned there but still am not able to resolve the issue. The steps I followed are:

  1. 我首先通过在$JAVA_HOME/bin中创建一个jstatd.all.policy文件来启动远程服务器上的jstatd.该文件包含:grant codebase "file:${java.home}/../lib/tools.jar" { permission java.security.AllPermission;};

  1. I started the jstatd on the remote server by first creating a jstatd.all.policy file in the $JAVA_HOME/bin. The file contained: grant codebase "file:${java.home}/../lib/tools.jar" { permission java.security.AllPermission;};

我以jstatd -J-Djava.security.policy=jstatd.all.policy

我以以下方式在远程主机上启动了Java应用程序:

I started the Java application on the remote host as :

java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false application_name

  • 然后我以本地计算机上JVisualVM的实例启动,并在添加远程主机时,它已连接,但我看不到任何Java进程.

  • I then started as instance of the JVisualVM on my local machine and as I added the remote host, it got connected but i wasn't able to see any of the Java processes.

    有人可以帮我吗?

    谢谢.

    推荐答案

    连接到Glassfish应用程序服务器时,我遇到了类似的问题.查看对我有用的解决方案,因为它们可能与您相同:

    I encountered similar problems when connecting to Glassfish application server. See solutions that worked for me as they can be same for You:

    • 尝试在您的应用程序上进行设置:

      • Try setting on your application:

        -Djava.rmi.server.hostname = * Remote_Server_External_IP_Address *

        • 如果防火墙阻止是一个问题,那么我建议您尝试使用SSH隧道XMing(这很容易设置).如果您在设置时遇到问题,请参见以下说明:
          在Xming上远程使用VisualVM(我的博客) 使用XMing的最大优点是,启用SSH时,它几乎总是可以工作.您只需要将VisualVM文件放在远程主机上,然后从命令行运行它即可. XWindow将在您的本地计算机上显示VisualVM Window.

          • If Firewall block is an issue then I recommend trying XMing with SSH tunnel (which is simple to set). Here is instruction, if You encounter problems setting it:
            Remote use of VisualVM with Xming (my blog) Biggest advantage of using XMing is that it will work almost always when SSH is enabled. You just have to place VisualVM files on the remote host and run it from command line. XWindow will show VisualVM Window on Your local computer.

            这可能是VisualVM问题-尝试使用其他工具只是为了验证错误所在.我推荐 JConsole .它的工作方式类似于VisualVM,我还在我的博客上描述了详细信息

            There is a chance that it is VisualVM issue - try using some other tool just to verify what is wrong. I recommend JConsole. It works similar to VisualVM and I also described details on my blog

            这篇关于无法将远程主机连接到VisualVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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