JMX

Java Management Extensions (JMX) are a powerful set of APIs used to monitor and manage a running JVM. The building blocks of JMX are the so-called Management Beans (MBeans), which are basically wrappers that decorate existing objects with a management interface. The core classes of JVM are decorated with MBeans.

MBeans are registered with an MBeanServer that exposes those management interfaces to external clients. Applications are free to create, register, and expose the management interface of their own specific services. Solr MBeans are not automatically registered with the MBeanServer, but if you want to do that, just write (or uncomment) the following line in solrconfig.xml:

<jmx/>

The JVM comes with two built-in JMX clients called JConsole and JVisualVM.

Tip

JVisualVM and JConsole are very similar tools. Here, we will talk only about the JConsole because JVisualVM doesn't have the MBeans perspective.

Open a shell in your PC and type the following command:

# $JAVA_HOME/bin/jconsole

A dialog pop-up will appear. This is the first screen of JConsole, which is a Java standalone application. The dialog contains a list of locally running JVMs. One of them should be the one where Solr is running. Select that entry, and you should see a screen with several tabs: Overview, Memory, Threads, Classes, VM Summary, and MBeans. At the moment, we are interested in the last tab, MBeans. Here you can see (the tree component on the left side) all registered MBeans, as depicted in the following screenshot:

JMX

For each MBean in the tree, you can see its management interface in the right pane. A management interface is composed of attributes and operations.

Operations can be invoked and attributes can be monitored by looking at their value at a given moment or for a given interval. To do this, you have to double-click on them and activate a real-time chart.

The main differences between the Solr Administration Console and JConsole are as follows:

  • The Solr Administration Console, being a web application, offers static snapshots of the system. With JConsole, it's possible to activate real-time monitoring of one or more attributes. This is not limited to MBean attributes. In the other tabs, you can monitor threads, processors, memory, and garbage collection.
  • JConsole has a finer level of granularity than the Administration Console. There, we can see all attributes and operations exposed for management.
  • JConsole, being more technical, is less usable than the Administration Console.

Clearly, JConsole, JVisualVM, and the Solr Administration Console are not alternatives. They should be used together in order to get a different perspective on 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.145.17.18