| 10 | = 範例一:使用 cat 當 mapper,使用 wc 當 reducer = |
| 11 | |
| 12 | * 用 Standard Alone Mode 跑 hadoop code ( using streaming example ) |
| 13 | {{{ |
| 14 | hadoop@lucid:~$ cd /opt/hadoop |
| 15 | hadoop@lucid:/opt/hadoop$ bin/hadoop jar ./contrib/streaming/hadoop-0.20.2-streaming.jar -input input -output output -mapper /bin/cat -reducer /usr/bin/wc |
| 16 | }}} |
| 17 | |
| 18 | * 比較:使用 單機安裝模式 |
| 19 | {{{ |
| 20 | hadoop@lucid:~$ cd /opt/hadoop |
| 21 | // 設定 core-site.xml, hdfs-site.xml, mapred-site.xml |
| 22 | hadoop@lucid:/opt/hadoop$ bin/hadoop namenode -format |
| 23 | hadoop@lucid:/opt/hadoop$ bin/start-all.sh |
| 24 | hadoop@lucid:/opt/hadoop$ bin/hadoop fs -put conf input |
| 25 | hadoop@lucid:/opt/hadoop$ bin/hadoop jar ./contrib/streaming/hadoop-0.20.2-streaming.jar -input input -output output -mapper /bin/cat -reducer /usr/bin/wc |
| 26 | }}} |