| | 10 | * 執行 Wordcount 範例 |
| | 11 | {{{ |
| | 12 | ~/hadoop-0.18.2$ bin/hadoop fs -put conf conf |
| | 13 | ~/hadoop-0.18.2$ bin/hadoop fs -ls |
| | 14 | Found 1 items |
| | 15 | drwxr-xr-x - jazz supergroup 0 2008-11-05 19:34 /user/jazz/conf |
| | 16 | ~/hadoop-0.18.2$ bin/hadoop jar /home/jazz/hadoop-0.18.2/hadoop-0.18.2-examples.jar wordcount |
| | 17 | ERROR: Wrong number of parameters: 0 instead of 2. |
| | 18 | wordcount [-m <maps>] [-r <reduces>] <input> <output> |
| | 19 | Generic options supported are |
| | 20 | -conf <configuration file> specify an application configuration file |
| | 21 | -D <property=value> use value for given property |
| | 22 | -fs <local|namenode:port> specify a namenode |
| | 23 | -jt <local|jobtracker:port> specify a job tracker |
| | 24 | -files <comma separated list of files> specify comma separated files to be copied to the map reduce cluster |
| | 25 | -libjars <comma separated list of jars> specify comma separated jar files to include in the classpath. |
| | 26 | -archives <comma separated list of archives> specify comma separated archives to be unarchived on the compute machines. |
| | 27 | |
| | 28 | The general command line syntax is |
| | 29 | bin/hadoop command [genericOptions] [commandOptions] |
| | 30 | ~/hadoop-0.18.2$ bin/hadoop jar /home/jazz/hadoop-0.18.2/hadoop-0.18.2-examples.jar wordcount conf output |
| | 31 | }}} |
| | 32 | * Wordcount 的原始碼 |
| | 33 | {{{ |
| | 34 | jazz@drbl:~/hadoop-0.18.2/$ vi src/examples/org/apache/hadoop/examples/WordCount.java |
| | 35 | }}} |