Changes between Version 2 and Version 3 of III110813/Lab8
- Timestamp:
- Oct 21, 2011, 2:52:48 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
III110813/Lab8
v2 v3 12 12 * 上傳內容到 HDFS 內[[BR]]upload data to HDFS 13 13 {{{ 14 $ mkdir lab 6_input15 $ echo "I like NCTU Cloud Course." > lab 6_input/input116 $ echo "I like nctu Cloud Course, and we enjoy this course." > lab 6_input/input217 $ hadoop fs -put lab 6_input lab6_input18 $ hadoop fs -ls lab 6_input14 $ 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/lab 6_input/input121 -rw-r--r-- 2 hXXXX supergroup 52 2011-04-19 10:07 /user/hXXXX/lab 6_input/input220 -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 lab 6_input/ lab6_out1/37 $ hadoop fs -cat lab 6_out1/part-0000036 $ hadoop jar wordcount.jar WordCount lab8_input/ lab8_out1/ 37 $ hadoop fs -cat lab8_out1/part-00000 38 38 }}} 39 39 40 * lab 6_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 lab 6_input lab6_out2 -skip pattern.txt76 $ hadoop fs -cat lab 6_out2/part-0000075 $ 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 * lab 6_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 lab 6_input lab6_out3 -skip pattern.txt98 $ hadoop fs -cat lab 6_out3/part-0000097 $ 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 * lab 6_out3 執行結果[[BR]]You should see results like this:101 * lab8_out3 執行結果[[BR]]You should see results like this: 102 102 {{{ 103 103 #!text