为虚拟集群创建交互式端点 - Amazon EMR

为虚拟集群创建交互式端点

本页介绍如何使用 AWS 命令行界面(AWS CLI)创建交互式端点。

使用 create-managed-endpoint 命令创建交互式端点

指定 create-managed-endpoint 命令中的参数,如下所示。Amazon EMR on EKS 支持使用 Amazon EMR 版本 6.7.0 及更高版本创建交互式端点。

aws emr-containers create-managed-endpoint \ ‐‐type JUPYTER_ENTERPRISE_GATEWAY \ ‐‐virtual‐cluster‐id 1234567890abcdef0xxxxxxxx \ ‐‐name example-endpoint-name \ ‐‐execution-role-arn arn:aws:iam::444455556666:role/JobExecutionRole \ ‐‐release-label emr-6.9.0-latest \ ‐‐configuration-overrides '{ "applicationConfiguration": [{ "classification": "spark-defaults", "properties": { "spark.driver.memory": "2G" } }], "monitoringConfiguration": { "cloudWatchMonitoringConfiguration": { "logGroupName": "log_group_name", "logStreamNamePrefix": "log_stream_prefix" }, "persistentAppUI": "ENABLED", "s3MonitoringConfiguration": { "logUri": "s3://my_s3_log_location" } } }'

有关更多信息,请参阅用于创建交互式端点的参数

使用 JSON 文件中的指定参数创建交互式端点

  1. 创建一个 create-managed-endpoint-request.json 文件并指定端点所需的参数,如下面的 JSON 文件所示:

    { "name": "MY_TEST_ENDPOINT", "virtualClusterId": "MY_CLUSTER_ID", "type": "JUPYTER_ENTERPRISE_GATEWAY", "releaseLabel": "emr-6.9.0-latest", "executionRoleArn": "arn:aws:iam::444455556666:role/JobExecutionRole", "configurationOverrides": { "applicationConfiguration": [ { "classification": "spark-defaults", "properties": { "spark.driver.memory": "8G" } } ], "monitoringConfiguration": { "persistentAppUI": "ENABLED", "cloudWatchMonitoringConfiguration": { "logGroupName": "my_log_group", "logStreamNamePrefix": "log_stream_prefix" }, "s3MonitoringConfiguration": { "logUri": "s3://my_s3_log_location" } } } }
  2. 使用 create-managed-endpoint 命令和存储在本地或 Amazon S3 上的 create-managed-endpoint-request.json 文件路径。

    aws emr-containers create-managed-endpoint \ ‐‐cli-input-json file://./create-managed-endpoint-request.json ‐‐region AWS-Region

创建交互式端点输出

您应该参阅终端中的以下输出。输出包括新的交互式端点的名称和标识符:

{ "id": "1234567890abcdef0", "name": "example-endpoint-name", "arn": "arn:aws:emr-containers:us-west-2:111122223333:/virtualclusters/444455556666/endpoints/444455556666", "virtualClusterId": "111122223333xxxxxxxx" }

运行 aws emr-containers create-managed-endpoint 会创建自签名证书,该证书允许 EMR Studio 与交互式端点服务器之间进行 HTTP 通信。

如果您运行 create-managed-endpoint 但尚未完成先决条件,Amazon EMR 将返回一条错误消息,其中包含您必须执行才能继续的操作。

用于创建交互式端点的参数

交互式端点的必需参数

创建交互式端点时,必须指定以下参数:

‐‐type

使用 JUPYTER_ENTERPRISE_GATEWAY。这是唯一支持的类型。

‐‐virtual-cluster-id

您向 Amazon EMR on EKS 注册的虚拟集群的标识符。

‐‐name

交互式端点的描述性名称,有助于 EMR Studio 用户从下拉列表中选择交互式端点。

‐‐execution-role-arn

Amazon EMR on EKS 的 IAM 任务执行角色的 Amazon 资源名称(ARN),其作为先决条件的一部分创建。

‐‐release-label

用于端点的 Amazon EMR 版本的发行版标签。例如,emr-6.9.0-latest。Amazon EMR on EKS 支持使用 Amazon EMR 版本 6.7.0 及更高版本的交互式端点。

交互式端点的可选参数

或者,创建交互式端点时,还能指定以下参数:

‐‐configuration-overrides

要覆盖应用程序的默认配置,请提供配置对象。您可以使用简写语法提供配置,或可引用 JSON 文件中的配置对象。

配置对象包含分类、属性和可选的嵌套配置。属性由您希望在该文件中覆盖的设置组成。您可以在一个 JSON 对象中为多个应用程序指定多个分类。可用的配置分类因 Amazon EMR on EKS 发行版而异。有关 Amazon EMR on EKS 每个发行版可用的配置分类列表,请参阅 Amazon EMR on EKS 版本。除了为每个发行版列出的配置分类外,交互式端点还引入了额外的分类 jeg-config。有关更多信息,请参阅Jupyter Enterprise Gateway(JEG)配置选项