Hadoop2.7运行自带的wordcount

目录

1、准备数据文件

2、把文件上传到HDFS上

3、执行命令

4、原理解析


1、准备数据文件

word1.txt 
i love the world
word2.txt 
i love the world , hello ni hao

2、把文件上传到HDFS上

hadoop fs -mkdir /input

 hadoop fs -put word1.txt /input

 hadoop fs -put word2.txt /input

 

3、执行命令

 hadoop jar /export/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount  /input   /output

输出日志:

[root@node1 ~]# hadoop jar /export/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount  /input   /output
18/09/09 09:14:48 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18/09/09 09:14:48 INFO client.RMProxy: Connecting to ResourceManager at node1/192.168.254.101:8032
18/09/09 09:14:49 INFO input.FileInputFormat: Total input paths to process : 2
18/09/09 09:14:49 INFO mapreduce.JobSubmitter: number of splits:2
18/09/09 09:14:49 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1536498642048_0001
18/09/09 09:14:50 INFO impl.YarnClientImpl: Submitted application application_1536498642048_0001
18/09/09 09:14:50 INFO mapreduce.Job: The url to track the job: http://node1:8088/proxy/application_1536498642048_0001/
18/09/09 09:14:50 INFO mapreduce.Job: Running job: job_1536498642048_0001
18/09/09 09:14:58 INFO mapreduce.Job: Job job_1536498642048_0001 running in uber mode : false
18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值