JMX console monitoring 

Ignite supports remote monitoring through JMX console. To start the JMX server, you need to set an environment variable called IGNITE_JMX_PORT with a valid unoccupied port number. 

The following are the steps to enable JMX monitoring:

  1. Let's assume that port 7788 is available (if not, then find a valid port), set IGNITE_JMX_PORT=7788, start an Ignite server instance, and rerun our CacheMonitoring example.
  2. We need a JMX console viewer. Open JDK's bin directory and launch jmc

  1. In JMC, create a connection for port 7788 (or your IGNITE_JMX_PORT value):

  1. Right-click on MBean Server for localhost:7788 and start the JMX console.
  2. It will open the overview page and show statistics of memory and CPU usage. Open the MBean Browser.
  3. Expand the 'org.apache' node and find our "My Cache ...." cache node (your cache name will be different but will start with the name 'My Cache'):

  1. Click on the CacheClusterMetricsMXBeanImpl node to get the global cluster statistics for our cache:

  1. The Attributes tab will show you statistics such as AverageGetTime and CacheHitPercentage:

  1. The Operations tab will show you the available JMX operations, such as disabling stats:

  1. Execute the disableStatistics operation and check your Eclipse console. It will stop printing the stats. Now invoke the enableStatistics operation and check the Eclipse console again; it should start showing the stats.

In this section, we enabled statistics and collected cache and memory metrics. If you see any unexpected metrics values, change your cache or data region configuration and keep monitoring your app until you get the expected result.

We monitored system metrics using JMX console and Java code. The next section will tell you about the importance of Ignite cluster security in production, as malicious code can cause undesired effects, security breaches, or damage the system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.27.74