[英]Enable remote JMX on Jetty
I'm trying to enable remote JMX on a Jetty 6.1.26 instance running on Windows. 我正在尝试在Windows上运行的Jetty 6.1.26实例上启用远程JMX。 I have tried several approaches, but the result is always the same: 我尝试了几种方法,但结果总是一样的:
When I try to connect from jconsole to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
I got "connection refused". 当我尝试从jconsole连接到service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
我得到了“连接被拒绝”。
I have found several guides on the internet, but no one seems to help. 我在互联网上找到了几个指南,但似乎没有人帮忙。 Please note that I'm running Jetty standalone, from the "Jetty-Service.exe" wrapper. 请注意我从“Jetty-Service.exe”包装器中独立运行Jetty。
It would be great if someone could suggest a way to enable remote JMX on jetty. 如果有人能提出一种在码头上启用远程JMX的方法,那就太好了。
I'm answering my own question. 我在回答我自己的问题。
This is the way I have found to start Jetty with JMX enabled: 这是我发现在启用JMX的情况下启动Jetty的方式:
java
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=1099
-jar start.jar etc/jetty-jmx.xml etc/jetty.xml
Which Jetty is this? 这是哪个码头? I had to do the same yesterday. 昨天我不得不这样做。 First, I had to uncomment etc/jetty-jmx.xml in the start.ini file (installation root.) Then I had to add the same jmx system properties that you mentioned in your comment above. 首先,我必须在start.ini文件(安装根目录)中取消注释etc / jetty-jmx.xml。然后我必须添加您在上面的评论中提到的相同的jmx系统属性。 Unless you edit start.ini, you will not see the Jetty-specific MBeans, but you will be able to connect via jConsole. 除非您编辑start.ini,否则您将看不到特定于Jetty的MBean,但您将能够通过jConsole进行连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.