Apache Kylin : Analytical Data Warehouse for Big Data
Page History
...
Kylin 通过 System Cube 监控系统,System Cube 记录了查询和任务相关的指标,能够有效的帮助系统运维和发现问题。当用户开启 System Cube 后,就可以在 Kylin 的 Web 界面查看项目 KYLIN_SYSTEM,在这个项目下有 5 个 Cube,它们分别从不同的维度记录系统的监控数据。用户可以通过 ,它们分别从不同的维度记录系统的监控数据。System Cube 进行更多场景的分析,以便更好的运维监控 Kylin。 服务于 DashBoard 和 Cube Planner 第二阶段,用户也可以通过 System Cube 也服务于 DashBoard 和 Cube Planner 第二阶段。进行更多场景的分析,以便更好的运维监控 Kylin。
2. The Hive Tables for System Cube
用户在 Kylin 中的每一个查询或构建操作,都会被记录在 Hive 表中,共有 5 张 Hive 表,它们分别对应了 5 个 System Cube 的事实表:
Hive Table Name | Description | System Cube Name | |
hive_metrics_query_qa | Collect query related information | hive_metrics_query_qa | |
hive_metrics_query_cube_qa | Collect query related information | hive_metrics_query_cube_qa | Related to Cube Planner |
hive_metrics_query_rpc_qa | Collect query related information | hive_metrics_query_rpc_qa | |
hive_metrics_job_qa | Collect job related information | hive_metrics_job_qa | |
hive_metrics_job_exception_qa | Collect job related information | hive_metrics_job_exception_qa |
以下列出与 Hive 表相关的 5 个配置项:
- kylin.metrics.prefix:The system will automatically create the above 5 tables in database named 'kylin' by default. You can customize the database by modifying the configuration item kylin.metrics.prefix=<name>. <name> is also the prefix of the System Cube name;
- kylin.metric.subject-suffix:You can customize the suffix of the hive tables, the default is 'qa', so the table name is 'hive_metrics_query_qa';
- kylin.metrics.monitor-enabled:Whether to record metrics in Hive, control the above 5 tables, the default is false, which means not to record;
- kylin.metrics.reporter-query-enabled:Whether to record metrics in Hive, control the above 3 tables about query, the default is false, which means not to record;
- kylin.metrics.reporter-job-enabled:Whether to record metrics in Hive, control the above 2 tables about job, the default is false, which means not to record;
2.1 How to record query metrics into Hive
Cube 中可以有多个 Segments,每个 Segment 的数据可能存储在不同的 RPC 服务器中,当用户发送一条查询时,查询可能击中多个 Cube,扫描每个 Cube 下的多个 Segments,扫描每个 Segment 下面多个 RPC 服务器中存储的数据。那么对于发送的一条查询:
- 每击中一个 Cube,在表 hive_metrics_query_qa 中记录一行数据;
- 当查询击中 Cube,每扫描 Cube 下的一个 Segment,在表 hive_metrics_query_cube_qa 中记录一行数据;
- 当查询需要扫描 Cube 下的一个 Segment,每扫描一个 RPC 服务器下的数据,在表
- 服务器中的数据,在表 hive_metrics_query_rpc_qa 中记录一行数据。(提示:展开 Cube 详情,在 Storage 标签下查看 Region Count,可以看出一个 Segment 中的数据存储在多少个 RPC 目标服务器中)
2.2 How to record job metrics into Hive
- 对于表 hive_metrics_job_qa,每个成功的任务生成一条数据;
- 对于表 hive_metrics_job_exception_qa,每个成功的任务生成一条数据;qa,每个失败的任务生成一条数据;
2.3 Some tips about recording metrics
相关指标插入 Hive 表中有一定的延迟,系统一般会“在一定时间后”或“将一个固定批量的数据”一次性插入到 Hive 表中。默认的“一定的时间”是 10 分钟,“一个固定批量的数据”是 10 条。如果希望快速验证,可以采用以下两种方法:
- 修改配置文件 $KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/classes/kylinMetrics.xml 中的配置项,“index=1” 的配置项表示批量(累计多少条数据必然会插入 Hive),“index=2” 的配置项表示时间间隔(累计多长时间必然会插入 Hive,单位分钟);
- 重启 Kylin 会立即记录所有需要被记录的数据;
接下来可以进入 Hive,查询相应的表以确定数据已插入,查询相应的表以确认数据已插入 Hive,例如:
Code Block | ||
---|---|---|
| ||
hive useruse kylin; select * from hive_metrics_query_cube_qa; |
...