The JMX connector is used to query the JMX information about all the nodes in the Trino cluster. You can modify the connector configurations to perform regular dump of JMX information. The JMX connector is typically used for system monitoring and debugging.
Prerequisites
A data lake cluster or Hadoop cluster is created, and the Presto service is selected. For more information, see Create a cluster.
Configure the JMX connector
Go to the Configure tab on the Trino service page in the EMR console. Click the jmx.properties tab. You can modify the values of the parameters or add parameters based on your business requirements.
Parameter | Description |
---|---|
connector.name | The name of the connector. |
jmx.dump-tables | Managed beans (MBeans) separated with commas (,). This parameter specifies which MBeans
are sampled and stored in the memory during each sampling period.
If the name of a metric contains a comma (,), it must be escaped by using
\\, . Sample code:
|
jmx.dump-period | Specifies the sampling period. Default value: 10. Unit: seconds. |
jmx.max-entries | Specifies the maximum number of history records. Default value: 86400. |
Tables
The 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 thecurrent
schema. If the name of MBean contains non-standard characters, you must enclose the name in double quotation marks ("). Sample code:- Run the following command to list all available MBeans in the project.
SHOW TABLES FROM jmx.current;
- Run the following command 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)
- Run the following command 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)
- Run the following command to list all available MBeans in the project.
history
: contains the tables corresponding to the metrics to be dumped in the configuration file. You can run the following command 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)