hadoop 运行wordcount 例子

#创建几个目录
hadoop fs -mkdir /user/
hadoop fs -mkdir /user/walle
hadoop fs -mkdir /user/walle/wordcount
#把本地文件拷贝到dfs里
hadoop dfs -copyFromLocal ./inputText.txt /user/walle/wordcount
#运行,注意output3目录不用创建
hadoop jar /usr/local/Cellar/hadoop/3.1.0/libexec/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.0.jar wordcount /user/walle/wordcount/inputText.txt /user/walle/wordcount/output3

hadoop fs -cat /user/walle/wordcount/output3/part-r-00000 用这个来查看结果

http://www.waitingfy.com/archives/3993

3993

Leave a Reply

Name and Email Address are required fields.
Your email will not be published or shared with third parties.