JMX Connector

The JMX connector provides the ability to query JMX information from all nodes in a openLooKeng cluster. This is very useful for monitoring or debugging. Java Management Extensions (JMX) provides information about the Java Virtual Machine and all of the software running inside it. openLooKeng itself is heavily instrumented via JMX.

This connector can also be configured so that chosen JMX information will be periodically dumped and stored in memory for later access.

Configuration

To configure the JMX connector, create a catalog properties file etc/catalog/jmx.properties with the following contents:

connector.name=jmx

To enable periodical dumps, define the following properties:

connector.name=jmx
jmx.dump-tables=java.lang:type=Runtime,presto.execution.scheduler:name=NodeScheduler
jmx.dump-period=10s
jmx.max-entries=86400

dump-tables is a comma separated list of Managed Beans (MBean). It specifies which MBeans will be sampled and stored in memory every dump-period. History will have limited size of max-entries of entries. Both dump-period and max-entries have default values of 10s and 86400 accordingly.

Commas in MBean names should be escaped in the following manner:

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

Querying JMX

The JMX connector provides two schemas.

The first one is current that contains every MBean from every node in the openLooKeng cluster. You can see all of the available MBeans by running SHOW TABLES:

SHOW TABLES FROM jmx.current;

MBean names map to non-standard table names and must be quoted with double quotes when referencing them in a query. For example, the following query shows the JVM version of every node:

SELECT node, vmname, vmversion
FROM jmx.current."java.lang:type=runtime";
node                 |              vmname               | vmversion
--------------------------------------+-----------------------------------+-----------
ddc4df17-0b8e-4843-bb14-1b8af1a7451a | Java HotSpot(TM) 64-Bit Server VM | 24.60-b09
(1 row)

The following query shows the open and maximum file descriptor counts for each node:

SELECT openfiledescriptorcount, maxfiledescriptorcount
FROM jmx.current."java.lang:type=operatingsystem";
openfiledescriptorcount | maxfiledescriptorcount
-------------------------+------------------------
                    329 |                  10240
(1 row)

The wildcard character * may be used with table names in the current schema. This allows matching several MBean objects within a single query. The following query returns information from the different openLooKeng memory pools on each node:

SELECT freebytes, node, object_name
FROM jmx.current."presto.memory:*type=memorypool*";
freebytes  |  node   |                       object_name
------------+---------+----------------------------------------------------------
 214748364 | example | presto.memory:type=MemoryPool,name=reserved
1073741825 | example | presto.memory:type=MemoryPool,name=general
 858993459 | example | presto.memory:type=MemoryPool,name=system
(3 rows)

The history schema contains the list of tables configured in the connector properties file. The tables have the same columns as those in the current schema, but with an additional timestamp column that stores the time at which the snapshot was taken:

SELECT "timestamp", "uptime" FROM jmx.history."java.lang:type=runtime";
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)

有奖捉虫

“有虫”文档片段

0/500

存在的问题

文档存在风险与错误

● 拼写,格式,无效链接等错误;

● 技术原理、功能、规格等描述和软件不一致,存在错误;

● 原理图、架构图等存在错误;

● 版本号不匹配:文档版本或内容描述和实际软件不一致;

● 对重要数据或系统存在风险的操作,缺少安全提示;

● 排版不美观,影响阅读;

内容描述不清晰

● 描述存在歧义;

● 图形、表格、文字等晦涩难懂;

● 逻辑不清晰,该分类、分项、分步骤的没有给出;

内容获取有困难

● 很难通过搜索引擎,openLooKeng官网,相关博客找到所需内容;

示例代码有错误

● 命令、命令参数等错误;

● 命令无法执行或无法完成对应功能;

内容有缺失

● 关键步骤错误或缺失,无法指导用户完成任务,比如安装、配置、部署等;

● 逻辑不清晰,该分类、分项、分步骤的没有给出

● 图形、表格、文字等晦涩难懂

● 缺少必要的前提条件、注意事项等;

● 描述存在歧义

0/500

您对文档的总体满意度

非常不满意
非常满意

请问是什么原因让您参与到这个问题中

您的邮箱

创Issue赢奖品
根据您的反馈,会自动生成issue模板。您只需点击按钮,创建issue即可。
有奖捉虫