windows中hadoop使用测试

来源:互联网 发布:系统制作软件 编辑:程序博客网 时间:2024/05/18 23:14

基于

windows编译安装hadoop

windows 安装hadoop

两篇文章,已经在windows上安装了hadoop。

接下来,就试一下吧,测试的是wordcount MapReduce job(在\share\hadoop\mapreduce\hadoop-mapreduce-examples-2.5.0.jar)。主要用到的命令是

bin\hdfs dfs 
1.首先是运行(在cmd上运行,并且以管理员身份运行

sbin\start-all
2.新建一个txt用于测试(D:\files.txt),内容自己喜欢吧,要求是都是英文单词。

3.在HDFS上新建一个目录('input'吧,方便记忆)。

bin\hdfs dfs -mkdir /input
4.把测试用的文件放进去吧(命令类似于linux的cp)

bin\hdfs dfs -copyFromLocal d:/files.txt /input
5.检查一下吧

bin\hdfs dfs -ls /inputbin\hdfs dfs -cat /input/files.txt
6.运行

bin\yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.0.jar wordcount /input /output
7.检查结果
bin\hdfs dfs -cat /output/*
http://abhijitg:8088/cluster
8.停止hadoop
sbin\stop-all

reference:Run Hadoop wordcount MapReduce Example on Windows
0 0
原创粉丝点击