• 运行hadoop自带的wordcount例子程序


    1.准备文件
    [root@master ~]# cat input.txt
    hello java
    hello python
    hello c
    hello java
    hello js
    hello html
    hello java
    [root@master ~]# hadoop fs -mkdir /input
    [root@master ~]# hadoop fs -put input.txt /input
    [root@master ~]# hadoop fs -ls /input
    Found 1 items
    -rw-r--r-- 2 root supergroup 74 2018-11-14 21:42 /input/input.txt

    2.例子程序位置
    /usr/local/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar

    3.运行
    [root@master ~]# hadoop jar hadoop-mapreduce-examples-2.7.3.jar wordcount /input/input.txt /output
    [root@master ~]# hadoop fs -ls /output/
    Found 2 items
    -rw-r--r-- 2 root supergroup 0 2018-11-14 21:46 /output/_SUCCESS
    -rw-r--r-- 2 root supergroup 40 2018-11-14 21:46 /output/part-r-00000

    4.查看结果
    [root@master ~]# hadoop fs -text /output/part-r-00000
    c 1
    hello 7
    html 1
    java 3
    js 1
    python 1

  • 相关阅读:
    String painter HDU
    GCD Counting-树形DP
    XOR UVALive
    BZOJ-9-3295: [Cqoi2011]动态逆序对
    E
    Stars HDU
    二维单调队列(理想的正方形+修筑绿化带)
    P3622 [APIO2007]动物园
    COJ1160[一本通 5.3 例 1」Amount of Degrees
    [ZJOI2008]骑士
  • 原文地址:https://www.cnblogs.com/413xiaol/p/9961028.html
Copyright © 2020-2023  润新知