我正在尝试使JMX连接在防火墙后工作。该应用程序基于Spring,可在我们的数据中心中运行。我们正在尝试将其迁移到限制性更高的另一台服务器上。我们曾经使用ssh进入服务器,并通过使用jmxterm库触发某些东西在本地连接到Spring Boot。现在,该应用程序正在更安全的服务器上运行,该服务器使我们只能通过jmx远程连接远程访问它。
这是命令行。
java -Dcom.sun.management.jmxremote=true -Djava.rmi.server.hostname=xx.xx.xxx.xx -Dcom.sun.management.jmxremote.rmi.port=12345 -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=conf/password.file -Dcom.sun.management.jmxremote.access.file=conf/access.file application.jar
我正在使用OpenJDK8。
端口已添加到防火墙规则。
我在应用程序中没有看到任何注释“ @EnableMBeanExport”和“ spring.jmx.enabled = true”,但是我想我们的团队能够对其进行管理,因为他们使用jmxterm库在本地连接了该注释。
现在,即使端口打开并且我输入了正确的用户名/密码,我也无法使用jconsole远程连接到它。是因为没有为远程JMX正确配置应用程序,还是命令行有问题?
我将password.file和access.file设为只读,因此在启动时看不到任何错误。我可以在本地连接,但不能远程连接。
是否需要检查和启用远程JMX才能正常工作?
谢谢。