zoukankan      html  css  js  c++  java
  • 用eclipse开发hadoop入门程序wordcount

    首先用maven构建项目框架,然后写完code之后(详见:http://www.cnblogs.com/flying5/archive/2011/05/04/2078408.html),采用maven package打包成jar包:wordcount.jar。然后拷贝到布置好的hadoop服务器上。

    构建输入数据:

    hadoop fs -put input1.txt ./input/wordcount

    hadoop fs -put input2.txt ./input/wordcount

    运行job即可:

    hadoop jar wordcount.jar com.*.wordcount.job.JobRunner ./input/wordcount ./output/wordcount

    运行完之后,查看结果:

    hadoop fs -ls ./output/wordcount

    会发现有文件part-00000

    hadoop fs -cat ./output/wordcount/part-00000

    就可以看到hadoop结果了。

  • 相关阅读:
    设计模式-代理模式
    设计模式-策略模式
    设计模式-单例模式
    优先队列
    n!中质因子个数
    计算组合数
    高精度
    memset用法
    质因子分解
    素数筛法
  • 原文地址:https://www.cnblogs.com/tandychao/p/2916900.html
Copyright © 2011-2022 走看看