75 | | |
| 75 | |
| 76 | * 現在您已經準備好可以開始使用 Hadoop 叢集,底下是三種使用模式:[[BR]]Now you are ready to start your Hadoop cluster in one of the three supported modes: |
| 77 | * 單機模式[[BR]]Local (Standalone) Mode |
| 78 | * 偽分散模式[[BR]]Pseudo-Distributed Mode |
| 79 | * 全分散模式[[BR]]Fully-Distributed Mode |
| 80 | |
| 81 | * 預設 Hadoop 已經設定成可以執行單機模式。這種模式很適合拿來除錯。底下的範例將把 conf 目錄當作輸入,並且找尋符合標準表示法的結果。輸出將寫在指定的 output 目錄。[[BR]]By default, Hadoop is configured to run in a non-distributed mode, as a single Java process. This is useful for debugging. The following example copies the unpacked conf directory to use as input and then finds and displays every match of the given regular expression. Output is written to the given output directory. |
| 82 | |
| 83 | {{{ |
| 84 | /opt/hadoop$ mkdir input |
| 85 | /opt/hadoop$ cp conf/*.xml input |
| 86 | /opt/hadoop$ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+' |
| 87 | /opt/hadoop$ cat output/* |
| 88 | }}} |
| 89 | |