Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Is there any way to make jconsole only connect through 9999 or use a proxy? Is <a href="https://blogs.oracle.com/jmxetc/entry/connecting_through_firewall_using_jmx" rel="nofollow noreferrer">this article</a> still the best solution? Or, am I missing something?</p> </blockquote> <p>Yes, that article is about right.</p> <p>When you specify the JMX port on your server (<code>-Dcom.sun.management.jmxremote.port=####</code>), you are actually specifying <em>just</em> the registry-port for the application. When you connect it provides an additional server-port that the jconsole actually does all of its work with. To get forwarded to work, you need to know <em>both</em> the registry and server ports.</p> <p>Something like the following should work to run your application with both the registry and server ports set to 8000. See <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/management/agent.html" rel="nofollow noreferrer">here for more details</a>.</p> <pre><code>-Dcom.sun.management.jmxremote.port=8000 -Dcom.sun.management.jmxremote.rmi.port=8000 </code></pre> <p>As an aside, my <a href="http://256stuff.com/sources/simplejmx/" rel="nofollow noreferrer">SimpleJMX library</a> allows you to set both ports easily and you can set them both to be the same port.</p> <p>So, once you know both the port(s) you need to forward, you can set up your <code>ssh</code> command. For example, if you configure the registry and server ports as 8000, you would do:</p> <pre><code>ssh -L 8000:localhost:8000 remote-host </code></pre> <p>This creates a local port 8000 which forwards to localhost:8000 on the remote-host. You can specify multiple <code>-L</code> arguments if you need to forward multiple ports. Then you can connect your jconsole to localhost:8000 and it will connect to the remote-host appropriately.</p> <p>Also, if your server has multiple interfaces, you may need to set both the following variable to get the registry and server ports to bind to the right interface:</p> <pre><code>-Djava.rmi.server.hostname=10.1.2.3 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload