【问题标题】:Find path of jar file in GCP在 GCP 中查找 jar 文件的路径
【发布时间】:2020-02-29 04:50:29
【问题描述】:

在 Google File Platform 中找到 hadoop-streaming-1.2.1.jar jar 文件的路径。

https://github.com/devangpatel01/TF-IDF-implementation-using-map-reduce-Hadoop-python-

我正在尝试使用 hadoop 在 GCP 上运行此 mapreduce,但我无法找到 hadoop-streaming-1.2.1.jar 的路径。我尝试手动下载jar文件并将其上传到hadoop中,然后运行mapper1.py。但是我收到错误消息说路径错误。上面的程序是在本地机器上运行的。如何编辑命令以在 GCP 上运行它?

hadoop jar /home/kirthyodackal/hadoop-streaming-1.2.1.jar -input hdfs://cluster-29-m/input_prgs/input_prgs/input1/000000_0 -output hdfs://cluster-29-m/ input_prgs/input_prgs/output1 -mapper hdfs://cluster-29-m/input_prgs/input_prgs/mapper1.py -reducer hdfs://cluster-29-m/input_prgs/input_prgs/reducer1.py

【问题讨论】:

标签: hadoop google-cloud-platform jar reducers mapper


【解决方案1】:

我使用了不同的 Mapper-Reducer 程序并且可以运行 mapreduce。我使用来自https://github.com/SatishUC15/TFIDF-HadoopMapReduce#tfidf-hadoop 的代码并在我的 GCP 集群上运行以下命令。

> hadoop jar /usr/lib/hadoop-mapreduce/hadoop-streaming.jar -file /home/kirthyodackal/MapperPhaseOne.py /home/kirthyodackal/ReducerPhaseOne.py -mapper "python MapperPhaseOne.py" -reducer "python ReducerPhaseOne.py" -input hdfs://cluster-3299-m/mapinput/inputfile -output hdfs://cluster-3299-m/mappred1

> hadoop jar /usr/lib/hadoop-mapreduce/hadoop-streaming.jar -file /home/kirthyodackal/MapperPhaseTwo.py /home/kirthyodackal/ReducerPhaseTwo.py -mapper "python MapperPhaseTwo.py" -reducer "python ReducerPhaseTwo.py" -input hdfs://cluster-3299-m/mappred1/part-00000 hdfs://cluster-3299-m/mappred1/part-00001 hdfs://cluster-3299-m/mappred1/part-00002 hdfs://cluster-3299-m/mappred1/part-00003 hdfs://cluster-3299-m/mappred1/part-00004  -output hdfs://cluster-3299-m/mappred2

> hadoop jar /usr/lib/hadoop-mapreduce/hadoop-streaming.jar -file /home/kirthyodackal/MapperPhaseThree.py /home/kirthyodackal/ReducerPhaseThree.py -mapper "python MapperPhaseThree.py" -reducer "python ReducerPhaseThree.py" -input hdfs://cluster-3299-m/mappred2/part-00000 hdfs://cluster-3299-m/mappred2/part-00001 hdfs://cluster-3299-m/mappred2/part-00002 hdfs://cluster-3299-m/mappred2/part-00003 hdfs://cluster-3299-m/mappred2/part-00004  -output hdfs://cluster-3299-m/mappredf

以下链接概述了我如何在 GCP 上使用 MapReduce。 https://github.com/kirthy21/Data-Analysis-Stack-Exchange-Hadoop-Pig-Hive-MapReduce-TFIDF

【讨论】:

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