1 2 Previous Next 17 Replies Latest reply on Sep 23, 2010 4:47 PM by Jimmy Beagle

    Version 2.1.1 and Remote JMX

    John Muhlestein Newbie

      I am unable to connect to HornetQ 2.1.1 via JMX (specifically jconsole).  I am able to connect if I am on the local machine, both by pointing to the process in the window, and by going to localhost:12381

       

      I have copied the same run.sh that I used from the 2.0.0 version which has the following jmx configuration:

       

      -Dcom.sun.management.jmxremote.port=12381 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

       

      If I stop 2.1.1 and start 2.0.0 (running on the same machine) I can make the remote connection.

       

      If I run 2.1.1 locally, and connect via jconsole locally, I get the connection, but If I try to connect from a different machine, I cannot get a connection (again, with the jmx configuration listed above)

       

      I'm grasping at straws a bit here on what else might have changed between versions that could affect connecting via jmx remotely.

       

      thanks,

      John

        • 1. Re: Version 2.1.1 and Remote JMX
          Jeff Mesnil Master

          That's strange: I don't remember anything that changed between 2.0.0 and 2.1.1 for remote management.

          This is handled directly by the JVM and HornetQ does not have any code to deal with that...

           

          That may help: http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/management/faq.html#linux1

          • 2. Re: Version 2.1.1 and Remote JMX
            John Muhlestein Newbie

            Still no dice. previous versions of HornetQ and other java apps are accessible remotely via JMX, but not HornetQ 2.1.1  I tried changing port numbers, installing on a different machine, windows and linux, and no luck.

             

            Has anyone else successfully connected remotely? (nothings special, no ssl, no passwords)

            • 3. Re: Version 2.1.1 and Remote JMX
              Luke McLean Newbie

              We connect all the time to version 2.1.0 remotely (using both jconsole and Hyperic). Have not upgraded to 2.1.1. I cannot find the release documentation to explain why 2.1.1 is even released. Could someone elucidate please?

              • 4. Re: Version 2.1.1 and Remote JMX
                John Muhlestein Newbie

                I have tested on several machines. I am able to get a connection with 2.0.0.GA, and other java applications. 2.1.0.Final and 2.1.1.Final I am not able to connect to using the exact same run.sh file that I use with 2.0.0.GA.  jconsole gives me a "Connection Failed" pop us screen.

                 

                I realize this seems like it should be a JVM type of issue, but 2.1.x of hornetq is the only application I am not able to connect to.  At this point, I am trying to connect to the distribution without any changes to the configuration prior to startup.

                • 5. Re: Version 2.1.1 and Remote JMX
                  Tim Fox Master

                  I've been using jconsole to connect to a remote HQ 2.1.1.final instance all day with no problems.


                  You need to make sure the HornetQ server JVM  is started with the following params (I have disabled authentication since I don't need it)


                  -Dcom.sun.management.jmxremote.port=<portNumber>

                  -Dcom.sun.management.jmxremote.authenticate=false
                  -Dcom.sun.management.jmxremote.ssl=false

                  Then I simply type jconsole from the remote machine, then specify <host name>:portNumber when prompted to connect

                  This is just standard remote JMX stuff, nothing specific to HornetQ

                  The following link explains this in more detail:

                  http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/management/agent.html#remote
                  • 6. Re: Version 2.1.1 and Remote JMX
                    John Muhlestein Newbie

                    I ended up changing the information in the hornetq-beans.xml file to point to the actual ip address instead of localhost, and now I can connect.  Seems mildly unrelated, but that did the trick.

                    • 7. Re: Version 2.1.1 and Remote JMX
                      Peter Oxenham Newbie

                      I am having the exact same problem. What settings did you change in hornetq-beans.xml?

                      • 8. Re: Version 2.1.1 and Remote JMX
                        Peter Oxenham Newbie

                        Figured it out. Commenting out the JNDIServer fixed the problem.

                         

                        Can anyone from Hornet comment on this?

                        • 9. Re: Version 2.1.1 and Remote JMX
                          Tim Fox Master

                          As I mentioned in my previous post this works fine if you follow the instructions for remote JMX access (above) - this is not specific to HornetQ. The JMX server used is not part of HornetQ - it's just the standard JMX server from the JDK, HornetQ has no control over how connections are made to it.

                           

                          Clearly you need to make sure you don't have different services e.g. JNDI and JMX listening on the same port as that would cause a port conflict, and if you want people to connect from remote machines the server can't be listening on localhost, since that of course will only be accessible from the local machine.

                          • 10. Re: Version 2.1.1 and Remote JMX
                            Hugh Bragg Newbie

                            If you load/start a fresh version and try what John describes, you would see he is correct.

                            The problem occurs when using JNDI (enabled by default in 2.1.1). If you switch that off then you can connect remotely and locally.

                            This has nothing to do with JNDI or JMX. It's because the developer has assumed that the JNDI host settings also apply to the JMX host.

                            Your answer can't be correct. If I enable JNDI and also want to connect to JMX locally by defining a -Dcom.sun.management.jmxremote.port=6000 (clearly a different port), this doesn't work.

                            • 11. Re: Version 2.1.1 and Remote JMX
                              jaikiran pai Master

                              Hugh Bragg wrote:

                               

                              If you load/start a fresh version and try what John describes, you would see he is correct.

                              The problem occurs when using JNDI (enabled by default in 2.1.1). If you switch that off then you can connect remotely and locally.

                              This has nothing to do with JNDI or JMX. It's because the developer has assumed that the JNDI host settings also apply to the JMX host.

                              I don't see what the JNDI host and JMX host things have to do with JConsole not able to connect. Have you tried it with 2.1.2? It too by default has JNDI server and I was able to successfully connect JConsole while running HornetQ server. I used the following JVM args:

                               

                              -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

                               

                               

                              Hugh Bragg wrote:

                               


                              Your answer can't be correct. If I enable JNDI and also want to connect to JMX locally by defining a -Dcom.sun.management.jmxremote.port=6000 (clearly a different port), this doesn't work.

                              What doesn't work? Where exactly did you specify that port? And what exact error do you get in JConsole?

                              • 12. Re: Version 2.1.1 and Remote JMX
                                Tim Fox Master

                                This works fine for me by simply following the Sun JMX instructions which I posted on an earlier post.

                                 

                                Like I said, the Sun JMX Server is not part of HornetQ. I suspect you simply haven't configured it for remote access properly, e.g. failed to specify a host or port for JMX (don't confuse this with JNDI!)

                                • 13. Re: Version 2.1.1 and Remote JMX
                                  Hugh Bragg Newbie

                                  I read that before and there is no com.sun.management.jmxremote.host property.

                                   

                                  Try this. With a fresh install of Hornet 2.1.2 make sure jndi is enabled with hostname localhost. Start hornet with -Dcom.sun.management.jmxremote.port=6000. for the sake of the example say your lan address resolves to ipaddress which is different to localhost.

                                   

                                  run jconsole from another computer and connect to ipaddress:6000. This doesn't work

                                   

                                  stop hornet and set your jndi host to whatever you ipaddress is. start hornet again.

                                   

                                  run jconsolefrom another computer and connect to ipaddress:6000. This works

                                   

                                  stop hornet and disable jndi. start hornet again.

                                   

                                  run jconsole from another computer and connect to ipaddress:6000. This works

                                   

                                  Why the inconsistency?

                                  why does setting the jndi jnp.host to localhost disable jmx connections from another computer?

                                  • 14. Re: Version 2.1.1 and Remote JMX
                                    Tim Fox Master

                                    As we mentioned in previous posts, did you also specify: ?

                                     

                                    -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
                                    1 2 Previous Next