# Compass **Repository Path**: linux2014/compass ## Basic Information - **Project Name**: Compass - **Description**: 罗盘是一个大数据任务诊断平台,旨在提升用户排查问题效率,降低用户异常任务成本。 其主要功能特性如下: 非侵入式,即时诊断,无需修改已有的调度平台,即可体验诊断效果。 支持多种主流调度平台,例如DolphinScheduler、Airflow或自研等。 支持多版本Spark、Hadoop 2.x和3.x 任务日志诊断和解析。 支持工作流层异常诊断,识别各种失败和基线耗时异常问题。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 21 - **Created**: 2023-04-12 - **Last Updated**: 2023-04-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 罗盘 [English document](README.md) 罗盘是一个大数据任务诊断平台,旨在提升用户排查问题效率,降低用户异常任务成本。 其主要功能特性如下: - 非侵入式,即时诊断,无需修改已有的调度平台,即可体验诊断效果。 - 支持多种主流调度平台,例如DolphinScheduler、Airflow或自研等。 - 支持多版本Spark、Hadoop 2.x和3.x 任务日志诊断和解析。 - 支持工作流层异常诊断,识别各种失败和基线耗时异常问题。 - 支持引擎层异常诊断,包含数据倾斜、大表扫描、内存浪费等14种异常类型。 - 支持各种日志匹配规则编写和异常阈值调整,可自行根据实际场景优化。 罗盘已支持诊断类型概览:
诊断维度 诊断类型 类型说明
失败分析 运行失败 最终运行失败的任务
首次失败 重试次数大于1的成功任务
长期失败 最近10天运行失败的任务
耗时分析 基线时间异常 相对于历史正常结束时间,提前结束或晚点结束的任务
基线耗时异常 相对于历史正常运行时长,运行时间过长或过短的任务
运行耗时长 运行时间超过2小时的任务
报错分析 sql失败 因sql执行问题而导致失败的任务
shuffle失败 因shuffle执行问题而导致失败的任务
内存溢出 因内存溢出问题而导致失败的任务
成本分析 内存浪费 内存使用峰值与总内存占比过低的任务
CPU浪费 driver/executor计算时间与总CPU计算时间占比过低的任务
效率分析 大表扫描 没有限制分区导致扫描行数过多的任务
OOM预警 广播表的累计内存与driver或executor任意一个内存占比过高的任务
数据倾斜 stage中存在task处理的最大数据量远大于中位数的任务
Job耗时异常 job空闲时间与job运行时间占比过高的任务
Stage耗时异常 stage空闲时间与stage运行时间占比过高的任务
Task长尾 stage中存在task最大运行耗时远大于中位数的任务
HDFS卡顿 stage中存在task处理速率过慢的任务
推测执行Task过多 stage中频繁出现task推测执行的任务
全局排序异常 全局排序导致运行耗时过长的任务
## 如何使用 ### 1. 代码编译 ```shell git clone https://github.com/cubefs/compass.git cd compass mvn package -DskipTests ``` ### 2. 配置修改 ```shell cd dist/compass vi bin/compass_env.sh # Scheduler MySQL export SCHEDULER_MYSQL_ADDRESS="ip:port" export SCHEDULER_MYSQL_DB="scheduler" export SCHEDULER_DATASOURCE_USERNAME="user" export SCHEDULER_DATASOURCE_PASSWORD="pwd" # Compass MySQL export COMPASS_MYSQL_ADDRESS="ip:port" export COMPASS_MYSQL_DB="compass" export SPRING_DATASOURCE_USERNAME="user" export SPRING_DATASOURCE_PASSWORD="pwd" # Kafka export SPRING_KAFKA_BOOTSTRAPSERVERS="ip1:port,ip2:port" # Redis export SPRING_REDIS_CLUSTER_NODES="ip1:port,ip2:port" # Zookeeper export SPRING_ZOOKEEPER_NODES="ip1:port,ip2:port" # Elasticsearch export SPRING_ELASTICSEARCH_NODES="ip1:port,ip2:port" ``` ```shell vi conf/application-hadoop.yml hadoop: namenodes: - nameservices: logs-hdfs # the value of dfs.nameservices namenodesAddr: [ "machine1.example.com", "machine2.example.com" ] # the value of dfs.namenode.rpc-address.[nameservice ID].[name node ID] namenodes: [ "nn1", "nn2" ] # the value of dfs.ha.namenodes.[nameservice ID] user: hdfs password: port: 8020 # scheduler platform hdfs log path keyword identification, used by task-application matchPathKeys: [ "flume" ] yarn: - clusterName: "bigdata" resourceManager: [ "machine1:8088", "machine2:8088" ] # the value of yarn.resourcemanager.webapp.address jobHistoryServer: "machine3:19888" # the value of mapreduce.jobhistory.webapp.address spark: sparkHistoryServer: [ "machine4:18080" ] # the value of spark.history.ui ``` ### 3. 初始化数据库和表 Compass 表结构由两部分组成,一个是compass.sql,另一个是依赖调度平台的表(dolphinscheduler.sql 或者 airflow.sql等) 1. 请先执行document/sql/compass.sql 2. 如果您使用的是DolphinScheduler调度平台,请执行document/sql/dolphinscheduler.sql; 如果您使用的是Airflow调度平台,请执行document/sql/airflow.sql 3. 如果您使用的是自研调度平台,请参考[task-syncer](#task-syncer)模块,确定需要同步的表 ### 4. 一键部署 ``` ./bin/start_all.sh ``` ## 文档 [架构文档](document/manual/architecture.md) [部署指南](document/manual/deployment.md) ## 系统截图 ![overview](document/manual/img/overview.png) ![overview-1](document/manual/img/overview-1.png) ![tasks](document/manual/img/tasks.png) ![onclick](document/manual/img/onclick.png) ![application](document/manual/img/application.png) ![cpu](document/manual/img/cpu.png) ![memory](document/manual/img/memory.png) ## 版权 罗盘许可证是 [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),详情请参考 [LICENSE](LICENSE) and [NOTICE](NOTICE) 。