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

本页面介绍如何创建 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 交互式会话的配置设置。您可以使用 控制台、gcloud CLI 或 Dataproc API 为 Jupyter 或 Spark Connect 会话创建 Serverless for Apache Spark 会话模板。 Google Cloud

控制台

如需使用 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 会话模板。

注意: