使用MapReduce项目在Hadoop集群中提交任务

将项目导成jar包
在这里插入图片描述
将jar包放入虚拟机中
在这里插入图片描述
执行

[root@mihaoyu151 opt]# ll
total 12
-rw-r--r--. 1 root root 8312 Oct 27  2021 hadoopstu-1.0-SNAPSHOT.jar
drwxr-xr-x. 2 root root  112 Oct 26 03:36 install
drwxr-xr-x. 2 root root   82 Oct 27  2021 mysyssh
drwxr-xr-x. 2 root root   41 Oct 27  2021 shelldemo
drwxr-xr-x. 4 root root   37 Oct 25 18:02 soft
[root@mihaoyu151 opt]# hadoop jar hadoopstu-1.0-SNAPSHOT.jar nj.zb.demo1.WordCountDriver /input /output
21/10/27 15:32:43 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
21/10/27 15:32:44 INFO client.RMProxy: Connecting to ResourceManager at mihaoyu151/192.168.133.151:8032
21/10/27 15:32:44 INFO mapreduce.JobSubmissionFiles: Permissions on staging directory /tmp/hadoop-yarn/staging/root/.staging are incorrect: rwxrwxrwx. Fixing permissions to correct value rwx------
21/10/27 15:32:44 WARN mapreduce.JobResourceUploader: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
21/10/27 15:32:45 INFO input.FileInputFormat: Total input paths to process : 2
21/10/27 15:32:45 INFO mapreduce.JobSubmitter: number of splits:2
21/10/27 15:32:45 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1635328392348_0005
21/10/27 15:32:45 INFO impl.YarnClientImpl: Submitted application application_1635328392348_0005
21/10/27 15:32:45 INFO mapreduce.Job: The url to track the job: http://mihaoyu151:8088/proxy/application_1635328392348_0005/
21/10/27 15:32:45 INFO mapreduce.Job: Running job: job_1635328392348_0005
21/10/27 15:32:51 INFO mapreduce.Job: Job job_1635328392348_0005 running in uber mode : false
21/10/27 15:32:51 INFO mapreduce.Job:  map 0% reduce 0%
21/10/27 15:32:57 INFO mapreduce.Job:  map 50% reduce 0%
21/10/27 15:32:58 INFO mapreduce.Job:  map 100% reduce 0%
21/10/27 15:33:02 INFO mapreduce.Job:  map 100% reduce 100%
21/10/27 15:33:02 INFO mapreduce.Job: Job job_1635328392348_0005 completed successfully
21/10/27 15:33:02 INFO mapreduce.Job: Counters: 49
	File System Counters
		FILE: Number of bytes read=5963
		FILE: Number of bytes written=441600
		FILE: Number of read operations=0
		FILE: Number of large read operations=0
		FILE: Number of write operations=0
		HDFS: Number of bytes read=3182
		HDFS: Number of bytes written=2697
		HDFS: Number of read operations=9
		HDFS: Number of large read operations=0
		HDFS: Number of write operations=2
	Job Counters 
		Launched map tasks=2
		Launched reduce tasks=1
		Data-local map tasks=2
		Total time spent by all maps in occupied slots (ms)=8351
		Total time spent by all reduces in occupied slots (ms)=2760
		Total time spent by all map tasks (ms)=8351
		Total time spent by all reduce tasks (ms)=2760
		Total vcore-milliseconds taken by all map tasks=8351
		Total vcore-milliseconds taken by all reduce tasks=2760
		Total megabyte-milliseconds taken by all map tasks=8551424
		Total megabyte-milliseconds taken by all reduce tasks=2826240
	Map-Reduce Framework
		Map input records=12
		Map output records=497
		Map output bytes=4963
		Map output materialized bytes=5969
		Input split bytes=207
		Combine input records=0
		Combine output records=0
		Reduce input groups=295
		Reduce shuffle bytes=5969
		Reduce input records=497
		Reduce output records=295
		Spilled Records=994
		Shuffled Maps =2
		Failed Shuffles=0
		Merged Map outputs=2
		GC time elapsed (ms)=140
		CPU time spent (ms)=1250
		Physical memory (bytes) snapshot=546717696
		Virtual memory (bytes) snapshot=8181846016
		Total committed heap usage (bytes)=392372224
	Shuffle Errors
		BAD_ID=0
		CONNECTION=0
		IO_ERROR=0
		WRONG_LENGTH=0
		WRONG_MAP=0
		WRONG_REDUCE=0
	File Input Format Counters 
		Bytes Read=2975
	File Output Format Counters 
		Bytes Written=2697
[root@mihaoyu151 opt]# 

在这里插入图片描述
在这里插入图片描述

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

honconM

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值