5 Replies Latest reply: Jun 17, 2010 11:51 AM by DarrylBurke RSS

    Can Single JMX client talk to multiple JMX servers

    843798
      I am evaluating JMX as the monitoring framework.

      I need to manage multiple servers for a single client application. I am wondering if I can connect a single JMX connector client to multipple Mbean servers ?

      And also instead of client pulling the data, can I push the details from server to the client?
        • 1. Re: Can Single JMX client talk to multiple JMX servers
          791266
          SmrutiRanjan wrote:
          I am evaluating JMX as the monitoring framework.

          I need to manage multiple servers for a single client application. I am wondering if I can connect a single JMX connector client to multipple Mbean servers ?
          Yes

          >
          And also instead of client pulling the data, can I push the details from server to the client?
          Take a look at notifications.
          • 2. Re: Can Single JMX client talk to multiple JMX servers
            843798
            Thank you for the response.

            As you said a single JMX client can connect to multiple MBean Servers, I am not sure how to do that. Could you plz explain it with some code snippets.

            Example:
            Let say, I have two MBean Servers running on two machines namely "server1" and "server2". And my client machine is "client". If I use RMI connector, then the server code would look like,

            for Server 1:
            JMXServiceURL url = new JMXServiceURL( "service:jmx:rmi://*+clinet-machine-ip+*/jndi/rmi://*+server1-ip+*:port/jndiPath");
            JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbeanServer);
            connectorServer.start();

            for Server 2:
            JMXServiceURL url = new JMXServiceURL( "service:jmx:rmi://*+clinet-machine-ip+*/jndi/rmi://*+server2-ip+*:port/jndiPath" );
            JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbeanServer);
            connectorServer.start();

            Now, how the client code would look like? How do I get handle on both the Mbean servers?
            • 3. Re: Can Single JMX client talk to multiple JMX servers
              843798
              well, it's german, but maybe the code of this tutorial could help you

              - http://www.torsten-horn.de/techdocs/jmx-gc.htm
              • 4. Re: Can Single JMX client talk to multiple JMX servers
                843798
                HI,

                Can you please explain me how can we write the JMX programees for Server and Client as my requirement is that, i need instrument the resources.

                Here im facing the problems like, where to run the server,client programs respectively and, where to run the Port(RMI), i mean on which machine(like Clinet, or Server). Here my Server machine is differnt and Client machine is different.

                Plsease provide me some steps to mover further level to develop.

                my questions as below:

                1.Server.java-- is this program going on run on server machine onlty or at client machine? Please can you confirm me the same as Im unable to run my client program?

                2.Client.java-- is this program gng to run at client machine only or somewhere?

                3.is it required to run RMI port externally as im using Java 1.6. i mean, on which machine we need to run the RMI Port whcih uses in JMXServerURL.

                Please can you update me on this as Im looking for the same.
                Awaiting for your reply.

                Thanks
                Munnelli
                • 5. Re: Can Single JMX client talk to multiple JMX servers
                  DarrylBurke
                  DctmJmx, welcome to the forum. Please don't post in threads that are long dead and don't hijack another poster's thread. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem. Please also check your private messages on your profile page.

                  I'm locking this thread now.

                  db