Management and Monitoring Example

This example uses an MBean server to manage and monitor a node in a distributed system. One node acts as an MBean server that gets information from other nodes.

Running the Example

Note: To run this example, you must have terminal sessions configured for the QuickStart examples, as described in Setting Up Your Environment.
  1. Change to the <Install_Directory>/SampleCode/quickstart directory.
  2. Open two terminal sessions and add the following files to the CLASSPATH:
    • tomcat-embed-logging-juli.jar

    • tomcat-embed-jasper.jar

    • tomcat-embed-core.jar

  3. In a terminal session, run the following command to start the managed node:
    java quickstart.ManagedNode

    The managed node retrieves an MBean locally from the management service, creates a local cache and the exampleRegion region, adds information retrieved from the MBean such as entry count to the region, and displays information about the items. Wait for the following message before continuing:

    Start Manager Node and wait till it completes
  4. Open a second terminal session and run the following command:
    java quickstart.ManagerNode
    The manager node creates a region and retrieves the region MBean from the managed node you started in the first session. Wait for the following message before continuing:
    Press enter in Managed Node
  5. In the first session, press ENTER.

Example Source Files

Table 1. Cache configuration files, located in SampleCode/quickstart/xml
managed-node.xml Creates a cache and region for MBean data.

Table 2. Java program files, located in SampleCode/quickstart/quickstart Retrieves the region MBean for all members of a GemFire distributed system. Retrieves a local region MBean.

Related Javadocs