EMR 集群在 AWS 控制台上不可见 UI

EMR Cluster no visible on AWS Console UI

我使用以下代码创建了一个集群:

> StepFactory stepFactory = new StepFactory();

            StepConfig enableDebugging = new StepConfig().withName("Enable Debugging")
                    .withActionOnFailure("TERMINATE_JOB_FLOW").withHadoopJarStep(stepFactory.newEnableDebuggingStep());


            Application spark = new Application().withName("Spark");

            RunJobFlowRequest createClusterParameters = new RunJobFlowRequest().withName("CreateDatamart")
                                            .withReleaseLabel("emr-5.5.0")
                                            .withSteps(enableDebugging)
                                            .withApplications(spark)
                                            .withLogUri("s3://logs/")
                                            .withServiceRole("EMR_DefaultRole")
                                            .withJobFlowRole("EMR_EC2_DefaultRole")
                                            .withInstances(new JobFlowInstancesConfig()
                                                    .withEc2KeyName("keypair")
                                                    .withInstanceCount(3)
                                                    .withKeepJobFlowAliveWhenNoSteps(false)
                                                    .withMasterInstanceType("m3.xlarge")
                                                    .withSlaveInstanceType("m3.xlarge"));

            RunJobFlowResult createCluster = emr.runJobFlow(createClusterParameters);

群集已创建。附带的步骤也是运行。 但是集群在 AWS EMR UI 中不可见。 我可以在 EMR 的“事件”选项卡下看到详细信息。 由于它位于“事件”选项卡下,因此没有必要在其他地区创建它。 (虽然我也检查过) 在 EC2 控制台中,我可以看到为 EMR 创建的容器。

在其他情况下,如果我直接从 UI 创建集群,它是可见的。

代码有没有错误?

如果要将 IAM 用户可见性添加到新集群,请调用 RunJobFlow 并将 VisibleToAllUsers 设置为 true,否则 IAM 用户无法查看集群。

因此您只需要在创建集群之前添加以下行:

createClusterParameters.setVisibleToAllUsers(true);

注意: 如果您使用 Python SDK 创建 AWS Lambda 是否类似:

response1 = emr.run_job_flow(
    Name=CLUSTER_NAME, # more properties [...]
    VisibleToAllUsers=True
)