简体   繁体   中英

Tomcat JMX/RMI: How server interface is chosen?

I enable JMX server and JMX Registry in Tomcat using

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

Client connects to 10001 and Tomcat returns its address and port 10002, right? But if I have several addresses on the interface Tomcat returns the first one.

  • Is this a tomcat or RMI issue?
  • How can I set interface and/or IP address to be returned to the client?
  • Is it possible to use JMX directly over the one TCP port with out of all that RMI stuff?

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

As an answer how to configure direct access: specify the JMX remote port as outlined in Monitoring and Managing Tomcat :

    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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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