创建交互式会话和会话模板

本页面介绍了如何创建 Serverless for Apache Spark 交互式会话和会话模板。会话模板可用于根据会话模板配置创建多个互动式会话。

创建交互式会话

您可以使用 Google Cloud CLI 或 Dataproc API 创建 Serverless for Apache Spark 交互式会话。

gcloud

您可以使用 gcloud beta dataproc sessions create command SESSION_NAME 创建 Serverless for Apache Spark 交互式会话。

gcloud beta dataproc sessions create spark SESSION_ID \
    --location=REGION \
    optional flags ...

替换或添加以下内容:

REST

您可以使用 Dataproc sessions.create API 创建 Serverless for Apache Spark 交互式会话。

注意:

创建会话模板

Serverless for Apache Spark 会话模板用于定义创建一项或多项 Serverless for Apache Spark 交互式会话的配置设置。您可以使用 Google Cloud 控制台、gcloud CLI 或 Dataproc API 为 Jupyter 或 Spark Connect 会话创建 Serverless for Apache Spark 会话模板。

控制台

如需使用 Google Cloud 控制台创建 Serverless for Apache Spark 会话模板,请完成以下步骤:

  1. 在 Google Cloud 控制台中,前往会话模板页面。

    前往“会话模板”

    1. 点击创建
  2. 创建会话模板页面中,输入或确认模板配置设置。请注意以下几点:

  3. 点击提交以创建会话模板。

gcloud

您无法使用 gcloud CLI 直接创建 Serverless for Apache Spark 会话模板,但可以使用 gcloud beta dataproc session-templates import 命令导入现有会话模板。您可以修改导入的模板,然后使用 gcloud beta dataproc session-templates export 命令将其导出。

REST

您可以使用 Dataproc sessionTemplates.create API 创建 Serverless for Apache Spark 会话模板。

注意: