将项目导成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]#