JMX连接到Amazon EC2失败 [英] JMX connection to Amazon EC2 fails

查看:205
本文介绍了JMX连接到Amazon EC2失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成立了JMX的在Amazon EC2实例中运行的服务之一,但它不能正常工作。我使用VisualVM的连接和正在申请的失败与超时一段时间后。看起来它失败,因为缺少响应数据或滞后。我检查了JMX端口的安全组启用,并试图与不同的端口没有启用JMX,并与港口没有安全组设置中启用并立即两个失败,所以它看起来不一样。我的EC2实例和台式机都具有的Ubuntu 12.04和JDK 7安装。

I set up JMX on one of services running on Amazon EC2 instance but it doesn't work properly. I'm using VisualVM to connect and after short period of pending it fails with timeout. Looks like it fails because of missing response data or lags. I checked that JMX port is enabled in security group and also tried with different port with no JMX enabled and also with port not enabled in security group settings and both fails immediately, so it looks different. My EC2 instance and desktop both have Ubuntu 12.04 and JDK 7 installed.

任何建议将AP preciated。

Any advise would be appreciated.

更新: 我原来的端口是没有意义的,因为连接的SSL保护。我有一个私钥,而且不知道如何使用它的JConsole或VisualVM的。

UPDATE: I turns out ports don't make sense since connection is SSL secured. I have a private key and have no idea how to use it with JConsole or VisualVM.

推荐答案

这对我的作品。设置JMX选择您的服务器上:

This works for me. Set the JMX options on your server:

-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=<some port>
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false 
-Djava.rmi.server.hostname=localhost

打开一个SSH隧道:

Open up an SSH tunnel:

ssh -i /path/to/key -D <some port> username@public_dns_address

开始VisualVM的:

Start VisualVM:

jvisualvm -J-Dnetbeans.system_socks_proxy=localhost:<some port> -J-Djava.net.useSystemProxies=true

添加到服务器的远程连接。添加使用为JMX所指定的端口JMX连接。

Add a remote connection to the server. Add a JMX connection using the port you've specified for JMX.

需要明确的是,在这三种情况下上面的,应该是相同的端口。

To be clear, in all three cases above, should be the same port.

这篇关于JMX连接到Amazon EC2失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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