基于
两篇文章,已经在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 /input
bin\hdfs dfs -cat /input/files.txt
6.运行
bin\yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.0.jar wordcount /input /output
7.检查结果
sbin\stop-all