監控 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 應用程式資源分配情形。

永久記錄伺服器

叢集執行時,您可以使用叢集上執行的開放原始碼網頁介面,但刪除叢集後,這些介面就會終止。如要在刪除叢集後查看叢集和工作資料,可以建立永久記錄伺服器 (PHS)。

示例:您遇到想要分析的工作錯誤或速度變慢問題。您可以停止或刪除工作叢集,然後使用 PHS 查看及分析工作記錄資料。

建立 PHS 後,您可以在建立叢集或提交批次工作負載時,在 Managed Service for Apache Spark 叢集或 Managed Service for Apache Spark 批次工作負載中啟用 PHS。PHS 可以存取在多個叢集上執行的工作記錄資料,讓您監控整個專案的工作,不必監控在不同叢集上執行的個別 UI。

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,即使叢集遭到刪除或工作負載完成,記錄檔仍會保留在 Logging 中。

Managed Service for Apache Spark 指標

Managed Service for Apache Spark 叢集和作業指標 (以 dataproc.googleapis.com/ 為前置字元) 包含時間序列資料,可深入瞭解叢集效能,例如 CPU 使用率或作業狀態。Managed Service for Apache Spark 自訂指標 (以 custom.googleapis.com/ 為前置字元) 包括叢集上執行的開放原始碼系統發出的指標,例如 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 叢集和工作。您可以在 Google Cloud 控制台的「資訊主頁總覽」頁面中建立資訊主頁,方法是按一下、建立,然後從「指標探索器」頁面儲存圖表。

快訊

您可以建立 Managed Service for Apache Spark 指標警報,及時收到叢集或工作問題的通知。

後續步驟