监控 Managed Service for Apache Spark 集群和作业

本文档讨论了可用于监控 Managed Spark 集群和作业的健康状况和性能的工具和方法。

开源网页界面

许多 Managed Service for Apache Spark 集群开源组件(例如 Apache Hadoop 和 Apache Spark)都提供网页界面。这些界面可用于监控集群资源和作业的性能。例如,您可以使用 YARN Resource Manager 界面查看 Managed Service for Apache Spark 集群上的 YARN 应用资源分配情况。

Persistent History Server

在集群上运行的开源网页界面在集群运行时可用,但在您删除集群时会终止。如需在删除集群后查看集群和 作业数据,您可以创建 Persistent History Server (PHS)。

示例:您遇到了要分析的作业错误或速度变慢问题。您停止或删除作业集群,然后使用 PHS 查看和分析作业历史记录数据。

创建 PHS 后,您可以在创建 Managed Service for Apache Spark 集群或提交 Managed Service for Apache Spark 批量工作负载时,在相应集群或批量工作负载上启用它。PHS 可以访问在多个集群上运行的作业的记录数据,让您能够监控项目中的作业,而不是监控在不同集群上运行的单独界面。

Managed Service for Apache Spark 日志

Managed Service for Apache Spark 会收集由 Apache Hadoop、 Spark、Hive、ZooKeeper 以及在集群上运行的其他开源系统生成的日志, 并将这些日志发送到 Logging。这些日志会根据日志来源进行分组,这可让您选择并查看感兴趣的日志:例如,系统会单独标记在集群上生成的 YARN NodeManager 和 Spark Executor 日志。如需详细了解 Managed Service for Apache Spark 日志内容和选项,请参阅Managed Service for Apache Spark 日志

Cloud Logging

Logging 是一个全托管式实时日志管理系统。它 为从 Google Cloud 服务提取的日志提供了存储空间,并提供了用于 大规模搜索、过滤和分析日志的工具。Managed Service for Apache Spark 集群会生成多个日志,包括 Managed Service for Apache Spark 服务 代理 日志、集群启动日志和 OSS 组件日志,例如 YARN NodeManager 日志。

在 Managed Service for Apache Spark 集群和 Managed Service for Apache Spark 批量工作负载上,日志记录默认处于启用状态。日志会定期导出到 Logging,并在集群删除或工作负载完成后继续保留。

Managed Service for Apache Spark 指标

Managed Service for Apache Spark 集群和作业 指标( 前缀为 dataproc.googleapis.com/)由时序数据组成, 提供有关集群性能的见解,例如 CPU 利用率或 作业状态。以 custom.googleapis.com/ 为前缀的 Managed Service for Apache Spark custom metrics 自定义指标,包括集群上运行的开源系统 生成的指标,例如 YARN running applications 指标。深入了解 Managed Service for Apache Spark 指标可帮助您高效地配置集群。设置基于指标的提醒可帮助您快速识别问题并做出响应。

Managed Service for Apache Spark 集群和作业指标默认免费收集。自定义指标的收集会向客户收费。您 可以在创建集群时启用自定义 指标的收集。 在 Spark 批量工作负载上,Managed Service for Apache Spark Spark 指标的收集 默认处于启用状态。

Cloud Monitoring

监控使用集群元数据和指标( 包括 HDFS、YARN、作业和操作指标),以便了解 Managed Service for Apache Spark 集群 和作业的健康状况、性能和可用性。您可以使用 Monitoring 探索指标、添加图表、构建信息中心和创建提醒。

Metrics Explorer

您可以使用 Metrics Explorer 查看 Managed Service for Apache Spark 指标。Managed Service for Apache Spark 集群、作业和 Managed Service for Apache Spark 批量指标列在 Cloud Managed Service for Apache Spark ClusterCloud Managed Service for Apache Spark JobCloud Managed Service for Apache Spark Batch 资源下。Managed Service for Apache Spark 自定义指标列在 VM Instances 资源的 Custom 类别下。

图表

您可以使用 Metrics Explorer 来 创建 图表,以直观呈现 Managed Service for Apache Spark 指标。

示例:您创建了一个图表,用于查看在集群上运行的活跃 Yarn 应用的数量,然后添加过滤条件,按集群名称或区域选择可视化指标。

信息中心

您可以构建信息中心 以使用来自 多个项目和不同 Google Cloud 产品的指标来监控 Managed Service for Apache Spark 集群和作业。您可以在 控制台的信息中心概览页面中,通过 Metrics Explorer 页面点击、创建并保存图表,从而构建信息中心。 Google Cloud

提醒

您可以创建 Managed Service for Apache Spark 指标 提醒,以便及时收到集群 或作业问题的通知。

后续步骤