java a b c jdk mapred b c e f d c++ a k l java c++ d e a b
[root@hadoop-master ~]# hadoop jar /zwf/hadoop-2.7.7/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.7.jar wordcount /test/input /test/output
22/09/03 11:07:55 INFO client.RMProxy: Connecting to ResourceManager at hadoop-master/172.18.0.11:8032
22/09/03 11:07:58 INFO input.FileInputFormat: Total input paths to process : 4
22/09/03 11:07:58 INFO mapreduce.JobSubmitter: number of splits:4
22/09/03 11:08:01 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1662174040293_0001
22/09/03 11:08:02 INFO impl.YarnClientImpl: Submitted application application_1662174040293_0001
22/09/03 11:08:02 INFO mapreduce.Job: The url to track the job: http://hadoop-master:8088/proxy/application_1662174040293_0001/
22/09/03 11:08:02 INFO mapreduce.Job: Running job: job_1662174040293_0001
22/09/03 11:08:15 INFO mapreduce.Job: Job job_1662174040293_0001 running in uber mode : false
22/09/03 11:08:15 INFO mapreduce.Job: map 0% reduce 0%
22/09/03 11:08:33 INFO mapreduce.Job: map 100% reduce 0%
22/09/03 11:08:57 INFO mapreduce.Job: map 100% reduce 100%
22/09/03 11:08:58 INFO mapreduce.Job: Job job_1662174040293_0001 completed successfully
22/09/03 11:08:58 INFO mapreduce.Job: Counters: 49
File System Counters
FILE: Number of bytes read=438
FILE: Number of bytes written=613639
FILE: Number of read operations=0
FILE: Number of large read operations=0
FILE: Number of write operations=0
HDFS: Number of bytes read=683
HDFS: Number of bytes written=62
HDFS: Number of read operations=15
HDFS: Number of large read operations=0
HDFS: Number of write operations=2
Job Counters
Launched map tasks=4
Launched reduce tasks=1
Data-local map tasks=4
Total time spent by all maps in occupied slots (ms)=85201
Total time spent by all reduces in occupied slots (ms)=13894
Total time spent by all map tasks (ms)=85201
Total time spent by all reduce tasks (ms)=13894
Total vcore-milliseconds taken by all map tasks=85201
Total vcore-milliseconds taken by all reduce tasks=13894
Total megabyte-milliseconds taken by all map tasks=87245824
Total megabyte-milliseconds taken by all reduce tasks=14227456
Map-Reduce Framework
Map input records=4
Map output records=84
Map output bytes=572
Map output materialized bytes=456
Input split bytes=451
Combine input records=84
Combine output records=48
Reduce input groups=12
Reduce shuffle bytes=456
Reduce input records=48
Reduce output records=12
Spilled Records=96
Shuffled Maps =4
Failed Shuffles=0
Merged Map outputs=4
GC time elapsed (ms)=679
CPU time spent (ms)=4510
Physical memory (bytes) snapshot=1181548544
Virtual memory (bytes) snapshot=9743728640
Total committed heap usage (bytes)=902299648
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=232
File Output Format Counters
Bytes Written=62
[root@hadoop-master ~]#
[root@hadoop-master ~]#
[root@hadoop-master ~]# hadoop fs -ls /test
Found 4 items
-rw-r--r-- 3 root supergroup 16 2022-09-03 04:00 /test/ZengWenFeng-hadoop.txt
drwxr-xr-x - root supergroup 0 2022-09-03 10:27 /test/input
drwxr-xr-x - root supergroup 0 2022-09-03 11:08 /test/output
-rw-r--r-- 3 root supergroup 0 2022-09-03 05:10 /test/zengwenfeng-java.txt
[root@hadoop-master ~]#
[root@hadoop-master ~]# hadoop fs -ls /test/output
Found 2 items
-rw-r--r-- 3 root supergroup 0 2022-09-03 11:08 /test/output/_SUCCESS
-rw-r--r-- 3 root supergroup 62 2022-09-03 11:08 /test/output/part-r-00000
[root@hadoop-master ~]#
[root@hadoop-master ~]#
/root
[root@hadoop-master ~]#
[root@hadoop-master ~]# hadoop fs -cat /test/output/part-r-00000
a 12
b 12
c 8
c++ 8
d 8
e 8
f 4
java 8
jdk 4
k 4
l 4
mapred 4
[root@hadoop-master ~]#
[root@hadoop-master ~]#
[root@hadoop-master ~]#