快速入門:使用 Synapse Studio 建立無伺服器 Apache Spark 集區

Azure Synapse Analytics 提供各種分析引擎,可協助您內嵌、轉換、模型、分析及提供您的數據。 Apache Spark 集區提供開放原始碼巨量數據計算功能。 在 Synapse 工作區中建立 Apache Spark 集區之後,即可載入、模型化、處理及提供數據,以取得深入解析。

本快速入門說明使用 Synapse Studio 在 Synapse 工作區中建立 Apache Spark 集區的步驟。

重要

不論您使用Spark實例,是否按分鐘計費。 使用Spark實例之後,請務必關閉Spark實例,或設定短暫的逾時。 如需詳細資訊,請參閱 本文的清除資源 一節。

如果您沒有 Azure 訂用帳戶,請在開始前建立免費帳戶

必要條件

登入 Azure 入口網站

登入 Azure 入口網站

  1. 流覽至將建立 Apache Spark 集區的 Synapse 工作區,方法是直接在搜尋列中輸入服務名稱(或資源名稱)。 Screenshot from the Azure portal of the search bar with Synapse workspaces typed in.

  2. 從工作區清單中,輸入要開啟之工作區的名稱(或部分名稱)。 在此範例中,我們使用名為 contosoanalytics 的工作區。 Screenshot from the Azure portal of the list of Synapse workspaces filtered to show those containing the name Contoso.

啟動 Synapse Studio

從工作區概觀中,選取 工作區Web URL 以開啟 Synapse Studio。

Screenshot from the Azure portal of a Synapse workspace overview with Launch Synapse Studio highlighted.

在 Synapse Studio 中建立 Apache Spark 集區

重要

自 2023 年 9 月起,Apache Spark 2.4 的 Azure Synapse Runtime 已被取代,且正式不受支援。 假設 Spark 3.1Spark 3.2 也宣佈終止支持, 我們建議客戶移轉至Spark 3.3

  1. 在 Synapse Studio 首頁上,選取 [管理] 圖示,流覽至左側導覽中的 [管理中樞]。 Screenshot from the Azure portal of the Synapse Studio home page with Management Hub section highlighted.

  2. 進入 [管理中樞] 之後,瀏覽至 [Apache Spark 集區] 區段,以查看工作區中目前可用的 Apache Spark 集區清單。 Screenshot from the Azure portal of the Synapse Studio management hub with Apache Spark pools navigation selected.

  3. 選取 [+ 新增],新的 Apache Spark 集區建立精靈隨即出現。

  4. 在 [基本] 索引標籤中,輸入下列詳細資料:

    設定 建議的值 描述
    Apache Spark 集區名稱 有效的集區名稱,例如 contosospark 這是 Apache Spark 集區將擁有的名稱。
    節點大小 小 (4 個虛擬 CPU/32 GB) 將此設為最小的大小,以降低本快速入門的成本
    Autoscale 停用 在本快速入門中,我們不需要自動調整
    節點數目 8 使用小型大小來限制本快速入門中的成本
    動態配置執行程式 停用 此設定會對應至 Spark 應用程式執行程式設定之 Spark 組態中的動態配置屬性。 在本快速入門中,我們不需要自動調整。

    Screenshot from the Azure portal of the Basics for Synapse Studio new Apache Spark pool.

    重要

    Apache Spark 集區可以使用的名稱有特定限制。 名稱必須只包含字母或數位、必須是15或更少字元、必須以字母開頭、不包含保留字,而且在工作區中是唯一的。

  5. 在下一個索引標籤中, [其他設定],將所有設定保留為預設值。

  6. 選取 [標籤]。 請考慮使用 Azure 標籤。 例如,用來識別誰建立資源的 「Owner」 或 「CreatedBy」 標記,以及用來識別此資源是否在生產、開發等中的 「Environment」 標記。如需詳細資訊,請參閱 開發 Azure 資源的命名和標記策略。 準備好時,請選取 [ 檢閱 + 建立]。

  7. 在 [檢閱 + 建立] 索引標籤中,依據先前輸入的內容,確定詳細資料看起來正確無誤,然後按 [建立]

    Screenshot from the Azure portal of the Create Synapse Studio new Apache Spark pool.

  8. Apache Spark 集區將會開始布建程式。

  9. 布建完成後,新的 Apache Spark 集區會出現在清單中。

    Screenshot from the Azure portal of the Synapse Studio new Apache Spark pool list.

使用 Synapse Studio 清除 Apache Spark 集區資源

下列步驟會使用 Synapse Studio 從工作區中刪除 Apache Spark 集區。

警告

刪除 Spark 集區將會從工作區中移除分析引擎。 將無法再連線到集區,而且使用此Spark集區的所有查詢、管線和筆記本將無法再運作。

如果您要刪除 Apache Spark 集區,請執行下列步驟:

  1. 流覽至 Synapse Studio 中管理中樞的 Apache Spark 集區。

  2. 選取要刪除的 Apache 集區旁的省略號(在此案例中為 contosospark)以顯示 Apache Spark 集區的命令。

    Screenshot from the Azure portal of a list of Apache Spark pools, with the recently created pool selected.

  3. 選取 [刪除]

  4. 確認刪除,然後按 [刪除] 按鈕。

  5. 當流程成功完成之後,Apache Spark 集區將不再列於工作區資源中。