【问题标题】:Distcp Mismatch in length of sourceDistcp 源长度不匹配
【发布时间】:2017-05-23 09:48:32
【问题描述】:

我在两个不同的 hadoop 集群之间执行 distcp 命令时遇到问题,

原因:java.io.IOException:长度不匹配 来源:hdfs://ip1/xxxxxxxxxx/xxxxxx 和 目标:hdfs://nameservice1/xxxxxx/.distcp.tmp.attempt_1483200922993_0056_m_000011_2

我尝试使用 -pb 和 -skipcrccheck:

hadoop distcp -pb -skipcrccheck -update hdfs://ip1/xxxxxxxxxx/xxxxx hdfs:///xxxxxxxxxxxx/ 

hadoop distcp -pb  hdfs://ip1/xxxxxxxxxx/xxxxx hdfs:///xxxxxxxxxxxx/ 

hadoop distcp -skipcrccheck -update hdfs://ip1/xxxxxxxxxx/xxxxx hdfs:///xxxxxxxxxxxx/ 

但似乎没有任何效果。

请提供任何解决方案。

【问题讨论】:

  • 集群的版本是否相同?我认为两个集群的版本不兼容。基于 Hadoop 权威指南 尝试:If the two clusters are running incompatible versions of HDFS, then you can use the webhdfs protocol to distcp between them: % hadoop distcp webhdfs://namenode1:50070/foo webhdfs://namenode2:50070/foo
  • 版本(cdh5.8.2)相同,事件尝试使用 webhdfs 但仍然出现相同的错误。
  • 它是否总是对所有内容都失败,或者有时对特定文件?它是在 2 个方向上失败还是只是从集群 1 到集群 2 失败?
  • 如果有任何错误/损坏的文件,它会失败,是的,它可以在集群 1 到集群 2 的两个方向上失败,反之亦然。

标签: hadoop distcp


【解决方案1】:

我在两个完全相同版本的 Hadoop 集群之间遇到了相同的 distcp 问题。对我来说,原来是由于其中一个源目录中的一些文件仍然打开。一旦我为每个源目录单独运行 distcp,我就能发现情况就是这样——它对所有打开文件的目录都有效,并且只对那些文件有效。当然,乍一看很难说。

【讨论】:

    【解决方案2】:

    通过执行从 cluster1 到本地 linux fs 的 copyToLocal 和从 cluster2 的 copyFromLocal 来解决问题。

    【讨论】:

      【解决方案3】:
      1. 查看源文件统计信息,使用命令:

        hdfs fsck hdfs://xxxxxxxxxxx
        
      2. 如果源文件没有关闭,使用这个命令关闭它:

        hdfs debug recoverLease -path hdfs://xxxxxxx
        
      3. hadoop distcp -bandwidth 15 -m 50 -pb hdfs://xxxxxx hdfs://xxxxxx

      【讨论】:

        猜你喜欢
        • 2018-04-28
        • 2022-01-10
        • 1970-01-01
        • 2018-02-22
        • 2016-12-02
        • 1970-01-01
        • 2016-08-31
        • 1970-01-01
        • 2021-06-30
        相关资源
        最近更新 更多