【问题标题】:Add the hapi 3rd-party lib (jars) to map-reduce将 hapi 3rd-party lib (jars) 添加到 map-reduce
【发布时间】:2016-04-28 15:19:03
【问题描述】:

我正在尝试将 hapi jar 添加到 map-reduce 任务中。我在 /home/training/lib 下拥有所有必需的 jar
我制作了包含我需要的所有 hapi 罐子并运行的胖罐子
hadoop jar mp.jar stubs.MsgParser infile outfile -libjars /home/training/lib 我懂了 Usage: MsgParser [generic options] <input dir> <output dir> 在我的驱动程序中,我实现了 ToolRunner
更多信息:

  • 我在 CloudEra 发行版上运行。
  • 我只需要映射器中的罐子
  • mp.jar 是从 Eclipse 导出的 jar

我的 hadoop jar 命令需要修改还是有其他解决方案可以添加这些 jar,我无法将 jar 复制到 /usr/lib/hadoop/client-0.20 因为我不是所有者
提前谢谢!

【问题讨论】:

    标签: java hadoop mapreduce cloudera hapi


    【解决方案1】:

    解决方案: 将你的 jars 上传到 hdfs 并简单地添加

    DistributedCache.addFileToClassPath(new Path(HDFSPATH), conf);  
    

    在驱动的main方法中

    【讨论】:

      猜你喜欢
      • 2017-02-25
      • 1970-01-01
      • 2011-07-24
      • 1970-01-01
      • 2017-07-23
      • 2012-06-11
      • 2017-11-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多