- Hadoop Beginner's Guide
- Garry Turkington
- 200字
- 2021-07-29 16:51:39
Time for action – running WordCount on a local Hadoop cluster
Now we have generated the class files and collected them into a JAR file, we can run the application by performing the following steps:
- Submit the new JAR file to Hadoop for execution.
$ hadoop jar wc1.jar WordCount1 test.txt output
- If successful, you should see the output being very similar to the one we obtained when we ran the Hadoop-provided sample WordCount in the previous chapter. Check the output file; it should be as follows:
$ Hadoop fs –cat output/part-r-00000 This 1 yes 1 a 1 is 2 test 1 this 1
What just happened?
This is the first time we have used the Hadoop JAR command with our own code. There are four arguments:
- The name of the JAR file.
- The name of the driver class within the JAR file.
- The location, on HDFS, of the input file (a relative reference to the
/user/Hadoop home
folder, in this case). - The desired location of the output folder (again, a relative path).
推薦閱讀
- Design for the Future
- 會聲會影X5視頻剪輯高手速成
- 基于LabWindows/CVI的虛擬儀器設計與應用
- TIBCO Spotfire:A Comprehensive Primer(Second Edition)
- 反饋系統:多學科視角(原書第2版)
- 人工智能與人工生命
- 嵌入式操作系統
- JavaScript典型應用與最佳實踐
- Nginx高性能Web服務器詳解
- Ruby on Rails敏捷開發最佳實踐
- Kubernetes for Serverless Applications
- Blender 3D Printing by Example
- 電腦上網輕松入門
- AVR單片機工程師是怎樣煉成的
- 典型Hadoop云計算