AWS EMR InvalidAuxServiceException:auxService:mapreduce_shuffle不存在

时间:2018-04-12 12:10:33

标签: amazon-web-services hadoop amazon-emr

我在运行时基于用户事件启动EMR集群,一旦完成作业,集群将被终止。

当集群启动并且任务正在执行时,我得到了错误:

我读了一些帖子,建议我们需要在namenode和datanode中更新yarn-site.xml并重新启动yarn实例。

不确定如何在群集本身启动期间配置它。

org.apache.hadoop.yarn.exceptions.InvalidAuxServiceException: The auxService:mapreduce_shuffle does not exist

Container launch failed for container_1523533251407_0001_01_000002 : org.apache.hadoop.yarn.exceptions.InvalidAuxServiceException: The auxService:mapreduce_shuffle does not exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.instantiateException(SerializedExceptionPBImpl.java:168)
at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.deSerialize(SerializedExceptionPBImpl.java:106)
at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$Container.launch(ContainerLauncherImpl.java:155)
at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$EventProcessor.run(ContainerLauncherImpl.java:390)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

由于

答案:

以下是我在代码中添加的用于解决问题的内容:

Map<String,String> yarnProperties = new HashMap<String,String>();
        yarnProperties.put("yarn.nodemanager.aux-services","mapreduce_shuffle");
        yarnProperties.put("yarn.nodemanager.aux-services.mapreduce_shuffle.class","org.apache.hadoop.mapred.ShuffleHandler");

        Configuration yarnConfig = new Configuration()
                .withClassification("yarn-env")
                .withProperties(yarnProperties);
RunJobFlowRequest request = new RunJobFlowRequest()
            .withConfigurations(yarnConfig)

1 个答案:

答案 0 :(得分:1)

我们在yarn-site.xml中设置了一些其他属性。

如果您尝试使用AWS CLI创建,可以使用

  

- 使用config'

配置'json文件

否则,如果您尝试通过java创建,例如

Application hive = new Application().withName("Hive");

Map<String,String> hiveProperties = new HashMap<String,String>();
    hiveProperties.put("hive.join.emit.interval","1000");
    hiveProperties.put("hive.merge.mapfiles","true");

Configuration myHiveConfig = new Configuration()
    .withClassification("hive-site")
    .withProperties(hiveProperties);

然后你可以推荐为

RunJobFlowRequest request = new RunJobFlowRequest()
    .withName("Create cluster with ReleaseLabel")
    .withReleaseLabel("emr-5.13.0")
    .withApplications(hive)
    .withConfigurations(myHiveConfig)

对于另一个问题: -

您需要以上述方式添加此2个属性,然后创建群集: -

<configuration>
  <property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
  </property>
  <property>
    <name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
    <value>org.apache.hadoop.mapred.ShuffleHandler</value>
  </property>
</configuration>