Spark UI
Spark UI 會從 Managed Service for Apache Spark 互動式工作階段收集 Apache Spark 執行作業詳細資料。Spark UI 功能預設為啟用,不需付費。Spark UI 功能收集的資料會保留 90 天。
必要的 Identity and Access Management 權限和角色
如要搭配互動式工作階段使用 Spark UI 功能,必須具備下列權限:
資料收集權限:
dataproc.sessions.sparkApplicationWrite。這項權限必須授予執行互動式工作階段的服務帳戶。Managed Service for Apache Spark Worker角色包含這項權限,且會自動授予 Managed Service for Apache Spark 預設使用的 Compute Engine 預設服務帳戶。不過,如果您為工作階段或執行階段設定檔 (工作階段範本) 指定自訂服務帳戶,則必須將這項dataproc.sessions.sparkApplicationWrite權限新增至該服務帳戶 (通常是將 Managed Service for Apache SparkWorker角色授予服務帳戶)。Spark UI 存取權限:
dataproc.sessions.sparkApplicationRead。使用者必須具備這項權限,才能在Google Cloud 控制台中存取 Spark UI。Dataproc Viewer、Dataproc Editor和Dataproc Administrator角色都包含這項權限。如要在 Google Cloud 控制台開啟 Spark UI,您必須具備下列其中一個角色,或具備包含這項權限的自訂角色。
開啟 Spark UI
Spark UI 頁面位於 Google Cloud 控制台。
在 Google Cloud 控制台中,前往 Managed Service for Apache Spark 的「Sessions」(工作階段) 頁面。
按一下「Session ID」,開啟「Session details」頁面。
點選頂端選單中的「View Spark UI」(查看 Spark UI)。
「View Spark UI」(查看 Spark UI) 連結是否已停用?如果未授予必要權限,或是在互動式工作階段詳細資料頁面取消勾選「啟用 Spark UI」核取方塊,或是在建立工作階段或建立執行階段設定檔 (工作階段範本) 時,將 spark.dataproc.appContext.enabled 屬性設為 false (預設值:true),則「查看 Spark UI」按鈕會停用。