【问题标题】:How to fix resource changed on src filesystem issue如何修复在 src 文件系统问题上更改的资源
【发布时间】:2020-02-06 13:55:56
【问题描述】:

我正在尝试在执行SQL 的MR 上使用Hive,但它中途失败并出现以下错误:

Application application_1570514228864_0001 failed 2 times due to AM Container for appattempt_1570514228864_0001_000002 exited with exitCode: -1000
Failing this attempt.Diagnostics: [2019-10-08 13:57:49.272]Failed to download resource { { s3a://tpcds/tmp/hadoop-yarn/staging/root/.staging/job_1570514228864_0001/libjars, 1570514262820, FILE, null },pending,[(container_1570514228864_0001_02_000001)],1132444167207544,DOWNLOADING} java.io.IOException: Resource s3a://tpcds/tmp/hadoop-yarn/staging/root/.staging/job_1570514228864_0001/libjars changed on src filesystem (expected 1570514262820, was 1570514269265

从我的角度来看,错误日志中的关键信息是libjars changed on src filesystem (expected 1570514262820, was 1570514269265。 SO上有几个关于这个问题的帖子,但还没有得到回答,比如thread1thread2

我从apache jiraredhat bugzilla 中发现了一些有价值的东西。我通过所有相关节点通过NTP 同步时钟。但同样的问题仍然存在。

欢迎任何评论,谢谢。

【问题讨论】:

    标签: java hadoop hive bigdata


    【解决方案1】:

    我仍然不知道为什么资源文件的时间戳不一致并且无法通过配置方式修复它,AFAIK。

    但是,我设法找到了一种解决方法来跳过该问题。让我在这里为可能遇到相同问题的任何人总结一下。

    通过检查错误日志并在Hadoop源代码中搜索,我们可以在hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/FSDownload.java跟踪问题。

    只需删除抛出异常的语句,

      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());
              **/
                LOG.debug("[Gearon][Info] The timestamp is not consistent among resource files.\n" +
                                "Stop throwing exception . It doesn't affect other modules. ");
        }
        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);
      }
    

    构建 hadoop-yarn-project 并复制 'hadoop-yarn-common-x.x.x.jarto$HADOOP_HOME/share/hadoop/yarn`。

    在此处留下此线程,并感谢有关如何在不更改 hadoop 源的情况下修复它的任何进一步说明。

    【讨论】:

    • 在 osx 10.15.4 上出现同样的问题,看起来像 resource.getTimestamp() drop miliseconds which FileStatus hold
    【解决方案2】:

    我也必须这样做,这应该是可配置的,即使很小的延迟也会导致执行失败,如果将 hadoop 文件系统更改为使用 s3 并运行 MR 程序,可能会发生这种情况,注意*请确保,您是使用相同的 jdk 版本为您的 hadoop 版本生成 apache hadoop 文档中提到的 jar,否则您可能会遇到错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-08
      • 1970-01-01
      • 1970-01-01
      • 2019-02-20
      • 1970-01-01
      • 1970-01-01
      • 2010-12-09
      • 1970-01-01
      相关资源
      最近更新 更多