首页 > 解决方案 > 纱线上的mapreduce作业以exitCode退出:-1000,因为src文件系统上的资源已更改

问题描述

    Application application_1552978163044_0016 failed 5 times due to AM Container for appattempt_1552978163044_0016_000005 exited with exitCode: -1000

诊断:

java.io.IOException:资源 abfs://xxx@xxx.dfs.core.windows.net/hdp/apps/2.6.5.3006-29/mapreduce/mapreduce.tar.gz 在 src 文件系统上更改(预期为 1552949440000,为 1552978240000这次尝试失败。申请失败。

标签: azure-storagehadoop-yarnhadoop2azure-hdinsight

解决方案


仅根据异常信息,似乎是由于 Azure Storage 无法保留复制文件的原始时间戳。我搜索了一个解决方法,建议更改源代码yarn-common以在复制文件时禁用时间戳检查的代码块,以避免抛出异常以使 MR 作业连续工作。

这是最新版本的源代码yarn-common,其中检查复制文件的时间戳并引发异常。

/** #L255
   * Localize files.
   * @param destination destination directory
   * @throws IOException cannot read or write file
   * @throws YarnException subcommand returned an error
   */
  private void verifyAndCopy(Path destination)
      throws IOException, YarnException {
    final Path sCopy;
    try {
      sCopy = resource.getResource().toPath();
    } catch (URISyntaxException e) {
      throw new IOException("Invalid resource", e);
    }
    FileSystem sourceFs = sCopy.getFileSystem(conf);
    FileStatus sStat = sourceFs.getFileStatus(sCopy);
    if (sStat.getModificationTime() != resource.getTimestamp()) {
      throw new IOException("Resource " + sCopy +
          " changed on src filesystem (expected " + resource.getTimestamp() +
          ", was " + sStat.getModificationTime());
    }
    if (resource.getVisibility() == LocalResourceVisibility.PUBLIC) {
      if (!isPublic(sourceFs, sCopy, sStat, statCache)) {
        throw new IOException("Resource " + sCopy +
            " is not publicly accessible and as such cannot be part of the" +
            " public cache.");
      }
    }

    downloadAndUnpack(sCopy, destination);
  }

推荐阅读