我有一些JMX在Jetty上工作的问题(9.1.3.v20140225),所以我已经阅读了Jetty doco。
所以我在jetty.conf中添加了以下内容
# ======================================================== # jetty.conf Configuration for jetty.sh script # -------------------------------------------------------- # This file is used by the jetty.sh script to provide # extra configuration arguments for the start.jar command # created by that script. # # Each line in this file becomes an arguement to start.jar # in addition to those found in the start.ini file # ======================================================= jetty-logging.xml jetty-started.xml etc/jetty.xml etc/jetty-jmx.xml etc/jetty-jmx-remote.xml
我添加了jmx作为start.jar –add-to-start命令的一部分,因为doco告诉我将Jconsole连接到Jetty
http://www.eclipse.org/jetty/documentation/current/jetty-jconsole.html
[mybase]$ java /opt/jetty-dist/start.jar --add-to-start=jmx INFO: jmx-remote initialised in ${jetty.base}/start.ini (appended) INFO: jmx initialised transitively
当我这样做,它只加了jmx而不是jmx-remote,不知道为什么,但是我希望有人能让我知道为什么。
从所有我读过的文档中,我已经说明了他们想要实现的目标。
http://www.eclipse.org/jetty/documentation/current/jmx-chapter.html
但是,它所说的并不完全正确,就我所看到的包来说,因此我添加了jetty-jmx-remote的原因在于,因为doco所说的应该在jetty-jmx.xml中。
在任何情况下,当我启动docker,我在日志文件中看到它正在启动
INFO:oejj.ConnectorServer:main:JMX Remote URL:service:jmx:rmi:// host:1099 / jndi / rmi:// host:1099 / jmxrmi
我可以从服务器telnet到1099,从我的客户端,我用nmap只是为了仔细检查端口是否听,也看到它在netstat。 当我使用VisualVM连接时,我只是得到一个错误。
我确定我打开了我的networking和Jetty的位置之间的所有端口。
任何人都可以指引我走向正确的方向吗?
谢谢
对它进行sorting,需要将其手动添加到start.ini中
--module=jmx-remote ## JMX Configuration ## Enable for an open port accessible by remote machines jetty.jmxrmihost=localhost jetty.jmxrmiport=1099 ## Strictly speaking you shouldn't need --exec to use this in most environments. ## If this isn't working, make sure you enable --exec as well -Dcom.sun.management.jmxremote
并在jetty-jmx.xml中进行了更新。
<Call class="java.lang.System" name="setProperty"> <Arg>java.rmi.server.hostname</Arg> <Arg>IP-Address</Arg> </Call>
Plus并不需要做我对jetty.conf做的事情。