简体   繁体   English

Tomcat JMX / RMI:如何选择服务器接口?

[英]Tomcat JMX/RMI: How server interface is chosen?

I enable JMX server and JMX Registry in Tomcat using 我使用以下命令在Tomcat中启用JMX服务器和JMX注册表

<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
      rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" />

Client connects to 10001 and Tomcat returns its address and port 10002, right? 客户端连接到10001,Tomcat返回其地址和端口10002,对吗? But if I have several addresses on the interface Tomcat returns the first one. 但是,如果接口上有多个地址,Tomcat将返回第一个。

  • Is this a tomcat or RMI issue? 这是tomcat还是RMI问题?
  • How can I set interface and/or IP address to be returned to the client? 如何设置要返回给客户端的接口和/或IP地址?
  • Is it possible to use JMX directly over the one TCP port with out of all that RMI stuff? 是否可以在所有RMI内容中直接通过一个TCP端口使用JMX?

For you question: you should specify -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx as outlined in the answer Tomcat 6, JMX and the dynamic port problem 对于您的问题:您应该指定-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx ,如答案Tomcat 6,JMX和动态端口问题中所述

As an answer how to configure direct access: specify the JMX remote port as outlined in Monitoring and Managing Tomcat : 为了回答如何配置直接访问:按照监视和管理Tomcat中所述指定JMX远程端口:

    set CATALINA_OPTS=-Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=%my.jmx.port%
    -Dcom.sun.management.jmxremote.ssl=false 
    -Dcom.sun.management.jmxremote.authenticate=false

As far as understand, the calls are still done as RMI calls. 据了解,这些调用仍作为RMI调用完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM