YARN应用程序退出,exitCode:-1000无法初始化用户目录



我得到的是:

Application application_1427711869990_0001 failed 2 times due to AM Container for appattempt_1427711869990_0001_000002 exited with exitCode: -1000 due to: Not able to initialize user directories in any of the configured local directories for user kailash
.Failing this attempt.. Failing the application.

我找不到任何与此退出代码和相关原因相关的内容。我使用的是Hadoop 2.5.0(Cloudera 5.3.2)。

实际上这是由于一些yarn本地目录的权限问题。我开始使用LinuxContainerExecutor(在非安全模式下,nonsecure-mode.local-user为kailash),并进行了相应的更改。然而,由于某些(未知)原因,NodeManager未能为用户清理本地目录,并且仍然存在与以前用户的目录(在我的案例中是yarn)。

因此,为了解决这个问题,我首先必须找到属性yarn.nodemanager.local-dirs的值(Cloudera使用搜索选项为YARN服务找到这个属性,否则在hadoop-conf目录中查找YARN-site.xml),然后为所有节点管理器节点延迟usercache下的文件/目录。在我的案例中,我使用了:

rm -rf /yarn/nm/usercache/*

万一有人丢失了用户缓存位置。如果您没有在任何位置配置yarn.nodemanager.local-dirs,请在默认位置${hadoop.tmp.dir}/nm-local-dir中查找它。同样,如果hadoop.tmp.dir没有在core-site.xml中配置,则它将在/tmp/hadoop-${user.name}下。user.name是用于运行当前Hadoop进程的UNIX用户。默认情况下,所有配置文件都在$HADOOP_INSTALL/etc/hadoop/下。

您需要应用此命令

rm-rf/dn/syarn/nm/usercache/*{这是我的配置}

请检查您在YARN(包括MR2)NodeManager本地目录中的配置。

https://i.stack.imgur.com/I6KjG.jpg

您需要将此应用于YARN 报告错误的数据节点

这是我案例的样本

https://i.stack.imgur.com/kIuwA.jpg

ApplicationMaster报告C90BFH04.本地域:8042,这是4号数据节点。所以我只应用于节点4 中的YARN目录

之后一切都好了!

当我用集群模式对纱线和演员进行火花提交测试时:

spark-submit --master yarn --deploy-mode cluster --class org.apache.spark.examples.SparkPi /usr/local/install/spark-2.2.0-bin-hadoop2.7/examples/jars/spark-examples_2.11-2.2.0.jar 100 正如我一样的错误:

Application application_1532249549503_0007 failed 2 times due to AM Container for appattempt_1532249549503_0007_000002 exited with exitCode: -1000 Failing this attempt.Diagnostics: java.io.IOException: Resource file:/usr/local/install/spark-2.2.0-bin-hadoop2.7/examples/jars/spark-examples_2.11-2.2.0.jar changed on src filesystem (expected 1531576498000, was 1531576511000

最后,我通过在$HADOOP_HOME/etc/HADOOP/core-site.xml

中设置属性fs.defaultFS修复了这个错误

损坏文件块文件

hdfs fsck -list-corruptfileblocks
hdfs fsck -delete

最新更新