Ubuntu下Eclipse开发Hadoop应用程序环境配置(5)

第八步:运行WordCount

Run As -> Run on Hadoop 选择之前配置好的MapReduce运行环境,点击“Finish”运行。

运行过程如下:

12/10/18 22:53:38 INFO jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
12/10/18 22:53:38 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
12/10/18 22:53:38 WARN mapred.JobClient: No job jar file set.  User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
12/10/18 22:53:38 INFO mapred.FileInputFormat: Total input paths to process : 2
12/10/18 22:53:39 INFO mapred.JobClient: Running job: job_local_0001
12/10/18 22:53:39 INFO mapred.FileInputFormat: Total input paths to process : 2
12/10/18 22:53:39 INFO mapred.MapTask: numReduceTasks: 1
12/10/18 22:53:39 INFO mapred.MapTask: io.sort.mb = 100
12/10/18 22:53:39 INFO mapred.MapTask: data buffer = 79691776/99614720
12/10/18 22:53:39 INFO mapred.MapTask: record buffer = 262144/327680
12/10/18 22:53:39 INFO mapred.MapTask: Starting flush of map output
12/10/18 22:53:39 INFO mapred.MapTask: Finished spill 0
12/10/18 22:53:39 INFO mapred.TaskRunner: Task:attempt_local_0001_m_000000_0 is done. And is in the process of commiting
12/10/18 22:53:39 INFO mapred.LocalJobRunner: hdfs://localhost:9100/user/tanglg1987/input/file01.txt:0+12
12/10/18 22:53:39 INFO mapred.TaskRunner: Task 'attempt_local_0001_m_000000_0' done.
12/10/18 22:53:39 INFO mapred.MapTask: numReduceTasks: 1
12/10/18 22:53:39 INFO mapred.MapTask: io.sort.mb = 100
12/10/18 22:53:39 INFO mapred.MapTask: data buffer = 79691776/99614720
12/10/18 22:53:39 INFO mapred.MapTask: record buffer = 262144/327680
12/10/18 22:53:39 INFO mapred.MapTask: Starting flush of map output
12/10/18 22:53:39 INFO mapred.MapTask: Finished spill 0
12/10/18 22:53:39 INFO mapred.TaskRunner: Task:attempt_local_0001_m_000001_0 is done. And is in the process of commiting
12/10/18 22:53:39 INFO mapred.LocalJobRunner: hdfs://localhost:9100/user/tanglg1987/input/file02.txt:0+13
12/10/18 22:53:39 INFO mapred.TaskRunner: Task 'attempt_local_0001_m_000001_0' done.
12/10/18 22:53:39 INFO mapred.LocalJobRunner:
12/10/18 22:53:39 INFO mapred.Merger: Merging 2 sorted segments
12/10/18 22:53:39 INFO mapred.Merger: Down to the last merge-pass, with 2 segments left of total size: 69 bytes
12/10/18 22:53:39 INFO mapred.LocalJobRunner:
12/10/18 22:53:39 INFO mapred.TaskRunner: Task:attempt_local_0001_r_000000_0 is done. And is in the process of commiting
12/10/18 22:53:39 INFO mapred.LocalJobRunner:
12/10/18 22:53:39 INFO mapred.TaskRunner: Task attempt_local_0001_r_000000_0 is allowed to commit now
12/10/18 22:53:39 INFO mapred.FileOutputCommitter: Saved output of task 'attempt_local_0001_r_000000_0' to hdfs://localhost:9100/user/tanglg1987/output
12/10/18 22:53:39 INFO mapred.LocalJobRunner: reduce > reduce
12/10/18 22:53:39 INFO mapred.TaskRunner: Task 'attempt_local_0001_r_000000_0' done.
12/10/18 22:53:40 INFO mapred.JobClient:  map 100% reduce 100%
12/10/18 22:53:40 INFO mapred.JobClient: Job complete: job_local_0001
12/10/18 22:53:40 INFO mapred.JobClient: Counters: 15
12/10/18 22:53:40 INFO mapred.JobClient:  FileSystemCounters
12/10/18 22:53:40 INFO mapred.JobClient:    FILE_BYTES_READ=49601
12/10/18 22:53:40 INFO mapred.JobClient:    HDFS_BYTES_READ=62
12/10/18 22:53:40 INFO mapred.JobClient:    FILE_BYTES_WRITTEN=100852
12/10/18 22:53:40 INFO mapred.JobClient:    HDFS_BYTES_WRITTEN=25
12/10/18 22:53:40 INFO mapred.JobClient:  Map-Reduce Framework
12/10/18 22:53:40 INFO mapred.JobClient:    Reduce input groups=3
12/10/18 22:53:40 INFO mapred.JobClient:    Combine output records=4
12/10/18 22:53:40 INFO mapred.JobClient:    Map input records=2
12/10/18 22:53:40 INFO mapred.JobClient:    Reduce shuffle bytes=0
12/10/18 22:53:40 INFO mapred.JobClient:    Reduce output records=3
12/10/18 22:53:40 INFO mapred.JobClient:    Spilled Records=8
12/10/18 22:53:40 INFO mapred.JobClient:    Map output bytes=57
12/10/18 22:53:40 INFO mapred.JobClient:    Map input bytes=25
12/10/18 22:53:40 INFO mapred.JobClient:    Combine input records=4
12/10/18 22:53:40 INFO mapred.JobClient:    Map output records=4
12/10/18 22:53:40 INFO mapred.JobClient:    Reduce input records=4

查看运行结果:

在输出目录中,可以看见WordCount程序的输出文件。除此之外,还可以看见一个logs文件夹,里面会有运行的日志。

Ubuntu下Eclipse开发Hadoop应用程序环境配置

DFS Locations下面会有一只大象,下面会有一个文件夹,即 hdfs的根目录,这里就是展示的分布式文件系统的目录结构了。
到这里为止,Eclipse hadoop开发环境配置已经完全搭建完毕。最后,就可以在eclipse中像一般java程序那样开发hadoop程序了。哈哈,搞定!

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/185524c111fd630c625295632b957a4e.html