我读过Visual VM remotely over ssh,但我想我还没有完全理解,因为它对我不起作用:-(请谁举个例子?
ssh -D 9696 login@ip.of.external.machine和visualvm.exe -J-Dnetbeans.system_socks_proxy=localhost:9696 -J-Djava.net.useSystemProxies=true启动了visualvm,但没有显示外部机器的进程(只显示本地进程,如visualvm本身)。此外,有时(但不总是)我会在我的ssh窗口中收到消息"channel 3: open failed: connect failed: Connection refused“。
有什么帮助吗?
发布于 2009-10-27 07:49:46
您需要在远程端运行jstatd,或者使用host:port指定JMX连接。
Jstatd:
jstatd -J-Djava.security.policy=permissions.txt [-p port]
之后:添加到目标机器的远程连接,并在该远程连接的属性上配置jstatd连接。
(例如,permissions.txt包含以下内容:
grant {
permission java.security.AllPermission;
};编辑:(回复评论)
jstatd并在远程命令行上像上面一样运行
ssh -D 9696 me@remote,。如果希望jstatd位于与缺省端口1099不同的端口上,请使用jstatd的-p参数。上运行visualvm.exe -J-Dnetbeans.system_socks_proxy=localhost:9696 -J-Djava.net.useSystemProxies=true
可视vm中的
现在,您应该可以在visualvm中看到远程端的进程
发布于 2015-07-02 21:23:31
我有另一个解决方案,使用标准的SSH隧道,和,没有要打开的防火墙端口。对我来说,SOCKS代理不起作用。
使用以下选项启动JVM:
-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=_[port1]_ -D**java.rmi.server.hostname=localhost** -Dcom.sun.management.jmxremote.rmi.port=_[port2]_最重要的部分是"server.hostname=localhost“。此外,您显式地定义了两个端口(连接+“随机”RMI端口),"jmxremote.rmi.port“至少需要Java7更新4(我在某处读到,没有检查此信息-在您的服务器机器上使用"lsof -i”来检查真正使用的端口)。
(当然,您可以使用身份验证或SSL。)
通过ssh连接到服务器,并将本地port1和port2转发到本地主机:port1|2和服务器。
在VisualVM中,打开到localhost:port1 (没有任何代理设置)的JMX连接。
发布于 2017-05-09 22:08:00
在通过ssh将jVisualVM连接到远程应用程序时,我也遇到了同样的问题。
This Tutorial帮我解决了这个问题。http://issamben.com/how-to-monitor-remote-jvm-over-ssh/
要解决此问题,请确保:
jvm
已正确建立-Dcom.sun.management.jmxremote.local.only=false
9011:localhost:9011 -i yourPermissionFile.pem -l用户名101.101.101.101 -L 9010:本地主机:9010 -L主机
https://stackoverflow.com/questions/1609961
复制相似问题