All Products
Search
Document Center

E-MapReduce:JMX connector

Last Updated:Jul 05, 2024

A JMX connector can be used to query the JMX information of all nodes in a Trino cluster. You can modify the connector configurations to perform regular dump of JMX information. JMX connectors are typically used for system monitoring and debugging.

Prerequisites

A DataLake cluster or Hadoop cluster is created, and the Presto service is selected. For more information, see Create a cluster.

Configure a JMX connector

Log on to the E-MapReduce (EMR) console and go to the Configure tab of the Trino service page. On the Configure tab, click jmx.properties and modify or add the following configuration items based on your business requirements.

Configuration item

Description

connector.name

The name of the connector. Default value: jmx.

jmx.dump-tables

Managed beans (MBeans) separated by commas (,). This configuration item specifies the MBeans that are sampled and stored in the memory during each sampling period.

If the name of a metric contains a comma (,), the comma must be escaped by using \\,. Example:

jmx.dump-tables=io.trino.memory:type=memorypool\\,name=general,\
   io.trino.memory:type=memorypool\\,name=system,\
   io.trino.memory:type=memorypool\\,name=reserved      

jmx.dump-period

The sampling period. Default value: 10. Unit: seconds.

jmx.max-entries

The maximum number of history records. Default value: 86400.

Tables

A JMX connector provides the following two schemas:

  • current: contains the MBean of each node in the Trino cluster. The name of MBean is the name of the table in the current schema. If the name of MBean contains non-standard characters, you must enclose the name in double quotation marks (") in query statements. Sample code:

    • Execute the following statement to list all available MBeans in the project:

      SHOW TABLES FROM jmx.current;        
    • Execute the following statement to obtain the JVM information of each node:

      SELECT node, vmname, vmversion
      FROM jmx.current."java.lang:type=runtime";   

      The following output is returned:

            node    |              vmname               | vmversion
      --------------+-----------------------------------+-----------
       ddc4df17-xxx | Java HotSpot(TM) 64-Bit Server VM | 24.60-b09
      (1 row)   
    • Execute the following statement to obtain the metrics that indicate the maximum number and the minimum number of file descriptors for each node:

      SELECT openfiledescriptorcount, maxfiledescriptorcount
      FROM jmx.current."java.lang:type=operatingsystem";

      The following output is returned:

      openfiledescriptorcount | maxfiledescriptorcount
      -------------------------+------------------------
                           329 |                  10240
      (1 row)          
  • history: contains the tables that correspond to the metrics to be dumped in the configuration file. You can execute the following statement to perform a query:

    SELECT "timestamp", "uptime" FROM jmx.history."java.lang:type=runtime";

    The following output is returned:

            timestamp        | uptime
    -------------------------+--------
     2016-01-28 10:18:50.000 |  11420
     2016-01-28 10:19:00.000 |  21422
     2016-01-28 10:19:10.000 |  31412
    (3 rows)