close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": libtasn1.so.6: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Oct 21, 2011, 2:52:48 PM (14 years ago)
- Author:
-
jazz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v2
|
v3
|
|
| 12 | 12 | * 上傳內容到 HDFS 內[[BR]]upload data to HDFS |
| 13 | 13 | {{{ |
| 14 | | $ mkdir lab6_input |
| 15 | | $ echo "I like NCTU Cloud Course." > lab6_input/input1 |
| 16 | | $ echo "I like nctu Cloud Course, and we enjoy this course." > lab6_input/input2 |
| 17 | | $ hadoop fs -put lab6_input lab6_input |
| 18 | | $ hadoop fs -ls lab6_input |
| | 14 | $ mkdir lab8_input |
| | 15 | $ echo "I like NCTU Cloud Course." > lab8_input/input1 |
| | 16 | $ echo "I like nctu Cloud Course, and we enjoy this course." > lab8_input/input2 |
| | 17 | $ hadoop fs -put lab8_input lab8_input |
| | 18 | $ hadoop fs -ls lab8_input |
| 19 | 19 | Found 2 items |
| 20 | | -rw-r--r-- 2 hXXXX supergroup 26 2011-04-19 10:07 /user/hXXXX/lab6_input/input1 |
| 21 | | -rw-r--r-- 2 hXXXX supergroup 52 2011-04-19 10:07 /user/hXXXX/lab6_input/input2 |
| | 20 | -rw-r--r-- 2 hXXXX supergroup 26 2011-04-19 10:07 /user/hXXXX/lab8_input/input1 |
| | 21 | -rw-r--r-- 2 hXXXX supergroup 52 2011-04-19 10:07 /user/hXXXX/lab8_input/input2 |
| 22 | 22 | }}} |
| 23 | 23 | |
| … |
… |
|
| 34 | 34 | $ javac -classpath hadoop-core.jar -d MyJava WordCount.java |
| 35 | 35 | $ jar -cvf wordcount.jar -C MyJava . |
| 36 | | $ hadoop jar wordcount.jar WordCount lab6_input/ lab6_out1/ |
| 37 | | $ hadoop fs -cat lab6_out1/part-00000 |
| | 36 | $ hadoop jar wordcount.jar WordCount lab8_input/ lab8_out1/ |
| | 37 | $ hadoop fs -cat lab8_out1/part-00000 |
| 38 | 38 | }}} |
| 39 | 39 | |
| 40 | | * lab6_out1 執行結果 [[BR]]You should see results like this : |
| | 40 | * lab8_out1 執行結果 [[BR]]You should see results like this : |
| 41 | 41 | {{{ |
| 42 | 42 | #!text |
| … |
… |
|
| 73 | 73 | $ javac -classpath hadoop-core.jar -d MyJava2 WordCount2.java |
| 74 | 74 | $ jar -cvf wordcount2.jar -C MyJava2 . |
| 75 | | $ hadoop jar wordcount2.jar WordCount2 lab6_input lab6_out2 -skip pattern.txt |
| 76 | | $ hadoop fs -cat lab6_out2/part-00000 |
| | 75 | $ hadoop jar wordcount2.jar WordCount2 lab8_input lab8_out2 -skip pattern.txt |
| | 76 | $ hadoop fs -cat lab8_out2/part-00000 |
| 77 | 77 | }}} |
| 78 | 78 | |
| 79 | | * lab6_out2 執行結果[[BR]]You should see results like this: |
| | 79 | * lab8_out2 執行結果[[BR]]You should see results like this: |
| 80 | 80 | {{{ |
| 81 | 81 | #!text |
| … |
… |
|
| 95 | 95 | * Let's given case insensitive and ignore pattern for this example |
| 96 | 96 | {{{ |
| 97 | | $ hadoop jar wordcount2.jar WordCount2 -Dwordcount.case.sensitive=false lab6_input lab6_out3 -skip pattern.txt |
| 98 | | $ hadoop fs -cat lab6_out3/part-00000 |
| | 97 | $ hadoop jar wordcount2.jar WordCount2 -Dwordcount.case.sensitive=false lab8_input lab8_out3 -skip pattern.txt |
| | 98 | $ hadoop fs -cat lab8_out3/part-00000 |
| 99 | 99 | }}} |
| 100 | 100 | |
| 101 | | * lab6_out3 執行結果[[BR]]You should see results like this: |
| | 101 | * lab8_out3 執行結果[[BR]]You should see results like this: |
| 102 | 102 | {{{ |
| 103 | 103 | #!text |