1. 测试MapReduce Job

1.1 上传文件到hdfs文件系统

$ jps
Jps
SecondaryNameNode
JobHistoryServer
NameNode
ResourceManager
$ jps > infile
$ hadoop fs -mkdir /inputdir
$ hadoop fs -put infile /inputdir
$ hadoop fs -ls /inputdir
Found items
-rw-r--r-- hduser supergroup -- : /inputdir/infile

1.2 进行word count计算

$ hadoop jar /usr/local/hadoop-2.7./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7..jar wordcount /inputdir /outputdir
// :: INFO client.RMProxy: Connecting to ResourceManager at /172.16.101.55:
// :: INFO input.FileInputFormat: Total input paths to process :
// :: INFO mapreduce.JobSubmitter: number of splits:
// :: INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1504106569900_0001
// :: INFO impl.YarnClientImpl: Submitted application application_1504106569900_0001
// :: INFO mapreduce.Job: The url to track the job: http://sht-sgmhadoopnn-01:8088/proxy/application_1504106569900_0001/
// :: INFO mapreduce.Job: Running job: job_1504106569900_0001
// :: INFO mapreduce.Job: Job job_1504106569900_0001 running in uber mode : false
// :: INFO mapreduce.Job: map % reduce %
// :: INFO mapreduce.Job: map % reduce %
// :: INFO mapreduce.Job: map % reduce %
// :: INFO mapreduce.Job: Job job_1504106569900_0001 completed successfully
// :: INFO mapreduce.Job: Counters:
File System Counters
FILE: Number of bytes read=
FILE: Number of bytes written=
FILE: Number of read operations=
FILE: Number of large read operations=
FILE: Number of write operations=
HDFS: Number of bytes read=
HDFS: Number of bytes written=
HDFS: Number of read operations=
HDFS: Number of large read operations=
HDFS: Number of write operations=
Job Counters
Launched map tasks=
Launched reduce tasks=
Data-local map tasks=
Total time spent by all maps in occupied slots (ms)=
Total time spent by all reduces in occupied slots (ms)=
Total time spent by all map tasks (ms)=
Total time spent by all reduce tasks (ms)=
Total vcore-milliseconds taken by all map tasks=
Total vcore-milliseconds taken by all reduce tasks=
Total megabyte-milliseconds taken by all map tasks=
Total megabyte-milliseconds taken by all reduce tasks=
Map-Reduce Framework
Map input records=
Map output records=
Map output bytes=
Map output materialized bytes=
Input split bytes=
Combine input records=
Combine output records=
Reduce input groups=
Reduce shuffle bytes=
Reduce input records=
Reduce output records=
Spilled Records=
Shuffled Maps =
Failed Shuffles=
Merged Map outputs=
GC time elapsed (ms)=
CPU time spent (ms)=
Physical memory (bytes) snapshot=
Virtual memory (bytes) snapshot=
Total committed heap usage (bytes)=
Shuffle Errors
BAD_ID=
CONNECTION=
IO_ERROR=
WRONG_LENGTH=
WRONG_MAP=
WRONG_REDUCE=
File Input Format Counters
Bytes Read=
File Output Format Counters
Bytes Written=

1.3 查看wordcount结果

$ hadoop fs -ls /outputdir
Found items
-rw-r--r-- hduser supergroup -- : /outputdir/_SUCCESS
-rw-r--r-- hduser supergroup -- : /outputdir/part-r-
$ hadoop fs -cat /outputdir/part-r- JobHistoryServer
Jps
NameNode
ResourceManager
SecondaryNameNode

2. 测试hdfs分布式存储

2.1 上传测试文件

$ ls -lh hadoop-2.7..tar.gz
-rw-r--r-- root root 205M May : hadoop-2.7..tar.gz
$ hadoop fs -put hadoop-2.7..tar.gz /inputdir
$ hadoop fs -ls -h /inputdir
Found items
-rw-r--r-- hduser supergroup 204.2 M -- : /inputdir/hadoop-2.7..tar.gz
-rw-r--r-- hduser supergroup -- : /inputdir/infile

2.2 查看datanode副本信息

Hadoop 2.7.3 完全分布式维护-简单测试篇的更多相关文章

  1. Hadoop 2.7.3 完全分布式维护-部署篇

    测试环境如下  IP       host JDK linux hadop role 172.16.101.55 sht-sgmhadoopnn-01 1.8.0_111 CentOS release ...

  2. Hadoop 2.7.3 完全分布式维护-动态增加datanode篇

    原有环境 http://www.cnblogs.com/ilifeilong/p/7406944.html  IP       host JDK linux hadop role 172.16.101 ...

  3. 安装部署Apache Hadoop (本地模式和伪分布式)

    本节内容: Hadoop版本 安装部署Hadoop 一.Hadoop版本 1. Hadoop版本种类 目前Hadoop发行版非常多,有华为发行版.Intel发行版.Cloudera发行版(CDH)等, ...

  4. Hadoop Single Node Setup(hadoop本地模式和伪分布式模式安装-官方文档翻译 2.7.3)

    Purpose(目标) This document describes how to set up and configure a single-node Hadoop installation so ...

  5. ZooKeeper分布式锁简单实践

    ZooKeeper分布式锁简单实践 在分布式解决方案中,Zookeeper是一个分布式协调工具.当多个JVM客户端,同时在ZooKeeper上创建相同的一个临时节点,因为临时节点路径是保证唯一,只要谁 ...

  6. Hadoop平台K-Means聚类算法分布式实现+MapReduce通俗讲解

        Hadoop平台K-Means聚类算法分布式实现+MapReduce通俗讲解 在Hadoop分布式环境下实现K-Means聚类算法的伪代码如下: 输入:参数0--存储样本数据的文本文件inpu ...

  7. Hadoop、Zookeeper、Hbase分布式安装教程

    参考: Hadoop安装教程_伪分布式配置_CentOS6.4/Hadoop2.6.0   Hadoop集群安装配置教程_Hadoop2.6.0_Ubuntu/CentOS ZooKeeper-3.3 ...

  8. Hadoop 在windows 上伪分布式的安装过程

    第一部分:Hadoop 在windows 上伪分布式的安装过程 安装JDK 1.下载JDK        http://www.oracle.com/technetwork/java/javaee/d ...

  9. Hadoop 2.4.0完全分布式平台搭建、配置、安装

    一:系统安装与配置 Hadoop选择下载2.4.0 http://hadoop.apache.org / http://mirror.bit.edu.cn/apache/hadoop/common/h ...

随机推荐

  1. 1:httpd-2.2基础

    在配置httpd主配置文件时,应该先记得备份一下: #cd /etc/httpd/conf/ #cp httpd.conf{,.bak} #vim /etc/httpd/conf/httpd.conf ...

  2. C#深入多线程

    主线程: th = Thread.CurrentThread; //现在的线程为主线程 th.Name = "MainThread"; //set线程名字:主线程本身没有名字 th ...

  3. Spring-Mybatis依赖

    <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --><dependency> <groupId& ...

  4. R 语言 Windows 环境 安装与Windows下制作R的package--Rtools

    1.1    预装的软件 (所有软件都可以在 http://www.biosino.org/R/R-doc/Rm/ 和 http://www.biosino.org/R/requiredSoftWar ...

  5. 理解 Redis(9) - Publish Subscribe 消息订阅

    在窗口1开通一个名为 redis 的通道: 127.0.0.1:6379> SUBSCRIBE redis Reading messages... (press Ctrl-C to quit) ...

  6. hdu 6170 Two strings dp

    Two strings Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Prob ...

  7. python with as 的用法

    with语句: 不管是否发生异常都会指执行必要的清理操作,比如文件的自动关闭以及线程中锁的自动获取与释放. 比如文件处理,需要获取一个文件句柄,从文件中读取数据,然后关闭文件句柄 不用with语句,代 ...

  8. Qt5数据库

     对于习惯使用SQL语法的用户,QSqlQuery类提供了直接执行SQL语句并处理返回结果的方法.对于习惯使用较高层数据库接口避免使用SQL语句的用户,QSqlTableModel类和QSqlRela ...

  9. css垂直居中方法

    CSS垂直居中的简便方法:{position:absolute;left:0;bottom:0;top:0;right:0;margin:auto;}.

  10. Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor

    转自:https://blog.csdn.net/u013125680/article/details/43887987 解决方案:把java的类库加载进去,在工程上右键选择属性->Java B ...