zoukankan      html  css  js  c++  java
  • 大数据-Hadoop 本地运行模式

    Grep案例

    1. 创建在hadoop-2.7.2文件下面创建一个input文件夹

    [atguigu@hadoop101 hadoop-2.7.2]$ mkdir input

    2. Hadoopxml配置文件复制到input

    [atguigu@hadoop101 hadoop-2.7.2]$ cp etc/hadoop/*.xml input

    3. 执行share目录下的MapReduce程序(执行)

    [atguigu@hadoop101 hadoop-2.7.2]$ bin/hadoop jar

    share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar grep input output 'dfs[a-z.]+'(要正常的运行,必须要保证output删除,没有才能运行)

    4. 查看输出结果

    [atguigu@hadoop101 hadoop-2.7.2]$ cat output/*

    WordCount案例

    1. 创建在hadoop-2.7.2文件下面创建一个wcinput文件夹

    [atguigu@hadoop101 hadoop-2.7.2]$ mkdir wcinput

    2. wcinput文件下创建一个wc.input文件

    [atguigu@hadoop101 hadoop-2.7.2]$ cd wcinput

    [atguigu@hadoop101 wcinput]$ touch wc.input

    3. 编辑wc.input文件

    [atguigu@hadoop101 wcinput]$ vi wc.input

     

    保存退出::wq

    4. 回到Hadoop目录/opt/module/hadoop-2.7.2

    5. 执行程序

    [atguigu@hadoop101 hadoop-2.7.2]$ hadoop jar

     share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount wcinput wcoutput

    6. 查看结果

    [atguigu@hadoop101 hadoop-2.7.2]$ cat wcoutput/part-r-00000

  • 相关阅读:
    关于 TIdHttp
    DCEF3 相关资料
    WPF RichTextBox 控件常用方法和属性
    Delphi Data Type to C# Data Type
    获取 CPU 序列号
    Visual Studio 调用 Delphi DLL 会退出的解决方案
    IDHttp的基本用法(转)
    TChromeTabs 优化改进
    java与json转换
    js charAt()方法
  • 原文地址:https://www.cnblogs.com/nidegui/p/11214055.html
Copyright © 2011-2022 走看看