无法在aws emr中创建群集

jvlzgdj9  于 2021-06-02  发布在  Hadoop
关注(0)|答案(0)|浏览(152)

我试图使用java从eclipse创建一个emr集群。我能够输出作业id,但是当我查看emr web控制台时。没有创建任何群集。怎么了?
我的代码:

AWSCredentials credentials = new BasicAWSCredentials("xxx", "xxx");
         AmazonElasticMapReduceClient emr = new AmazonElasticMapReduceClient(credentials);

            StepFactory stepFactory = new StepFactory();

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

            StepConfig installHive = new StepConfig()
                .withName("Install Hive")
                .withActionOnFailure("TERMINATE_JOB_FLOW")
                .withHadoopJarStep(stepFactory.newInstallHiveStep());

            StepConfig hiveScript = new StepConfig().withName("Hive Script")
                .withActionOnFailure("TERMINATE_JOB_FLOW")
                .withHadoopJarStep(stepFactory.newRunHiveScriptStep("s3://mywordcountbuckett/binary/WordCount2.jar"));

            RunJobFlowRequest request = new RunJobFlowRequest()
                .withName("Hive Interactive")
                .withReleaseLabel("emr-4.1.0")
                .withSteps(enableDebugging, installHive)
                .withJobFlowRole("EMR_DefaultRole")
                .withServiceRole("EMR_EC2_DefaultRole")
                //.withSteps(enableDebugging, installHive)
                .withLogUri("s3://mywordcountbuckett/")
                .withInstances(new JobFlowInstancesConfig()
                    .withEc2KeyName("mykeypair")
                    .withHadoopVersion("2.4.0")            
                    .withInstanceCount(5)
                    .withKeepJobFlowAliveWhenNoSteps(true)
                    .withMasterInstanceType("m3.xlarge")
                    .withSlaveInstanceType("m1.large"));//.withAmiVersion("3.10.0");

            RunJobFlowResult result = emr.runJobFlow(request);
            System.out.println(result.toString());

我的输出是:

{JobFlowId: j-3T7H65FOSKHDQ}

我无法创建集群的原因是什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题